Learning Linux/Unix with man(1)
A Crash Course in UnixYou really can learn a lot from the unix man pages. In addition to the basic usage of a command, the man page also shows what environment variables it uses, gives some examples, and lists some related commands. I've been using one unix variant or another for more than 15 years and I've learned oodles from man pages.
Here's a brief list of essential commands that should help you lots:
man
- but how do you read the man page if you've never used the man command? Here's a quick start:- At the shell prompt, type "
man man
" to view the manual page (more frequently called just "man page") for theman
command. - The man command displays the man page using a paging program,
usually
less
, so that it doesn't scroll past too quickly to be read. - To navigate the pages, press the space bar or page down to move down, "b" or page up to move up. Hit "q" to quit and return to the shell prompt.
At the bottom of most man pages is a section called "SEE ALSO". This is a good place to find related commands. If you're reading man pages through a web interface or another more interactive UI, these may be hyperlinked to their man pages.
- At the shell prompt, type "
less
- Hint: while viewing man page forless
, hit "/" then type "Search" to search for how to search when insideless
. This is very useful when reading man pages. Other good things to learn from this man page include how to go to the next occurrence of your search term, how to specify that case is significant or insignificant, and how to got to the beginning or end of the file.bash
- the default shell for every Linux installation I've ever used. This is a very large man page. Focus in on some of the more important builtin commands which are documented on this page, such as:alias
type
pwd
pushd
popd
dirs
export
history
kill
echo
cd
grep
ps
ls
find
cat
wc
head
tail
w
last
awk
tar
diff
which
wget
sort
uniq
% grep /node/100647 access.log | awk '{ print $1 }' | sort | uniq -c
Other readings:
- Package (e.g. rpm) and software update commands (e.g. apt-get, urpmi, yum) which are distro specific
Doug Harris