Question:
Explain the following commands.
Answer:
$ ls > file1 $ banner hi-fi > message $ cat par.3 par.4 par.5 >> report $ cat file1>file1 $ date ; who $ date ; who > logfile $ (date ; who) > logfile Source: CoolInterview.com
$ ls > file1 -> output of ls is redirected to file file1 $ banner hi-fi > message -> the banner pattern of "hi-fi" redirected to file message $ cat par.3 par.4 par.5 >> report -> contents of files par.2 par.4 par.5 appended to file report $ cat file1>file1 -> file emptied $ date ; who -> shows date and then who-all-logged-in $ date ; who > logfile -> shows date and output of who-all-logged-in redirected to file logfile $ (date ; who) > logfile -> output of date and who-all-logged-in redirected to file logfile Source: CoolInterview.com
Answered by: Gururaj | Date:
| Contact Gururaj
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|