Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I'm still a newbie, but I have the basics working for me. Now I want to make my Linux environment seem more like my Unix environment back when I worked for a big semiconductor company. (I was spoiled by having excellent IT people in house, and never had to learn the nuts and bolts of Unix, and am now climbing the learning curve where I'm clueless in some areas and quite expert in others. Here's a couple of things I need help with:
1. Appending /home/$USER/bin to PATH
I used to have lines in my .profile which said
I used to keep executable scripts and little C programs in $HOME/bin and could execute them from anyplace in my environment.
I'm using Red Hat Linux (Workstation) 2.6.9.
I guess my question is: What is the Linux equivalent of .profile (which executes on log in)?
2. Changing prompt from $ to "/home/$USER/... to present directory"\
I had a line in my .profile for many years that did this with a very short command. Once I know the .profile equivalent, I want to add this command to it.
3. Repeating previous command with <esc>-k
I'm not quite sure what shell we were using, but I recall that <esc>-k did not work unless we added a command to our .profile. When it works, the <esc>-k sequence brings the previous command onto the command line. One may repeat it to go back through history and use <esc>-j to go forward. After hitting <esc>-k one may even search through history for part of a command by hitting "/" followed by one or more characters.
I haven't been able to figure this one out either. Can somebody point me to the answer?
Better yet, are answers to these three questions available in a single document somewhere?
If you want to stick with Linux stds, you're /etc/passwd acct entry will specify the bash shell by default.
As above, the (user specific) login files are .bash_profile (= .profile) & .bashrc (= .kshrc).
You should find that the shell automatically maps the cursor keys, much easier than <esc>h,j,k,l sequences.
This also applies to the default editor vim (Vi IMproved), basically vi with extensions. You may well find that both vi & vim are installed, but by default, 'vi' is symlinked to vim.
I work with both commercial *nix using ksh and Linux + vim,I prefer vim when possible. The extensions can be quite handy eg colour syntax and handles very long lines properly.
3) If you want the vi style commands, type "set -o vi". I agree that the up and down arrows are easier, but some people like being able to do vi-style substitution and searches in the command history. One I use a lot is "Esc+/partial"
Last edited by MBybee; 08-19-2009 at 07:31 PM.
Reason: Added an even better bash customization link. And fixed a typo cause I just can't type today
All answers are spot-on and complete. Thank you. Here's my plan:
1. I will update /etc/passwd to use /bin/ksh
2. I do like the <esc>-k etc. sequences because of the ability to search and substitute in the command history. I'm no fan of either vi or vim -- once I found nedit I never looked back. In fact, it was when trying to put my nedit command into $HOME/bin that I bumped into the frustration of its not being available at the command line.
3. It was the PS1 command which I'd forgotten, as well as the set -o vi. Thanks for jogging my memory.
4. Lots of links for me to follow. Thanks for those too.