Question: The output redirection can be used with any command. Try the following command which prints all the files in the /bin directory into the file

The output redirection can be used with any command. Try the following command which prints all the files in the /bin directory into the file output: ls la /bin > output

Q:What is output of the command?

The output redirection > creates a file if it doesnt exist, and over-writes its contents if the file exists. Try the following command which prints the lists of users into the output file you created earlier: who > output

Q:what is output of the command?

Use the cat command to display the contents of the output file.

Q:The previous contents have been over-written or not.

The output re-direction >> can be used to append contents to an existing file. Try this: date >> output.

Q:Where is the difference comparing to the previous contents of the output file?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!