(Also see http://www.levenez.com/unix/ for a constantly updated UNIX history banner.)
$ ls / bin/ df.txt initrd/ media/ root/ sys/ var/ boot/ etc/ lib/ mnt/ sbin/ tftpboot/ denyhosts/ export/ linux-images/ opt/ selinux/ tmp/ dev/ home/ lost+found/ proc/ srv/ usr/ $ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 522028 404048 117980 78% / none 1557628 48 1557580 1% /dev/shm /dev/sda2 10241088 8681048 1560040 85% /usr /dev/sda3 819232 639592 179640 79% /var /dev/sda5 21823584 20355644 1467940 94% /linux-images ... ... netapp:/home/cslab 286703264 129809216 156894048 46% /export/home
$ find /etc -name '*.conf' | less
$ whereis geany geany: /usr/bin/geany /usr/include/geany /usr/share/geany /usr/share/man/man1/geany.1.gz
(See also http://en.wikipedia.org/wiki/Unix_philosophy)
(See also http://www.faqs.org/docs/artu/ch01s06.html)
# upside down cal cal | tac # number of processes that are associated with me ps aux | grep jchung | wc -l # ?????? wget -q -O - https://www.gutenberg.org/cache/epub/11231/pg11231.txt | sed 's/ /\n/g' | sed 's/[^A-Za-z0-9]*$//g' | sed 's/^[^A-Za-z0-9]*//g' | tr A-Z a-z | sort | uniq -c | sort -rn
env | less
# (or set | less
) SHELL
environment variableenv | grep SHELL
echo $SHELL
$
.# Display your command history history ... 548 cat .bash_history 549 man bash 550 nano .bashrc 551 source .bashrc !549 # issues 'man bash' command again !man # reissues last command starting w/ 'man' !nan # reissues the 'nano .bashrc' command
examples/cat
directory under your course directory (cs370
or se370
).apropos
command) man -k vim # Search for all man pages containing keyword 'vim' eview (1) - easy Vim, edit a file with Vim and setup for modeless editing evim (1) - easy Vim, edit a file with Vim and setup for modeless editing gvim (1) - Vi IMproved, a programmers text editor gvimdiff (1) - edit two, three or four versions of a file with Vim and show differences gvimtutor (1) - the Vim tutor rgvim (1) - Vi IMproved, a programmers text editor rvim (1) - Vi IMproved, a programmers text editor vim (1) - Vi IMproved, a programmers text editor vimdiff (1) - edit two, three or four versions of a file with Vim and show differences vimtutor (1) - the Vim tutor
cat filename
cat > fileFromCat.txt # The '>' means that keyboard input is 'redirected' to fileFromCat.txt The first line second line third line EOF # EOF is usually entered using Control-D cat fileFromCat.txt The first line second line third line
# output contents of four files to screen $ cat file1 file2 file3 file4 # output to a file, overwriting contents of allFilesTogether $ cat file1 file2 file3 file4 > allFilesTogether # output to a file, appending to contents of allFilesTogether $ cat file1 file2 file3 file4 >> allFilesTogether # using a shell wildcard (*), # cat the contents of all files whose names begin w/ 'file'; files are # concatenated in sorted order, i.e. file1 file2 file3 file4 $ cat file*
./..
shortcuts.
means current directory..
means parent directory“-p”
option of mkdir creates entire subdirectory treemkdir -p cs370/examples/cat
rm -rf
with great care.ls abc*
: list files and directories that begin with “abc”ls *abc*
: list files and directories that contain “abc”ls [a-z]*
: list files and directories that begin with a lower case letterchmod/chown/chgrp
commandschmod/chown/chgrp/setfacl/getfacl
ssh some_host_name # Example: ssh plato, ssh plato.monmouth.edu
ssh s1100841@plato # or ssh s1100841@plato.monmouth.edu (if off-campus)