Explain the following commands?

$ 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

Showing Answers 1 - 3 of 3 Answers

giri

  • Jul 9th, 2005
 

1.ls redirects the all files to file named file1 
2.banner printd the contents inhigh font letters 
3.cat appends the contents of 3 files to "report" file 
4.Here cat replace file1 with itself 
5.displays date and who also 
6.date dislplys the date but who will be redirected to "logfile" 
7.both files will b redirected (replaces previous contents") to logfile

  Was this answer useful?  Yes

Aparna

  • Jul 18th, 2006
 

$ ls > file1
writes the list of all the files in the folder into a file called file1
$ banner hi-fi > message
gives an error coz of the - i guess
$ cat par.3 par.4 par.5 >> report
writes the contents of the 3 files into a file called report
$ cat file1>file1
all contents of file1 are erased
$ date ; who
prints the current date and all the persons logged in
$ date ; who > logfile
prints the current date and writes all the persons logged in into a file called logfile
$ (date ; who) > logfile the current date and the who details are inserted into a file called logfile
 

$ ls > file1=====>Redirects the output of ls command to file1
$ banner hi-fi > message=====>Redirects the output of banner command to message
$ cat par.3 par.4 par.5 >> report=====>Redirects the output of files to report and the o/p is appended
$ cat file1>file1====>Gives error message: cat: hello: input file is output file
$ date ; who====>Executes both the commands
$ date ; who > logfile====>Prints output of date and redirects output of who to logfile.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions