Question

In: Computer Science

What are the UNIX commands for each of these steps? 1. Delete all the files in...

What are the UNIX commands for each of these steps?

1. Delete all the files in the Classes and Backup directories only.
2. Redirect echo step 23 to mark this step in the lab3.txt file
3. Display all of the directories and sub-directories including files so I can verify you completed all the
steps correctly.
4. Repeat the above step and redirect the output to the file lab3.txt without erasing what is already in it!
5. Redirect echo step 26 to mark this step in the lab3.txt file

Solutions

Expert Solution


1. If you want to remove everything in Classes and Backup then use following command
rm /path/to/dir/*
example :
   To delete everything in Classes directory use command : rm /home/Classes/*
   To delete everything in Backup directory use command : rm /home/Backup/*

Also if you want remove all sub-directories and files inside Classes and Backup then use following commands

rm -r /home/Classes/*
rm -r /home/Backup/*


2. Redirect echo step 23 to mark this step in the lab3.txt file

Here you are saying Redirect echo step 23 to mark this step in the lab3.txt file I am assuming that I have to echo step 23 to file lab3.txt

To do that you can use following command:

echo step 23 > lab3.txt

Additionally now if you want to see the contents of lab3.txt then use cat command as : cat lab3.txt

3. Display all of the directories and sub-directories including files so I can verify you completed all the steps correctly.
the command use to display all of the directories and sub-directories including files is "ls"

just type "ls" you can see all the directories and sub-directories including files.

4. Repeat the above step and redirect the output to the file lab3.txt without erasing what is already in it!
If you want to append to a file you have to use >>. So your examples would be

ls >> lab3.txt

5. Redirect echo step 26 to mark this step in the lab3.txt file
This is same as command no 2.

echo step 26 > lab3.txt



Related Solutions

What are the UNIX commands for each of these steps? 1. Copy all of the files...
What are the UNIX commands for each of these steps? 1. Copy all of the files in your Files directory to the Backup directory. 2. Create an ITE130 directory in the Classes Directory 3. Move all the ITE 130 files from the backup directory to the ITE130 directory. 4. Redirect echo step 19 to mark this step in the lab3.txt file 5. Display all of the directories and sub-directories including files so I can verify you completed all the above...
Basic Unix Commands Objective: The objective of this lab is to work with files of UNIX...
Basic Unix Commands Objective: The objective of this lab is to work with files of UNIX file system. Procedure: 1. OpenyourUnixshellandtrythesecommands: Ø Create a new file and add some text in it vcat > filename Ø View a file vcat /etc/passwd vmore /etc/passwd vmore filename Ø Copy file, making file2 vcp file1 file2 Ø Move/rename file1 as file2 vmv file1 file2 Ø Delete file1 as file2 vrm file //Deletefile //Double-checkfirst vrm -i file Ø Counts the lines, words, characters in...
Unix/Linux Turn in the following commands and any output from the commands. 1) ll to show the original 3 files
Unix/LinuxTurn in the following commands and any output from the commands.1) ll to show the original 3 files2) run the tar command to stuff three files3) ll to show the 'tar archive'4) mkdir newdir to create a new directory to unstuff the 'tar archive'
Objective: Practice common UNIX commands. Procedure: The following list of Unix commands are given for self-learning....
Objective: Practice common UNIX commands. Procedure: The following list of Unix commands are given for self-learning. Use 'whatis' or 'man' command to find out about each command. Your document should include the description or screen shots of the output from each of the command. Commands: df du gzip file history wget Changing access rights: chmod u+x Dir1.0             adds execute permission for the owner chmod go-w file1               removes write permission for the group and others chmod ugo=rw testfile      sets...
Task 1: Getting familiar with Unix commands Questions: How do you remove a directory and all...
Task 1: Getting familiar with Unix commands Questions: How do you remove a directory and all of its contents, including any subdirectories and files, without using rmdir repeatedly?         [5 Points] Go to your home directory (i.e. /home/) and enter the following command: ls -ali Explain the output. You need to clearly what each column specifies, what are the values in each column means. Also explain how it is different from: ls -li    [5 Points] How will you copy directory (not...
unix Delete the second character from every line in a file Delete the last word from...
unix Delete the second character from every line in a file Delete the last word from every line in a file. Swap the first and second letter of every line in a file. Swap the first and last characters of every line in a file.
What are the UNIX codes for each of these steps Display the directories and sub-directories including...
What are the UNIX codes for each of these steps Display the directories and sub-directories including files so I can verify your starting point. Redirect the above step to the lab3.txt file Make a sub-directory named Files in your user directory
Unix / Linux 31. Given the first two commands, what is the expected output for the...
Unix / Linux 31. Given the first two commands, what is the expected output for the third command? (single quotes) $ echo * a b c $ x=* $ echo '$x' 32. Given the first two commands, what is the expected output for the third command? (Single quotes inside of double quotes) $ echo * a b c $ x=* $ echo "'$x'" 33. Given the first two commands, what is the expected output for the third command? (double quotes...
QUESTION 1 Match the following LINUX/UNIX commands with what they do. du    whereis users who...
QUESTION 1 Match the following LINUX/UNIX commands with what they do. du    whereis users who am i A. display a compact list of users currently logged in B. locate the binary, source, and manual page files for a command C. summarize disk usage D. who am i currently logged in as on the Linux server. QUESTION 2 What rm command option (flag) would you use to remove a file that begins with a - (hyphen)? -f -p --   ...
1. In terms of security, why would you not use rm command to delete files? 2....
1. In terms of security, why would you not use rm command to delete files? 2. Shred and dd are tools used to securely delete files. Which is the best tool for securely deleting a file from a system and why? Consider the limitations of each tool when choosing your answer. 3. What encryption is used to encrypt HTTP traffic (HTTPS)? 4. The CIA triad , confidentiality, integrity, and availability represent the three goals for cybersecurity. Which goal(s) does/do encryption...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT