Question
Question 1 to 8 has been answered. Please do Question 9 to 20 Use Linux command Q1 Create a file that contains a space in
Question 1 to 8 has been answered. Please do Question 9 to 20
Use Linux command
Q1 Create a file that contains a space in the name for instance
my favorite picture.jpeg
Show the command you used
Q2 Also create the following files
a
aa
b
ab
abab
Show the command to list all files whose name starts with a and ends with b
Q3 - Show the command to list all files whose name contains an a
Q4 - Show the command to list all files whose name contains a space
Q5 Show the command to list all files whose name ends with a or g
Q6 - Show the command to list all files whose name does not end with b
Q7 - Show the command to list all files whose name starts with a but does not end with b
Q8 - Create a bash script that contains the creation of the files from Q1 and Q2. Show the contents of your script.
Q9 - Show the command to make the script executable. Q10 - Execute the script and show the command to use to check that the script run successfully. Q11 - Show the command would you use to determine if the command history is a builtin? Q12 - Show the command to display the square of 5 Q13 - Show the command to put the list of files in the current working directory into a new shell variable named lsout. Also show the command to display the value of the shell variable. Q14 - Show the command to add the value of the shell variable lsout into a new file named Is.out Q15 - Show the commands needed to expand your \$PATH environment variable to include the current directory For questions Q16-Q18, run each of the command given and describe the command's three standard I/O channels (stdin, stdout, and stderr). For example, if the command sends the output to the screen, say "stdout=screen". Q16 - Execute the command cat > file1. Enter a few lines of text and exit. Describe the command's input, output and error files Q17- Execute the command cat file1 > file2. Enter a few lines of text and exit. Describe the command's input, output and error files. Q18- Execute the command cat file1. Enter a few lines of text and exit. Describe the command's input, output and error files. Q19 - Provide a single line command (to be executed from your current working directory) that will show the 5 largest files in the /usr/bin directory. Run the command and show its output. Hint: use pipes and look at the man page of the command sort to see the possible arguments that it accepts. Q20 - Create a couple of empty directories in your lab3 directory mkdir testDir1 mkdir testDir2 mdkir testDir1/testDir3 Use a single find command to locate all empty directories starting from your home directory (recursively)
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