Forgot your password?
typodupeerror
Unix Operating Systems Software

What UNIX Shell Config Settings Work for Newbies? 159

Posted by Cliff
from the tab-completion-is-your-friend dept.
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?"
This discussion has been archived. No new comments can be posted.

What UNIX Shell Config Settings Work for Newbies?

Comments Filter:
  • by Richard Steiner (1585) * <rsteiner@visi.com> on Thursday April 28, 2005 @02:19PM (#12374586) Homepage Journal
    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.
    • That's very very true! Although I have quite a bit of command prompt experience (I've been using linux for about 6 years now) I use MC even for basic things such as changing directories.

      If you don't know the directory layout, it's easy to change the directory using the Alt+S combination to jump to a specific letter. Also, Ctrl+X Ctrl+S creates a link, Ctrl+X T copies the current file to the command line, ctrl+O reveals the command line, has ftp browsing, supports most of the archive formats (rpm, zips, rar
  • $PS1 (Score:4, Informative)

    by Otter (3800) on Thursday April 28, 2005 @02:19PM (#12374592) Journal
    Give them a helpful prompt! We can argue about what that entails (I recommend the path to PWD), but anything functional is better than "bash-2.03" or whatever it is now.
    • use jedi mind tricks (Score:3, Interesting)

      by nocomment (239368)
      I'd also recomend creating a file called 'README.EXE' and putting a copy in their homedir and a copy somewhere on PATH. chmod +x and have the file jsut contain
      #!/bin/bash

      echo"tutorial blah blah blah
      ls does blah blah blah
      to find more info use man blah blah blah

      I think you get the idea.

      most newb are familiar with the idea that .exe means something you can run, and therefore the idea of typing 'README.EXE' to view the howto would not be all that alien to them.
      • by Anonymous Coward
        most newb are familiar with the idea that .exe means something you can run, and therefore the idea of typing 'README.EXE' to view the howto would not be all that alien to them.

        Nonsense. Anyone who associates ".exe" with running a program is a Windows power user, and they will NOT associate "readme.exe" with anything, because readmes are always "readme.txt".

        The command to get help in a Windows command prompt is "help", just like in bash, and it works just like bash's. A useful thing to do would be to al
        • You'd think so wouldn't you. When i first saw that done I thought it looked weird too. A company I used to work for gave shell accounts to any technical employee that wanted one on their 'testing' server. Most people had never learned linux before and therefore didn't really know what to do. The real admin of the server did that, and the newbs ate it up. I initially thought it was a bad idea because it just showed the windows people that .exe's ran on linux (that was my thought anyway) but it proved to
      • by Frnknstn (663642)
        Except, of course, to run a file called README.EXE under a MS OS, the user would just type 'readme'. The new unix user would sit for 10 minutes wondering why that wasn't working, and then somebody would walk past and say "in unix, you need to type out the full name."

        The user would then sit for half an hour, trying to work out why typing 'readme.exe' doesn't start 'README.EXE'.

        Once he is told that the new shell is case sensitive, three days will pass before he finds out that files in the current directory
    • Re:$PS1 (Score:3, Interesting)

      by fm6 (162816)

      We can argue about what that entails...

      Can and will.

      A lot of the stuff that traditionally goes in shell prompts is outdated or inappropriate for newbies. If you're using using the shell in a terminal window (as almost everybody does these days, especially newbies), you don't need email notification, time, CPU load, and a lot of other crap you can have in a GUI window. The name of the machine you're on is helpful is you're access a lot of different machines -- but most newbies won't do that. (Let's all

      • Re:$PS1 (Score:5, Informative)

        by gregmac (629064) on Thursday April 28, 2005 @05:21PM (#12376698) Homepage
        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.

        • by fm6 (162816)
          I guess your prompt is handy if you work on a lot of different systems and accounts, and use scp or rsync a lot. But we are talking newbies here. They'll probably find the path name helpful, but the other stuff would just confuse them.
        • \w is especially handy when you're working in nested directory structures that contain multiple similarly named directories. Java projects are notorious for this.

          [you@box project]$ _

          Um, okaaay... is that:

          ~/project
          ~/project/src/main/java/com/example/pro ject
          ~/project/target/project
          ~/project/target/c lasses/com/example/project
          ~/project/target/proje ct/WEB-INF/classes/com/example/project

          or something I didn't think of in that list?

      • Re:$PS1 (Score:3, Insightful)

        by klui (457783)
        Path is the most important, then followed by machine name. I do access other machines, but hardly ever more than 4 at a time. A more important thing is to set cd aliased so it changes the window title of your terminal emulator. It is absolutely required if you have 8 or 9 windows and you want to get back at some window you were using 20 or even 5 minutes ago.

        Another thing I do is set ls, ll, and lr aliases and include -aF switches in addition to the -l and -R for the latter two, respectively (I just set ls

        • A more important thing is to set cd aliased so it changes the window title of your terminal emulator.

          If you are using bash, setting PROMPT_COMMAND might be better than aliasing cd. Personally, I only put the hostname in the window title. Having the path in there annoys me.

          declare -x PROMPT_COMMAND="echo -ne '\033]0;${HOSTNAME}\007'"
        • You could use zsh (basically bash on steroids) and use a shared history. zsh also has some nice additional history search features.
          • by klui (457783)
            I tried zsh in the past, but the man pages made learning it cumbersome. Zsh had 1 man page that references others much like Perl. I prefer to have one page with all the options listed so I don't have to have all of them opened concurrently--made searching a drag. Maybe zsh has changed, but I have grown to be comfortable with bash.
  • Ksh? Bash? (Score:2, Funny)

    by Khakionion (544166)
    Why don't you use a real shell environment, like Common Lisp [cliki.net]?
  • by FidelCatsro (861135) <fidelcatsro AT gmail DOT com> on Thursday April 28, 2005 @02:20PM (#12374608) Journal
    Depending on how tech-literate/savy they are this is , i would make a nice little data sheet explaining how to set up their profiles and what the commands do etc ,perhaps make a small perl script that asks a few questions and creates a profile based on the awnsers for those who arn't to up to the task.
    Well if they are neading to get used to shell , then i would say this may be a good approach as it will educate them as well .(incase things go wrong make a simple script to reset their profile so you can rest easy).

    Just another idea you may consider.
  • set -o emacs? (Score:5, Insightful)

    by Chris_Jefferson (581445) on Thursday April 28, 2005 @02:24PM (#12374657) Homepage
    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)
    • Re:set -o emacs? (Score:2, Informative)

      by smahesh (845383)

      I second the suggestion for aliasing rm with "-i". After being bitten by the "unintentional deletion of files" bug in my early unix days, I have always aliased the rm/mv/cp commands and recommend all new unix users to do the same.

    • Whoa, horrible idea... this is just the type of thing that'll get you yelled at when they move on to a real distribution that has the default rm operation and they lose their files. Or when they begin trying their hand at scripting and hardcode /bin/rm, without knowing of -i. Or...
  • It Depends (Score:3, Insightful)

    by MikeDawg (721537) on Thursday April 28, 2005 @02:27PM (#12374698) Homepage Journal

    It really depends on what sort of users you plan on having on your system. I understand you say that you have computer (read: Windows) literate people, but, I have seen people that I would consider have a decent ability to navigate and use various Windows okay, and just absolutely freak out when they see a CLI.

    I'd really recommend a tutorial course given by yourself, or by some other member of IT, to familiarize your users with the CLI. I like my prompt very simple and plain, but informative enough for me, for example, in ZSH, I use: prompt='[%T][%n@%m][%~] ' and that is informative enough for me. If you do something simple like this in the global rc file, and then even personalize it a little more on per user basis.

  • by photon317 (208409) on Thursday April 28, 2005 @02:27PM (#12374707)

    Right outta the box you're going to subject them to learning the semantics of the editor that wishes it was an operating system and requires 8 metakeys and 3 floor pedals to operate? Talk about BOFH.
    • by FidelCatsro (861135) <fidelcatsro AT gmail DOT com> on Thursday April 28, 2005 @02:34PM (#12374796) Journal
      the basic emacs commands are rather simple and take no time atall to master.
      its not as if they would need to learn the whole emacs multiverse .Just give them a sheet with the commands on like ctrl+f = forward , and they will pick it up quickly enough as the basics are fairly logical .
      • the basic emacs commands are rather simple and take no time atall to master.

        Funny, I'd say the same thing about vi commands.....and they're fewer keystrokes.

        • by FidelCatsro (861135) <fidelcatsro AT gmail DOT com> on Thursday April 28, 2005 @02:42PM (#12374922) Journal
          I find both fairly easy , although recently i have swayed more towards emacs .
          does that make me a BiTexual
          • I'm with you, I can go back and forth with hardly any problems.

            As an aside... I don't know any emacs users who don't know how to use vi proficiently. Conversely, I don't know any vi users who do know how to use emacs proficiently.

            I have my own theories on why, I'll let the reader draw their own.
            • As an aside... I don't know any emacs users who don't know how to use vi proficiently. Conversely, I don't know any vi users who do know how to use emacs proficiently.
              <br><br>I have my own theories on why, I'll let the reader draw their own.
              *Dawns a flame retardent suit and dives under pico*
              Im not touching that one with a 16' barge pole
            • I'll grant that people who use emacs generally never learn it well enough to know that they're not experts in emacs.
        • Does any keyboard not have arrow keys these days?

          Thankfully that last unix where these didn't work for me was SCO ODT3

          And don't tell me about it being quicker to use ^F type keys because my fingers are already in that area, to make a great saving I'd have to be using them an awful lot for it to be worthwhile remembering to use ^F instead of right arrow (or is it down arrow? forward/next sortof seem the same)

          Sam
      • Plus, you'll find the most unix applications understand emacs cursor control keys. It wasn't until a recent release of Firefox that ctrl-e didn't go to the end of the line.

        But, no matter what, the arrow keys work almost univerally nowadays.
      • Just give them a sheet with the commands on like ctrl+f = forward

        Wouldn't it be better to emphasize the arrow keys? I think you'll find that most keyboards have them nowadays.

        Sarcasm aside, you've just demonstrated how big the mental gap can be between a hacker and a newbie, especially if the hacker has some complicated set of concepts -- like the EMACS or Vi command set -- hard-wired into his frontal lobes. Don't assume that something that comes natural to you is natural to somebody new to the subje

        • The biggest mental blockade to get over i would say is the "Manual reading block" if someone is switching from one system to another , They natuaraly assume they are an expert and don't need these "Tutorials".Im not advocating RTFM help only promoting the tendancy to read a manual , i will gladly give any help i can to a new user.

          the reason i advocate that a new users learns a command set like vi or emacs is to get them into the swing of having to read up on things and helps get them into the mindest , I h
      • Just give them a sheet with the commands on like ctrl+f = forward , and they will pick it up quickly enough as the basics are fairly logical.

        Now, why would any user need to know that? It's not like keyboards doesn't have arrow keys on them. Alright, it's happened to me on some weird occasions running emacs on a terminal through a telnet session, or something like that, but in that case, backspace would also bring up help, making the system completely useless for new users anyway.

        The useful commands an

    • They probably won't notice that their shell does any of that stuff until they've mastered emacs. It's not like people coming from windows are likely to expect their shell to have reverse-search-through-history and be trying to figure out how to get it. So long as the arrow keys and backspace work, they'll be happy. If they end up learning emacs keysfor some reason, they'll be happy to find that their shell uses the keys they know.

      (In point of fact, emacs doesn't wish it was an operating system. It wishes i
  • I dunno if you can have both at the same time...

    alias setprompt 'set prompt="\\
    `pwd`\\
    `hostname`# "'
    alias cd 'chdir \!* && setprompt'
    setprompt
  • by mshiltonj (220311) <mshiltonjNO@SPAMgmail.com> on Thursday April 28, 2005 @02:29PM (#12374727) Homepage Journal
    I recommend this for a newbie .bashrc file:

    exit

  • by infernalC (51228) <matthew,mellon&google,com> on Thursday April 28, 2005 @02:39PM (#12374886) Homepage Journal

    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.


  • Not from experience (Score:3, Informative)

    by ADRA (37398) on Thursday April 28, 2005 @02:40PM (#12374903)
    I would say having a handy-dandy cheat sheet for common commands would be invaluable. Just write a function called help and have information like:
    Copy - cp
    Move - mv
    Help using a command - Man ...

    you get the idea. Otherwise, everyone'll be requisitioning the newb command line books all at the same time. At least with a built-in reference, they don't need paper.
    • It tells you how to get more help, and spells out the builtin commands (most of what folks are gonna use). I tried to dump the output of 'help' here, but it doesn't pass the /. lameness filter.
    • Okay, this is silly - having them post a piece of paper near their screen with these commands is a great idea, but you can make their lives so much simpler with several aliases:

      alias dir="ls -al"
      alias rename="mv"
      alias move="mv"
      alias copy="cp"
      alias help="man" # this or
      alias help="info" # this

      These 5 or so commands will help them immensely. DOS / cmd.exe only has a very few commands anyway, and you can successfully alias all of them.

      Midnight commander is an excellent idea as well.

      ALSO: Create a couple
      • by Haeleth (414428) on Thursday April 28, 2005 @03:32PM (#12375518) Journal
        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"?
      • I would actually recomend aliasing the DOS commands to echo text similar to this:

        dir is a DOS command, the most similar command in Linux is ls

        type ls man ls for directions.

        Most common usage is "ls -al"

        or something to that effect. Also I would aliad ls to ls -F --color=auto (most distros will reasonably alias the common commands though).

        By listing the propper command instead of auto-subbing you can encourage people to learn more about the commands (anybody using the command prompt will probably be at t
      • That assumes the users are familiar with the DOS command prompt.

        First of all, that doesn't describe the usual windows user, even among seemingly tech savy people. (Which, if you'll forgive a brief flame, is no surprise given the crippled and disgusting nature of the DOS shell... why would anyone use it for anything if they had a choice?)

        Second, anyone who intuitively reaches for DOS commands will pick up a dozen unix commands in minutes. And, once they know the actual command, they'll instantly have acc
  • Alias the dos commands and add the Joe (wordstar-compatable) text editor.
  • by rRaminrodt (250095) on Thursday April 28, 2005 @02:43PM (#12374943) Homepage Journal
    First off, create an alias for "help" that runs a shell script that runs a quick intro to the command line type tutorial, with scrolling, because you can't assume they will know better to pipe it into less.

    If your users are familiar with dos you might also make "edit" an alias to "nano -w" or something similar. Forcing them to use vi right away might be offputting. (It was the first time I used unix)

    Make sure rm is aliased to 'rm -i' if your distro doesn't do that already.

    If you aren't using X, and everything is completely terminal based (or maybe even if it is). I'd make sure GNU screen is installed on those systems. Once your users get comfortable with the basics, screen adds some really nice features to the mix.

  • -h's & -i's (Score:2, Informative)

    by -=[Dr. AJAX]=- (17537) *
    I basically have these aliases in my .profile. The -h's make everything a bit more readable, and the -i's are there to make sure I don't overwrite something important. You might want to also include "-i" to "rm" so they're at least prompted when deleting something.

    alias ls="ls -h --color=auto"
    alias cp="cp -i"
    alias mv="mv -i"
    alias df="df -h"
    alias du="du -h"
    • Yeah, that's really nice... except after a while people get really tired of the endless "do you want to delete this? do you want to delete that?" and then go on to add -f to everything. Whoops, suddenly you get no warning when you rm something read-only (and when something is read-only in *nix, it's usually for a good reason)...

      /* Steinar */

    • Because nobody has a clue what the colors mean. Because the default colors always include something dreadful like dark blue (unreadable on a black background) or yellow (unreadable on a light background.)

      Instead, use

      alias ls='ls -Fh'
      so that it tacks on "/" on dirs, etc. Yeah, also not necessarily the most obvious thing in the world, but at least you can read them.
    • I worked doing tech support during my undergrad. The engineering school went and set aliases like you're suggesting, including aliasing 'rm' to 'rm -i'.

      So, of course, as the systems I did support for were stock systems, we had the joy of explaining to people why 'rm *' didn't prompt them, just like they were expecting it to, as it did on the engineering school's computers.

      Dumbing things down can have the exact opposite effect that was intended, when people think that's the way that the shell always works
  • Decent prompt (Score:4, Informative)

    by FooAtWFU (699187) on Thursday April 28, 2005 @02:49PM (#12375013) Homepage
    Set up a decent prompt with a few nice colors, but don't overwhelm them with the date and time and fifty dozen different things. I reccomend:
    PS1='\[\e[0;37m\]<\[\e[36m\]\u\[\e[0m\]@\[\e[0;33m \]\h\[\e[0m\] \[\e[1;36m\]\w\[\e[0m\e[1;34m\] \$\[\e[37m\]>\[\e[0m\] '
    or something to that effect. Username@host, directory, all wrapped in a neat little angle-bracket configuration which will make anyone who's seen DOS a bit more comfortable with the system. If you have multiple hosts that they need to worry about, consider multiple colors for the hostnames.

    Additionally, if there's any chance they'd use a command that checks the EDITOR or VISUAL or whatever environment variable, make sure that they do not launch vi. Give them something simple and easy like nano.

    Consider the colors that 'ls' uses. Consider whether or not they'd be helped by a default like ls -p (print / and the like on the end of directories, @ for symlinks, etc.)

    • Re:Decent prompt (Score:2, Informative)

      by tholo (712596)
      So, what do you do when you need to log in from somewhere / with some software that does not deal with ANSI color escape sequences?

      I mean, at least GNU ls(1) will use terminfo to see if/what is possible to do...

      What is it with people wanting their prompts (or les output!) colorized, anyways...?
      • What is it with people wanting their prompts (or les output!) colorized, anyways...?

        It's pretty, and comfortable and color can make it easier for your mind to pick out what is important from something you're looking at.
        My prompt contains my username and hostname in dark blue...because it's something I need to know the instant I hit the box but don't much care about after that (unless I hit the wrong box!). But the path is in violent-bright-red, because while doing anything it's really nice to get that
  • what?? (Score:4, Insightful)

    by nege (263655) on Thursday April 28, 2005 @02:50PM (#12375027) Journal
    are you kidding??? set -o vi goddangit! Gots to start these newbs on the right foot!

    • Best bet is bash or zsh with arrow keys; it's more intuitive. Personally, I've gotten used to vi bindings because ksh is the only shell I can guarantee to be on all our servers at work (AIX, HP-UX & Solaris, various versions of each).
  • by ClosedSource (238333) on Thursday April 28, 2005 @03:09PM (#12375244)
    Encourage them to wear bell-bottom pants, long sideburns for the men and play disco music in the background. That should acclimate them to 1970's style computing.
  • setting the shell options to stun. Or at least daze.

    Also, I recommend setting your email to "out of office" and turning your cell phone off.
  • Vital thing (Score:3, Informative)

    by bonkeroo buzzeye (711311) on Thursday April 28, 2005 @03:30PM (#12375494) Journal
    Some good stuff in previous posts about aliasing DOS commands to translation messages and commenting the .bashrc to be helpful.

    Additionally, make *sure* their home, end, backspace, delete keys work properly. I'm not sure if we're talking pure command line or xterm (it's more an issue with some distros and xterms) but it's a hell of a lot to figure out when it's busted and a hell of a pain for a Windows user. It's not exclusively a shell issue but relates to the CLI experience.

    And I'd recommend *not* aliasing 'rm' to 'rm -i' because they're going to get sloppy and be really annoyed when they move to a box that doesn't have that set up and wipe stuff out.

    Set up their pager with something nice like 'export LESS="-eFMRXj12"' (well, it's nice to me).

    Stuff like 'shopt -s checkwinsize cmdhist extglob histappend histverify [etc]' - histverify is cool for new people not popping off the wrong command by accident when they're playing with the cool history tricks.

    Basically, keep it simple - avoid extremely dangerous things like giving them a fuzzy concept of 'rm' and enable not-particularly-dangerous things like 'histverify'. But make sure things like their keyboard and display work like they expect - most important thing. Then just give some hints and enable them to explore for themselves.
  • A left field idea just slapped me upside the head. How about aliasing 'help' to pump the cheat sheet into more|less. Then start it with a short intro like say this:

    This is a short summary of useful commands.

    To get around help:
    Press space to move down
    Press (command) to move up
    Press q (quit) to leave help.

    And if you have any suggestions, email me: blah@blah.com.

    Just an idea. I might even move my cli cheat sheet into something like to this to help my creaking mem-o-reee
  • by swillden (191260) * <shawn-ds@willden.org> on Thursday April 28, 2005 @03:46PM (#12375677) Homepage Journal

    You said no shell advocacy, so I won't recommend zsh, but something like its tab-completion mechanism would be a really good idea. I believe some packages exist to give bash similar abilities, and I would highly recommend installing them.

    Good tab completion makes using the command-line much easier for novice users, once they get the idea that any time they aren't sure what to type, they should just hit TAB. Don't remember the options to "ls"? Just type "ls -" and you'll get a nicely formatted summary. Don't remember the name of the directory you want to "cd" into? Just hit TAB and you'll get a list of the directories (not files!) in the current directory.

    And good tab completion knows about lots more than just the shell builtins or common commands. It knows all about *lots* of command-line tools, their options, what types of files are reasonable parameters for them ("gqview " gives a list of IMAGE files and directories in the current directory, omitting any non-image files from the list -- gqview is an image viewer), etc. zsh tab completion even knows how to look at remote systems to get completion info. For example, typing "scp 10.0.1.1:f" gets me a list of the files on my home directory on my Linux router that begin with "f". If there's only one, it gets expanded for me.

    Even when smart tab-completion can't tell you what to type, it often gives you a good hint. I think that would be very helpful to (smart, computer-savvy) command-line newbies.

  • Just so you don't get forlorn people asking about how to undelete things, retrieve them from wastebaskets, etc., you might want to alias rm, mv, cp to use the -i option.

    Later, after they get tired of answering yes they can learn how to edit their profile and remove the training wheels.

    [Even then, I hope you have a good automated nightly backup running on the user's home directories.]

  • by smartin (942)
    This solves most backspace/delete problems for me when using terminal based apps such as vi.
  • Whatever else you do, alias cp, rm, and mv to always include -i (for confirmation)!!!

    And set them up with a shell prompt that shows username, host, and current directory.
    • alias -x xterm='xterm -ls -sb -rv'
    • alias -x psg='ps ax | grep'
    • alias -x bye='clear;exit'
    • alias -x ssh='ssh -X'
    • HOST=`hostname -s`
    • if [ "X${TERM}" == "Xxterm" ]; then
      alias -x vi='vim -T xterm-color' alias -x cd='Xcd'
      Xcd()
      {
      if [ $# -ne 0 ]; then
      'cd' "$@"
      else
      'cd'
      fi
      echo " ^[ ]0;${HOST}:${PWD} ^G "
      }
      Xcd .
      fi

    I never finished the Xcd() function to perfection, but it generally does what I want. Note that the ^[ and ^G are binary, 0x

  • Shells are a personal thing, and trivial to install and change. Make whichever you want default, but let the advanced users change shells. You might hire an old school Unix guy, like me, who likes his own personal shell. Make sure it is there. Not the default, but there for advanced users.

    csh/tcsh is a must, because it is different and some people prefer it. (I still can't wrap my mind around bash, not that I've tried)

    Install the adventure shell, because someone will want to try it.

    The main re

  • by dreamer-of-rules (794070) on Thursday April 28, 2005 @05:47PM (#12376931)
    It depends on how much effort you want to put into it, but here are some more suggestions.


    No matter what, make it absolutely clear whenever they use something that can bite them hard on a normal terminal. Don't train them to fail later. Aliasing 'rm' to 'rm -i' can hurt them bad when they get used to typing 'rm *' to be prompted for which files to delete.

    If you want to get really advanced, include two scripts that will switch them to 'normal' mode or back to 'training' mode.

    Start them out in training mode. When they log in, they get:
    * an entire screen of help, including the command to leave training mode, and listing the safety nets you added.
    * their prompt contains "(TRAINING)" or "(NEWBIE)" or something
    * alias 'rm' to 'rm -i', etc.
    * any other safety nets
    * point out 'grep', 'find', 'head', 'tail', 'less' and the cute little 'wc' and where to discover more about unix commands.

    When they switch to normal mode, after confirmation, their login only includes the command to return to training mode. (Which they can edit out of the .bashrc) And their prompt doesn't have "(TRAINING)" in it anymore.

    The idea is that you make sure that they know which safety nets you create, that aren't on other systems. They also get a transistion period for as long as they want. Leaving the "TRAINING" in the prompt is a continual reminder that there setup is more 'safe' than other systems, and may add motivation to go into normal mode.

    The rest of this is from my tcsh experience:

    * set up 'complete [freshmeat.net]' options for common, yet complex commands like 'find', 'alias', 'set', 'man', 'nethack'. (very cool in tcsh [freshmeat.net], is this feature in bash?)

    * alias l=ls, ll=ls -l, la=ls -a (doesn't hurt anyone)

    * set tab to autocomplete or list matches, if it doesn't already

    * include apache-style comments (maximum verbosity) inside the .bashrc

    * set prompt to "(time) :: (path)\n(host) {(#)}% " (don't know bash)

    * don't alias any DOS commands directly to Unix except for 'dir'. Alias the others DOS commands to mini-helps that remind them gently to use the proper Unix command.

    * use nano

  • First, <aol>me too</aol> on the tab completion. I'm partial to Zsh's implementation, but I was the maintainer for FreeBSD's bash-completion port for a while so I'm sort of fond of it, too. Basically, it's crack for CLI users - once they've had it, there's no going back.

    Second, setting up a bunch of "-i" aliases is an extremely bad idea for newbies. Considering that they're starting with a blank slate, this is the time when they can most afford to learn that the machine will always do what t

    • I've found that, in bash, when all of thgose fancy completions are turned on it borks globbing with * wildards. For example, ls /home/collin/.*ash*[tab][tab] gives me a list of matching files, but when I turn all of the nifty bash tab completion features on it no longer gives me anything.

      So I tried it, it was crack, but I switched back. I like wildcards.
  • That'll teach them very quickly to not make mistakes.
  • Many people have added the idea of using PICO or a clone for basic text editing.

    I'd like to suggest using joe -- it's a nice editor with a good user interface (in that it's easy to figure out how to use based on the interface, without resorting to man pages/tutorials/etc.). It's got a PICO emulation (invoked with "jpico") for those who insist on using keybindings from a badly licensed editor, but offers more commands than PICO and clones.

    It's not guaranteed to be "all the editor you'll ever need", but it
  • Hmm... (Score:2, Informative)

    by Slipped_Disk (532132)
    This is actually a USEFUL Ask Slashdot...

    My two cents:

    The prompt should take the form "user@host:path % " - this is particularly important in environments with multiple machines, and a good idea anyway.

    The shell should be set up for command-line editing (BASH comes this way IIRC, in KSH set -o emacs. If you have any *NIX users (probably not or you wouldn't be submitting this particular question) they can set -o vi if they prefer that.), and the backspace key should work properly (if you need to stty for
  • bash completion (Score:2, Informative)

    by phlipper (133836)
    http://www.caliban.org/bash/index.shtml [caliban.org]

    - it helps newbies learn what options are available for commands. for pros, it saves a zillion keystrokes a day and is extendable
  • If they're going to start using the shell, they might want to learn about tab completion. I assume you're probably getting them to use Bash?

    The ~/.inputrc I use:

    $include /etc/inputrc
    set editing-mode vi
    set mark-directories on
    set completion-ignore-case on

    The editing-mode is up to you. I'm not going to fuel this holy war.

    The mark-directories and completion-ignore-case are probably worth while, however.

    • completion-ignore-case helps out in tab completion by ignoring the case. In other words, i
  • I haven't seen anyone mention these yet, so be sure to tell your users how to run a process in the background and how to acess the virtual consoles (if they're each going to have their own *nix desktop).

    If you make a cheat sheet, I suggest putting a detailed map of the *nix directory structure on the back side of it, with notes explaining what's in each directory.

"Card readers? We don't need no stinking card readers." -- Peter da Silva (at the National Academy of Sciencies, 1965, in a particularly vivid fantasy)

Working...