Beta

# What UNIX Shell Config Settings Work for Newbies?

#### Cliff posted more than 8 years ago | from Human_Diastrophism

159

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?"

cancel ×

### No Comment Title Entered

#### Anonymous Coward 1 minute ago

No Comment Entered

### Advice: Install Midnight Commander. (4, Informative)

This comment was hidden based on your threshold setting.

#### Richard Steiner | more than 8 years ago

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.

### Re:Advice: Install Midnight Commander. (0)

This comment was hidden based on your threshold setting.

#### Anonymous Coward | more than 8 years ago

I still use mc

Heh, I've long since aliased mc to mv because of early typos that caused some horrible file manager thing I didn't want to open up :)

### Re:Advice: Install Midnight Commander. (1)

This comment was hidden based on your threshold setting.

#### afd8856 | more than 8 years ago

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, tar.gz, bz, etc.

I love it. It's the first tool I've installed back then when I've tried freebsd (only it took me a while to find out that to call it you had to use midc or something like this, instead of mc.

### $PS1 (3, Informative) This comment was hidden based on your threshold setting. #### Otter | more than 8 years ago 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. ### Re:$PS1 (1)

This comment was hidden based on your threshold setting.

#### Otter | more than 8 years ago

Err, sorry -- -1 redundant. My eyes had glazed over at 'set -o emacs'.

Instead of a suggestion, then, let's make it the invitation for a $PS1 flamefest... ### Re:$PS1 (1)

This comment was hidden based on your threshold setting.

#### brunson | more than 8 years ago

/me pats otter on the head

We know emacs is hard... you'd better just stick to something simple and leave the heavy lifting to us. Have you tried Pico? ;-)

### pico? (1)

This comment was hidden based on your threshold setting.

#### samjam | more than 8 years ago

Don't laugh!

I got by on pico for years, even for editing C source.

This was after giving up on JOVE in disgust, which our (blessed) Uni systadmins had installed because it was simpler than emac - well it was, but the everyday bits were just as complicated. ^X^C to quit,etc!

Now I use vi cos I have to.
The full set of commands I know are:
s I i A a ESC :w :q :w! :q! :f /

And that brings me up to pico ability!

Sam

### use jedi mind tricks (2, Interesting)

This comment was hidden based on your threshold setting.

#### nocomment | more than 8 years ago

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

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.

### Re:use jedi mind tricks (0)

This comment was hidden based on your threshold setting.

#### Anonymous Coward | more than 8 years ago

Good idea. Considering that people ccome from Windows backgroud, they will pounce upon a readme.exe file like i pounce on food.

Somebody mod parent up please !

### Re:use jedi mind tricks (3, Insightful)

This comment was hidden based on your threshold setting.

#### Anonymous Coward | more than 8 years ago

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 alias "help" to your own help system that includes information on non-bash commands like ls(1). But your "readme.exe" idea, while clever, would not be at all intuitive to anyone.

### Re:use jedi mind tricks (2, Interesting)

This comment was hidden based on your threshold setting.

#### nocomment | more than 8 years ago

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 be sucessful.

*nix newbs in our department were soon using that server for all manner of testing.

The company by the way was mindspring, it's not like it was some podunk place. :-)

Trust me, it's not nonsense, it actually works very well indeed.

### Re:use jedi mind tricks (1)

This comment was hidden based on your threshold setting.

### Re:$PS1 (2, Interesting) This comment was hidden based on your threshold setting. #### fm6 | more than 8 years ago 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 sing the Telnet Song!) I like to have the command history number in my prompt, since that makes it easier to repeat a command that hasn't scrolled off the top of the screen yet. Then again, that's obsolete too, since any decent shell has lets you uparrow back to previous commands. I used to have something to indicate my shell depth, so I wouldn't forget that I'd shelled out of another program. But I stopped shelling out when job control was invented -- not to mention Xterm windows. I guess there's not a lot worth putting in the prompt any more. And what you do put should mostly be embedded in an escape string that puts it in the Xterm window. No, wait a minute, that's obsolete too -- most shells now let you define a hook -- an alias or a script -- that's run before each prompt. Makes more sense to put complicated commands there. So probably you should just set the prompt to "% " and forget about it. ### Re:$PS1 (4, Informative)

This comment was hidden based on your threshold setting.

#### gregmac | more than 8 years ago

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.

### Re:$PS1 (1) This comment was hidden based on your threshold setting. #### fm6 | more than 8 years ago 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. ### Re:$PS1 (1)

This comment was hidden based on your threshold setting.

#### jhantin | more than 8 years ago

\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 (0)

This comment was hidden based on your threshold setting.

#### Anonymous Coward | more than 8 years ago

Whoa... you're thinking CRAZY too exotic here man. This guy is talking about including pwd and mebbe the time in the prompt.

You are talking crazy kung-fu ninja stuff that used to have to be done in the olden days when vacuum tubes were still pretty cool.

The time is highly useful to see when a command was executed (more useful on servers, but if I did a synch from source control, its nice to look back and see what time I did it at, for instance.) PWD is in my opinion critical. If you expect them to be switching user names at all, whoami is also important.

Other than that, I can't think of anything, but PWD and the time... everyone appreciates that.

### Ksh? Bash? (2, Funny)

This comment was hidden based on your threshold setting.

#### Khakionion | more than 8 years ago

Why don't you use a real shell environment, like Common Lisp?

### Re:Ksh? Bash? (0)

This comment was hidden based on your threshold setting.

#### Anonymous Coward | more than 8 years ago

Yes as KSH/bash are such limited enviroments ??
it's not as if you couldnt just call cLisp from your normal shell

### Re:Ksh? Bash? (0)

This comment was hidden based on your threshold setting.

#### Anonymous Coward | more than 8 years ago

Why don't you use a real shell environment, like Common Lisp?

Because the author specifically said, "No shell advocacy, please; it's going to be ksh or bash", you fucktard.

### Let them do their own set-up (3, Insightful)

This comment was hidden based on your threshold setting.

#### FidelCatsro | more than 8 years ago

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? (4, Insightful)

This comment was hidden based on your threshold setting.

#### Chris_Jefferson | more than 8 years ago

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? (2, Informative)

This comment was hidden based on your threshold setting.

#### smahesh | more than 8 years ago

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.

### shopt -s checkwinsize !!!! (0)

This comment was hidden based on your threshold setting.

#### datastalker | more than 8 years ago

This is so that their commands will wrap to the next line when put in small windows. Otherwise, it wraps on the same line, which is *REALLY* annoying. That's one of my biggest gripes with Linux, and I'm one of its biggest fans.

### Re:shopt -s checkwinsize !!!! (0)

This comment was hidden based on your threshold setting.

#### Anonymous Coward | more than 8 years ago

Have to say , thats not really a problem with linux so much as the set-up of your distro.

### Re:shopt -s checkwinsize !!!! (1)

This comment was hidden based on your threshold setting.

#### datastalker | more than 8 years ago

I have to say, you're wrong. Not one distro I've ever used (and I've used a lot) has ever had that set.

### Re:shopt -s checkwinsize !!!! (1)

This comment was hidden based on your threshold setting.

#### turbidostato | more than 8 years ago

Well... I use Debian (Sarge) and all text console, kterm or xterm will go to next line without further configuration, so go figure

### Re:shopt -s checkwinsize !!!! (1)

This comment was hidden based on your threshold setting.

#### MasterOfMagic | more than 8 years ago

A snippet from my Debian (sid) machine:

### Re:Compact AND informative prompt? (1)

This comment was hidden based on your threshold setting.

#### kernelfoobar | more than 8 years ago

maybe not as compact but definetly informative:

if [ whoami = "root" ] ; then
PSSUF="# "
psuser="root"
else
PSSUF="$" psuser=$USER
fi
export PS1=$psuser@hostname -s':$PWD/{$LINENO}$PSSUF
if [ $? = 0 ] then echo ":)>" else echo ":(>" fi' which gives something like this: joeuser@yourmachine:/usr/local/whatever/{ 1}$
:)>

### recommended .bashrc file... (5, Funny)

This comment was hidden based on your threshold setting.

#### mshiltonj | more than 8 years ago

I recommend this for a newbie .bashrc file:

exit

### Re:recommended .bashrc file... (3, Funny)

This comment was hidden based on your threshold setting.

#### FooAtWFU | more than 8 years ago

Well, I guess it's better than:
:(){ :|:& };:

### Re:recommended .bashrc file... (1)

This comment was hidden based on your threshold setting.

#### brunson | more than 8 years ago

You are a bastard...

### Re:recommended .bashrc file... (1)

This comment was hidden based on your threshold setting.

#### NewWazoo | more than 8 years ago

I love that! I actually ran this without thinking it through (ON A TEST MACHINE!), and it's brilliant.

This is a perfect example of how UNIX allows you to elegantly shoot yourself in the face. :)

B

### Re:recommended .bashrc file... (1)

This comment was hidden based on your threshold setting.

#### Karma Farmer | more than 8 years ago

That command has nothing to do with unix. It's a feature of the shell, not the OS.

It worked on bash on VMS systems, it works on bash on Win 95/98 systems, and it works on bash in Win NT/2000/XP systems.

### Re:recommended .bashrc file... (1)

This comment was hidden based on your threshold setting.

#### larien | more than 8 years ago

Evil is
stty erase e
stty intr r

If you know what you're doing, it's fairly trivial to get out of that, but a newbie won't have a chance.

This comment was hidden based on your threshold setting.

#### infernalC | more than 8 years ago

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. ### Re:.profile/.rc Comments! (1) This comment was hidden based on your threshold setting. #### sharkey | more than 8 years ago Offer up Midinight Commander for those who need some curses. Holy fucking shit!!! ### Not from experience (2, Informative) This comment was hidden based on your threshold setting. #### ADRA | more than 8 years ago 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. ### Noooooo! Help is a bash builtin. (1) This comment was hidden based on your threshold setting. #### infernalC | more than 8 years ago 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. ### No Cheat sheet - alias the commands! (2, Informative) This comment was hidden based on your threshold setting. #### justanyone | more than 8 years ago 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 of directories in everyone's home dir named, "MyDocuments", "MyPictures", etc., so people don't even have to learn how to create a directory. ALSO: don't forget to tell them that there's control-C to break, but there's also control-\ to interrupt (on most terminals) which works much nicer. That's my 5 cents. ### Re:No Cheat sheet - alias the commands! (5, Informative) This comment was hidden based on your threshold setting. #### Haeleth | more than 8 years ago 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"? ### For the old farts familiar with DOS (1) This comment was hidden based on your threshold setting. #### HotNeedleOfInquiry | more than 8 years ago Alias the dos commands and add the Joe (wordstar-compatable) text editor. ### Re:For the old farts familiar with DOS (4, Interesting) This comment was hidden based on your threshold setting. #### dreamer-of-rules | more than 8 years ago 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. ### Re:For the old farts familiar with DOS (1) This comment was hidden based on your threshold setting. #### HotNeedleOfInquiry | more than 8 years ago Thanks. A good idea. Unfortunately it won't help me much as I do alot of embedded DOS work and bounce back and forth from DOS/Win/Linux. ### Re:For the old farts familiar with DOS (1) This comment was hidden based on your threshold setting. #### ClosedSource | more than 8 years ago Even the old farts have moved on. If this transition were occurring 10 years ago, aliasing the DOS commands would be great, but very few Windows users use DOS commands today, or need to. ### Looks like no one has given you a real answer yet. (3, Informative) This comment was hidden based on your threshold setting. #### rRaminrodt | more than 8 years ago 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 (2, Informative) This comment was hidden based on your threshold setting. #### -=[Dr. AJAX]=- | more than 8 years ago 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" ### Re:-h's & -i's (1) This comment was hidden based on your threshold setting. #### Sesse | more than 8 years ago 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 */ ### Re:-h's & -i's (1) This comment was hidden based on your threshold setting. #### smahesh | more than 8 years ago You do know that the unaliased version can be invoked by escaping the command? e.g. "\rm" will invoke the unescaped version of rm and not the alias "rm -i" ### Re:-h's & -i's (2, Insightful) This comment was hidden based on your threshold setting. #### Sesse | more than 8 years ago Then what is the use of the aliases? The main point is: Constant warnings like that are way too annoying to do any good; people start ignoring them in various ways all too soon, if only mentally. /* Steinar */ ### Please, no color ls. (1) This comment was hidden based on your threshold setting. #### V. Mole | more than 8 years ago 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. ### Decent prompt (3, Informative) This comment was hidden based on your threshold setting. #### FooAtWFU | more than 8 years ago 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 (1)

This comment was hidden based on your threshold setting.

#### jeorgen | more than 8 years ago

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.

I second that. There is no reasonably obvious way out from vi for a newbie. You're simply stuck.

### Re:Decent prompt (1)

This comment was hidden based on your threshold setting.

#### M1FCJ | more than 8 years ago

When you can't answer, you can always phone a friend?

Slowly and surely, I'm teaching my colleauge sitting next to me with the arcane art of shells. He has improved quite a lot. These days he can ssh into a Linux box, do what he wants to do and exit without damaging anything, even if he logins as root.

### Re:Decent prompt (2, Informative)

This comment was hidden based on your threshold setting.

#### tholo | more than 8 years ago

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...?

### Re:Decent prompt (1)

This comment was hidden based on your threshold setting.

#### acousticiris | more than 8 years ago

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 bright reminder of precisely *where* you are in the "world" that is your pretty little shell...

Maybe it is pointless...but why not? It's like putting a picture in front of the toilet. Nobody spends much time admiring a bathroom when they're using it, but having that flower at least relaxes you a little while you're ruining the place.

### what?? (3, Insightful)

This comment was hidden based on your threshold setting.

#### nege | more than 8 years ago

are you kidding??? set -o vi goddangit! Gots to start these newbs on the right foot!

### Re:what?? (1)

This comment was hidden based on your threshold setting.

#### larien | more than 8 years ago

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).

### ASCII Porn (0)

This comment was hidden based on your threshold setting.

#### j-turkey | more than 8 years ago

I can't think of too much to add to your .bashrc and .profile, but if these are former GUI users, used to the modern graphical world and the modern Internet(s) -- you may want to make their world a little more famaliar by making some ASCII porn available. Perhaps you could make a symlink to iexplore.exe which will simply cat some ASCII porn out for them. If ANSI color terminals available, you can even make it a little more elaborate. ;)

### Create a 70's environment (2, Funny)

This comment was hidden based on your threshold setting.

#### ClosedSource | more than 8 years ago

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.

### I recommend (1)

This comment was hidden based on your threshold setting.

#### hey! | more than 8 years ago

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.

### My list (1)

This comment was hidden based on your threshold setting.

#### Tamerlan | more than 8 years ago

• alias cp='cp -i'. The same for mv, rm.
• PS1="\h:\w>" - Seeing full directory, like in DOS, imo betterfor orientation. In a lab environment it is also helpful to see which host you at.
• alias dir='ls'; alias move='mv -i';alias ren='mv -i'; for DOS converts
• alias ls='ls --color=auto'. If ls supports that option, of course
• Teach them to use autocompletion. That rocks!
• Finally, teach them to use midnight commander (mc). Not exactly command line though :)

### Vital thing (3, Informative)

This comment was hidden based on your threshold setting.

#### bonkeroo buzzeye | more than 8 years ago

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.

### Another way to do a cheat sheet (1)

This comment was hidden based on your threshold setting.

#### coyote4til7 | more than 8 years ago

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

### Extensive, smart tab completion (2, Informative)

This comment was hidden based on your threshold setting.

#### swillden | more than 8 years ago

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.

### For Newbies...Do Not Forget -i (1)

This comment was hidden based on your threshold setting.

#### 4of12 | more than 8 years ago

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.]

### stty dec (1)

This comment was hidden based on your threshold setting.

#### smartin | more than 8 years ago

This solves most backspace/delete problems for me when using terminal based apps such as vi.

### cp/rm/mv -i !!! (1)

This comment was hidden based on your threshold setting.

#### phallstrom | more than 8 years ago

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.

### Some other useful things (1)

This comment was hidden based on your threshold setting.

#### bsdbigot | more than 8 years ago

• 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, 0x1b (ESC) and 0x07 (BEL). ### Re:Some other useful things (0, Troll) This comment was hidden based on your threshold setting. #### scotch | more than 8 years ago alias -x xterm='xterm -ls -sb -rv' Use your .Xdefaults or .Xresources alias -x psg='ps ax | grep' What about pgrep? alias -x bye='clear;exit' There's a setting for this one, too. alias -x ssh='ssh -X' ForwardX11 = yes in the general section of your .ssh/config. HOST=hostname -s What the fuck for? if [ "X${TERM}" == "Xxterm" ]; then
[snip]

Again, what the fuck for? Alias vi to vim if you want, vim can figure out what kind of terminal it is using. Most shells will show your path in the prompt without having to mess with cd.

Are all BSD apologists so retarded?

Grin/Duck/Run

### For starters ... (1)

This comment was hidden based on your threshold setting.

### Let them change shells (1)

This comment was hidden based on your threshold setting.

#### bluGill | more than 8 years ago

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 reason to do this is some people like to be in charge. chsh is essentially a harmless command that gives your users a psychological feeling of power over the system without giving anything important up.

### Newbie toggle script and more... (3, Insightful)

This comment was hidden based on your threshold setting.

#### dreamer-of-rules | more than 8 years ago

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' options for common, yet complex commands like 'find', 'alias', 'set', 'man', 'nethack'. (very cool in tcsh, 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

### For newbies and pros alike. (0)

This comment was hidden based on your threshold setting.

#### Anonymous Coward | more than 8 years ago

KDM or perhaps startx

### Tab completion, fortunes, and -i (1)

This comment was hidden based on your threshold setting.

#### Just Some Guy | more than 8 years ago

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 they ask and not what they mean. Do you really want them to get used to relying on rm -i not nuking their home directory and then having it disappear one day after they make a mistake in their .bashrc and the alias doesn't get set? Train them to think before they hit enter and make backups often.

Finally, my first original comment: place a call to fortune(6) in their login script, learn to make a fortune file, and start treating it like a wiki or blog. Have a tip for your users? Put it in the fortune file. A user makes a particularly brilliant mistake that you want to warn the others about? Put it in the fortune file. The randomness of it is a lot more interesting than the ol' MOTD that everyone trains themselves to ignore.

### Dos Experience? (1)

This comment was hidden based on your threshold setting.

#### jefedesign | more than 8 years ago

If any of the users have Dos experience, you could add aliases for some of the more complex features. Another nice thing that was mentioned earlier is modifiying PS2. Hope this helps.
Slashdot Account

Need an Account?

Don't worry, we never post anything without your permission.

# Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

• b
• i
• p
• br
• a
• ol
• ul
• li
• dl
• dt
• dd
• em
• strong
• tt
• blockquote
• div
• quote
• ecode

### "ecode" can be used for code snippets, for example:

<ecode>	while(1) { do_something(); } </ecode>
Create a Slashdot Account