AGAIN, HANDY FILE COMMANDS
head
Sometimes textfiles shown with <cat > are much to long to fit on your screen, this command will show you the top 10 lines of a file, with an -20 option you can let it show the first 20.
( For the first 15 lines )
tail
Does the same as head, but guess. . . . it shows the last 10.
( For the last 25 lines )
cmp
If you typed a long text, saved it and later the file gets edited and saved again. There is a command to compare the two files and show the differences:
CODE |
$ cmp -l fileA fileB |
( The l option is to show all differences )
diff
Also checks two files on differences but in another way, just try:
CODE |
$ diff -by fileA fileB |
( The b option is for ignoring black space the y option to sort the output side by side )
lpr
This is a simple one, as you´re in the commandline might as well print with it:
( Will print the fileA )
( Will print the file 5 times )
touch
Will create an empty file ( you can write to that file later )
A FEW TIME RELATED COMMANDS: ( useless but nice to know )
date
Will show you the current date
time
Will show you the current time
NOTE: you can run several commands on one line seperating them with an ¨;¨ so
Will show you: ¨Fri May 9 21:34:37 CEST 2003¨

Bruno
-- May 9 2003 ( Revised Dec 10 2005 ) --