Question
1. Write a command to list all files in the home directory and delete all files with a .doc extension. 2. Write a command to
1. Write a command to list all files in the home directory and delete all files with a ".doc" extension.
2. Write a command to place the output of the man page for sort in the file named man.sorted Do not use the respective file descriptors and complete the command in the order the instructions are given.
3. Write a command to list all files that begin with . (dot) and end in . (dot) anything.
4. Rename file 1 .ps to file1.ps
5. Write a command to connect stdout of the command ls to the foobar file and connect stdout to the stdin of the wc command. Complete the command in the order the instructions are given. Do not use redirection.
6. Write a command to print space `" "` on the command line. The output displayed in the command line is shown in blue.
7. Write a command to print out the path of the shell you were using by default.
8. Write a command to locate the foobar file in your home directory and save its absolute pathname in the foobar.path file. Also, append error messages to the foobar.log file. Assume youre not in your home directory. Hint: look up the command find in the man pages. Do not use the respective file descriptors and complete the command in the order the instructions are given.
11. Write a command to combine data in the following files (in this order) lab1, lab2, lab3, and lab4 and append it to the all.labs file. Any errors should be redirected (not appended) to the error.log file. Do not use the respective file descriptors unless absolutely necessary and complete the command in the order the instructions are given.
12. Write a command to sort the file data in file1 using input redirection and redirect the standard output to the files1.sorted file. Do not use the respective file descriptors and complete the command in the order the instructions are given.
13. Write a command to answer question 12 and append the standard error to the error.log file. You must use the respective file descriptors and complete the command in the order the instructions are given.
14. Write a command to redirect the non-repeating contents of the error.log file to the error.log.simplified file. Do not use the respective file descriptors and complete the command in the order the instructions are given. 15. Write a command to display in the shell only the lines that repeat in the error.log file.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started