Helpful Information
 
 
Category: UNIX Help
Help needed in the following commands running in Bourne shell

Hi,
As you can figure out I am pretty new to UNIX and am trying to learn so please help me out. I need some help on the following commands and what they do in Bourne shell only, I tried to figure it myself but no success. So please help what the following commands does.

1. rm ???
2. who | wc -l
3. who | sort
4. cd ; pwd
5. ls -l | sort +4n
6. ps –ef > /dev/null
7. ./prog1 > output 2> /dev/null
8. cat test1 test2 > accounts
9. ls [a-z]*
10. ls f??*s
11. ls *[^0-9]

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’?
b) What command would you use to list all those lines that do not contain word ‘science’?


I'll really appreciate for the help. Thanks
1. Help needed in the following commands running in Bourne shell

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? :rolleyes:

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... :cool:

hi,
Can anyone please tell me where the output goes when we execute the following command in Bourne shell.

ls &

I tried and shows me the output on the screen or terminal but the prompt doesn't come. Any ideas thanks for the help

the output goes where you said - to the screen (or where ever it did before).

but the prompt doesn't come
lol.
the prompt will come back when you press enter again... :D










privacy (GDPR)