Lab One
1.1
1.2
- ~ returns to your home directory
- ~hpotter goes into hpotter's home directory
1.3
- head -10 (or 25) FILENAME for the first 10 or 25 lines of a file
- tail -12 FILENAME for the last 12 lines of a file
1.4
- adds a directory to the top of the remembered directory stack (or moves that order around)
- removes the top directory in the stack
- shows all of the directories in the remembered stack
- push and pop are names used for adding and removing things from lists
1.5
- lpr FILENAME sends it to the printer
- lpq displays the jobs and their status on the printer queue
1.6
- use man COMMAND or help COMMAND or --help or use google/wikipedia/other web resources.
1.7
- diff -B to ignore blank lines in the text files
- diff -i to ignore case differences in file contents
1.8
- anyone can read earth.txt, but only Alan Turing can write it.
- it was last changed at 9:17 on July 12
- the command to allow others to write the file would be chmod o+w earth.txt
1.9
1.10
- you would check by ls -l and the last set of 3 for Dr. Evil's permissions
- to get rid of his permissions chmod -R o-rwx
1.11
- cd HOME changes directories to the first directory it finds named 'HOME' while cd $HOME changes directories to the location specified by the variable HOME which is ~
1.12
- grep looks for words in files
1.13
- analyze FILE | head -10 > tmp.txt to send the stdout of analyze to the stdin of head then > to send it to tmp.txt
1.14
- to append it to the listing you use >> instead of >
1.15
1.16
- rm *.ch deletes all files ending in .ch while rm *.[ch] removes everything that ends in .c or .h
1.17
- ps aux | grep "bash" finds instances of bash in ps
1.18
1.19
- you would use diff OLD NEW to find the differences
1.20
1.21
- grep -n for line number -x for matches
1.23
- alias sets one command as another
Download in other formats: