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?"
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.
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.
What I'm listening to now on Pandora...
Why don't you use a real shell environment, like Common Lisp?
OMG! Wau!
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. .(incase things go wrong make a simple script to reset their profile so you can rest easy).
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
Just another idea you may consider.
The only things certain in war are Propaganda and Death. You can never be sure which is which though
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
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.
YOU'RE WINNER !
Another lame blog
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.
11*43+456^2
I dunno if you can have both at the same time...
alias setprompt 'set prompt="\\
`pwd`\\
`hostname`# "'
alias cd 'chdir \!* && setprompt'
setprompt
Here come da fudge!
exit
Software Wars
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:
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.
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.
Bye!
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.
They'll think I've lost control again and leave it all to evolution. -- Supreme Being, Time Bandits
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
.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.
#!/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
/* oops I accidentally made a comment, sorry */
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.)
The World Wide Web is dying. Soon, we shall have only the Internet.
are you kidding??? set -o vi goddangit! Gots to start these newbs on the right foot!
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.
Unitarian Church: Freethinkers Congregate!
> 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.
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.
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.
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.
Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
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
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
* set prompt to "(time)
* 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
Everyone is entitled to his own opinions, but not his own facts.
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.
Build it, and they will come^Hplain.
This is actually a USEFUL Ask Slashdot...
r /local/sbin). Generally I discourage adding ., ~ and ~/bin to the search path, but doing so may make things easier for your users.
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 this do it).
Shell aliases - forgive my bluntness but fuck the cutesy color shit on ls and any other utilities that wish to make things ugly. If ls comes aliased to "ls -color" or whatever, unalias it. ls should be ls, unadulterated. Same for rm (none of that crappy "rm -i" shit that some linux distros tend to use in the root shell. If I wanted to be bothered I'd add the flag myself, and "protecting users from themselves" will just piss them off).
What you should add are USEFUL aliases. My personal favorites:
ll -> ls -al
la ->ls -a
lf -> ls -af
j -> jobs
h -> history
You should also take care to set a USEFUL default search path (/bin,/sbin,/usr/bin,/usr/sbin,/usr/local/bin,/us
Consider which editor you drop your users into. Pico is a good choice for real newbies, EMACS is the next step up the ladder. vi is probably too different from the windows paradigm for most of your users,
Also take the time to explain other commands (apropos, man, whatis, whereis, which) that can make life easier.
I'm sure others have made additional suggestions, but hopefully this is somewhat helpful.
/~mikeg
http://www.caliban.org/bash/index.shtml
- it helps newbies learn what options are available for commands. for pros, it saves a zillion keystrokes a day and is extendable
no rm should be aliased to rm -rf so they can delete directories easily
Warning: This sig contains a small bug. ==> *