you better get a good book on this!
1. rm ???
[ delete all files whose name consists of three characters / numbers ]
2. who | wc -l
[ count how many users are logged in ]
3. who | sort
[ show logged in users, sorted alphanumerically ]
4. cd ; pwd
[ change directory to home directory, show directory´s path ]
5. ls -l | sort +4n
[ list all files, sort by 4th column (not 100% on the "column") ]
6. ps –ef > /dev/null
[ list all processes, but don´t show the output ?????? ]
7. ./prog1 > output 2> /dev/null
[ start program "prog1" in the current folder, redirect all screen output to a file "output", discard all error messages AFAIK ONLY THIS ONE IS BOURNE-SYNTAX!
8. cat test1 test2 > accounts
[ join the content of the files "test1" and "test2" into file "accounts" ]
9. ls [a-z]*
[ list all files that start with a...z ]
10. ls f??*s
[ list all files that start with "f" and end with "s" and have at least two characters in betwen ]
11. ls *[^0-9]
[ list all files that don´t end with a number ]
12. A file named test has ascii data that can be viewed by the cat command.
a) What command would you use to list all the lines in the file that contain the word ‘science’?
[ cat file | grep science ]
b) What command would you use to list all those lines that do not contain word ‘science’?
[ cat file | grep -v science ]
Is this some kind of test or quiz? Did i win the $1,000,000 now?
if you pass a job test or whatever with cheating, you are not worth having this job and will probably be kicked off within a few days... maybe they even won´t pay you at all ... with reason!
if you are a student, quit this course... you´ll break on the next lesson.
if it is for curiosity, "get a beginner´s unix book!" or read your (redhat|SuSE|mandrake|...) manual.
if you make money off this, i hereby request 20%. The (mf-)DCMA grants me this right for my intellectual property. contact me for payment details...