Exercises - UNIX - answers
-
- % cp foo.txt foo.txt.copy
- % mv foo.txt.copy foo2
- % mv foo2 data
- % mkdir new
- % cd data; mv foo2 ../new or
% mv data/foo2 new
- % cd new; mv foo2 ../foo.old or
% mv new/foo2 foo.old
- % rm foo.old
- % rmdir new, or
% rm -r new
-
- % cat verylong.seq
- % more verylong.seq
- <return> down one line
<space> down one page
<u> up one page
<d> down one page
- /Length
- <h>
<q>
-
- % chmod go+r foo.txt
-
- % cp edit.me edit.me.copy; pico edit.me.copy
- % cp edit.me edit.txt
- http://gcg.ch.embnet.org:8080/users/yourname/unix
-
- % passwd
-
- % ls -a
You will now see all hidden files beginning with a dot in the filename.
- % ls -R
- % wc
- % wc -l
-
- % ls *seq*
- % cp * text
- % ls > files.list
- % cat *seq* > tot.txt
- % ls | wc -w
-
- % head -5 verylong.seq
- % grep -i length *
- % diff 1.txt 2.txt
% diff 2.txt 3.txt
- % head -7 verylong.seq > first-and-last
% tail -7 verylong.seq >> first-and-last
-
- % find ~ -name '*seq' -print
- % find ~ -ctime -1 -print
-
- % w
% who
% finger
- % top
- % finger course0
-
- This file is Postscript source code
- Postscript is a language that describes graphic elements. The image generated by the Postscript interpreter can be viewed, and saved in other formats.