4.3.2 Basic Unix commands
Let's learn the basic Unix commands. [
20] Try all the following commands from the non-privileged user
account penguin :
-
pwd
-
whoami
-
file foo
-
type -p commandname
-
type commandname
-
apropos key-word
-
whatis commandname
-
man -a commandname
-
info commandname
-
ls
-
ls -a
-
ls -A
-
ls -la
-
ls -d
-
lsof foo
-
mkdir foo
-
rmdir foo
-
cd foo
-
cd /
-
cd
-
cd /foo
-
cd ..
-
cd ~foo
-
cd -
-
</etc/motd pager
-
touch junkfile
-
cp foo bar
-
rm junkfile
-
mv foo bar
-
mv foo bar/baz
-
chmod 600 foo
-
chmod 644 foo
-
chmod 755 foo
-
top
-
ps aux | pager
-
ps -ef | pager
-
ps aux | grep -e "[e]xim4*"
-
ps axf | pager
-
kill 1234
-
grep -e "pattern" *.html
-
gzip foo
-
gunzip foo.gz
-
bzip2 foo
-
bunzip2 foo.bz2
-
tar -xvvf foo.tar
-
tar -xvvzf foo.tar.gz
-
tar -xvvf --bzip2 foo.tar.bz2
-
tar -cvvf foo.tar bar/
-
tar -cvvzf foo.tar.gz bar/
-
tar -cvvf --bzip2 foo.tar.bz2 bar/
-
zcat README.gz | pager
-
zcat README.gz > foo
-
zcat README.gz >> foo
-
find . -name pattern
-
locate -d . pattern
Please traverse directories and peek into the system using above commands as a
training. If you have questions on any of the console commands, please make
sure to read the manual page. For example, these commands are the good start:
$ man man
$ man bash
$ man ls
Also this is a good timing to start vim
and press F1-key. You
should at least read the first 35 lines. Then do the online training course by
moving cursor to |tutor| and pressing Ctrl-]. See Editors, Chapter 11 to learn more about editors.
Please note that many Unix-like commands including ones from GNU and BSD will
display brief help information if you invoke them in one of the following ways
(or without any arguments in some cases):
$ commandname --help
$ commandname -h
Try also examples in
Debian tips, Chapter 8 as
your self training.