Slashdot Mirror


What UNIX Shell Config Settings Work for Newbies?

Human_Diastrophism asks: "I'm involved in the roll-out of a new *x-based computing service in my previously Windows-centric organization. I want things set up so that newcomers will understand and like what they see. They should feel encouraged to behave appropriately, i.e. explore and extend the environment for themselves. We're talking about technically literate folk who are simply new to the demands and freedoms of the command line. No shell advocacy, please; it's going to be ksh or bash. What would you put in a .profile or .rc to make things work smoothly and give the user the capabilities and feedback they need? I'm thinking about stuff like 'stty erase ^H' and 'set -o emacs' so the edit keys work, and a compact but informative prompt. But what else would you put in? What would you leave out?"

7 of 159 comments (clear)

  1. Advice: Install Midnight Commander. by Richard+Steiner · · Score: 4, Informative

    That way, the newbie can perform various filesystem commands or navigate the filesystem without having to know the actual commands at first, and they can slowly wean themselves off the filemanager if they want to later on (it does provide a command line).

    Heck, I still use mc a lot after over 10 years using Linux. It's a very useful tool.

    --
    Mainframe/UNIX Bit Twiddler and long time Windows/Linux Hobbyist.
    The Theorem Theorem: If If, Then Then.
  2. set -o emacs? by Chris_Jefferson · · Score: 4, Insightful

    I'd think anyone who was familar with emacs shortcut keys would already know about the shell..

    I would say try to change the shell as little as possible from default, else you are going to confuse them if they have previously done a little command line work, or try to install it at home, or try to learn it from a book / web guide.

    I would consider using aliasing to stick a "-i" on rm... nice for beginners (and experts as well to be honest)

    --
    Combination - fun iPhone puzzling
  3. recommended .bashrc file... by mshiltonj · · Score: 5, Funny
    I recommend this for a newbie .bashrc file:

    exit

  4. .profile/.rc Comments! by infernalC · · Score: 4, Insightful

    1. Set up the skeleton .bashrc with just a few customizations. For each customization, include a comment so that they will learn how to customize too. For example:

    # Here we will add a directory to the existing
    # command search path. This command tells the
    # shell to look in the bin directory under your
    # home directory (~) for programs before the
    # system-wide program directories.
    export PATH=~/bin:$PATH

    2. Send them an e-mail telling them that they can customize their accounts by editing ~/.bashrc with an easy editor (nano/pico) or whatever. Point them to a nice tutorial on the web, too. Also, tell them that they can reset their settings to the default by typing reset_shell_defaults, and put a script in /usr/local/bin that prompts "Are you sure? Your settings will be lost!" and then overwrites .bashrc. That way, they won't be afraid to play. Nobody ever got 1337 without playing around.


    3. Offer up Midinight Commander for those who need some curses.


    4. Tell them about man/apropos/info.


  5. Re:For the old farts familiar with DOS by dreamer-of-rules · · Score: 4, Interesting
    even better, alias dos commands to mini-helps.

    > copy old.txt new.txt
    Try using 'cp <options> <source> <target>'. For example:
    cp old.txt new.txt
    Type 'man cp' for more help.

    Consider AT, CHKDSK, CMD, COPY, DATE?, DEL, DIR, ECHO, EDIT, FC, MKDIR or MD, MOVE, RD, RENAME?, TIME?, XCOPY.

    --
    Everyone is entitled to his own opinions, but not his own facts.
  6. Re:No Cheat sheet - alias the commands! by Haeleth · · Score: 5, Informative
    you can make their lives so much simpler with several aliases:
    [...]
    alias rename="mv"


    BAD idea. DOS commands are not just Unix commands with vowels in; they work differently.

    For example, in DOS you can do
    C:\> ren *.txt *.bak
    and that is the equivalent of
    $ for t in *.txt; do mv $t ${t/%txt/bak}; done
    ...except it's not case sensitive. Note that it is not equivalent to
    $ mv *.txt *.bak
    which is what your dangerous alias will make people expect.

    ALSO: Create a couple of directories in everyone's home dir named, "MyDocuments", "MyPictures", etc., so people don't even have to learn how to create a directory.

    What - not just alias md="mkdir"?
  7. Re:$PS1 by gregmac · · Score: 4, Informative

    I personally have settled on

    PS1='[\u@\h:\w]\$ '

    as my prompt. I work on many different systems (it's not uncommon for me to have 3 or 4 different sessions to different machines), so the hostname is almost a requirment. Username is a bit handy as well .. and it doesn't take up lots of space, so that's ok.

    I also started using \w as my path (which prints the full path) simply because it would be too easy to lose track without it. When you come back to a window and it says "[root@ws005:bin]# " that doesn't really tell you a lot. I much prefer to see "[root@ws005:/usr/bin]#" or "[greg@hydrogen:/usr/local/someprog/bin]$".

    Also handy is that the prompt is a valid source/target for scp or rsync.

    --
    Speak before you think