
Concept explainers
Commands for the following but only as an unprivileged user
- Create a new directory in /tmp/ called "quiz"
- Create /tmp/quiz/file1 containing "asdf"
- Create /tmp/quiz/file2 containing "1234"
- Create a new directory in /tmp/quiz/ called "sub1"
- Create a copy of /tmp/quiz/file1 called "file3" in /tmp/quiz/
- Create a copy of /tmp/quiz/file1 in /tmp/quiz/sub1/
- Create a copy of /tmp/quiz/sub1/ and all of contents called "sub2" in /tmp/quiz/
- Move /tmp/quiz/file2 to /tmp/quiz/sub2/
- Move /tmp/quiz/sub1/ inside of /tmp/quiz/sub2/
- Rename /tmp/quiz/sub2/ to /tmp/quiz/subdir/
- Copy all of the files ending with .repo from /etc/yum.repos.d/ to /tmp/quiz/subdir/
- Remove all files with "updates" anywhere in the name from /tmp/quiz/subdir/
- Remove /tmp/quiz/file1
- Securely delete /tmp/quiz/subdir/file2
- Rename /tmp/quiz/file3 to /tmp/quiz/file1
- Recursively remove /tmp/quiz/ and all of its contents, ignorning warnings

Assuming the unprivileged user has write access to /tmp/ directory, here are the commands:
- Create a new directory in /tmp/ called "quiz"
mkdir /tmp/quiz
- Create /tmp/quiz/file1 containing "asdf"
echo "asdf" > /tmp/quiz/file1
- Create /tmp/quiz/file2 containing "1234"
echo "1234" > /tmp/quiz/file2
- Create a new directory in /tmp/quiz/ called "sub1"
mkdir /tmp/quiz/sub1
- Create a copy of /tmp/quiz/file1 called "file3" in /tmp/quiz/
cp /tmp/quiz/file1 /tmp/quiz/file3
- Create a copy of /tmp/quiz/file1 in /tmp/quiz/sub1/
cp /tmp/quiz/file1 /tmp/quiz/sub1/
- Create a copy of /tmp/quiz/sub1/ and all of contents called "sub2" in /tmp/quiz/
cp -r /tmp/quiz/sub1 /tmp/quiz/sub2
- Move /tmp/quiz/file2 to /tmp/quiz/sub2/
mv /tmp/quiz/file2 /tmp/quiz/sub2/
- Move /tmp/quiz/sub1/ inside of /tmp/quiz/sub2/
mv /tmp/quiz/sub1 /tmp/quiz/sub2/
- Rename /tmp/quiz/sub2/ to /tmp/quiz/subdir/
mv /tmp/quiz/sub2 /tmp/quiz/subdir
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps

- C++ please use file names belowarrow_forward* Question Completion Status: QUESTION 11 Wite a program (mymv infile outfile) to rename a infile as outfile using file system calls, link(), and unlink() For the toolbar, press ALT+F10 (PC) or ALT+FN+F10 (Mac). BIUS Paragraph Arial 10pt P. QUESTION 12 Write a program that takes the file name as the command line argument and outputs the size of the file in byte the file) !! !!!arrow_forwardWhat is the difference between the "w" and "a me modes? 1-" a" is not a valid file mode for writing 2- "w" will not over-write the file but the "a" file mode will over-write O 3-"w" will over-write the file and "a" will append to the bottom of the file.arrow_forward
- Unix Commands Using the Unix commands, you have learned in class, create the following file structure: • Create a directory called "unix_hw" in your home directory. • Within "unix_hw", create a file called "helloworld.c" and a directory called "output". • Compile your helloworld.c file into output folder. This should create an output executable file in output folder. • Run the helloworld program from output folder. • Within "output", create a file called "notes.txt". • Move "notes.txt" to "unix_hw" (using relative path) • Remove "notes.txt" from output folder. (using absolute path) • Remove "output" (using absolute path) Perform above steps on your Unix account, then copy each command your ran into a text file and take a screenshot of your terminal window such that all steps are visible.arrow_forwardAssume the file list contains the names of several of the files listed in your home directory. What is the result of running the following? $ wc `cat list`arrow_forwardBash Shell Script Programming Assignment **Make sure to name the script file as it mentions** Question 1. Create a shell script file called q1.sh Write a script that would accept the two strings from the console and would display a message stating whether the accepted strings are equal to each other. Question 2. Create a shell script file called q2.sh Write a bash script that takes a list of files in the current directory and copies them as into a sub-directory named mycopies. Question 3. Create a shell script file called q3.sh Write a Bash script that takes the side of a cube as a command line argument and displays the volume of the cube. Question 4. Create a shell script file called q4.sh Write a Bash script that prompts you for a user name and displays the corresponding user’s id number (UID), group id number (GID), and his/her home directory. Note: this information can be found in the /etc/passwd file. Question 5. Create a shell script file called q4.sh Write a bash…arrow_forward
- Python question: I have a .py file in another folder in the same directory how do I import that file into another .py file? For example, my directory folder is called "School_Work" I have 2 folders: Helper_Functions Main_Driver In my Helper_Functions folder I have the file called helper_functions.py and in my main driver I have a file called main.py. I want to import helper_functions.py into main.py. How do I do that?arrow_forwardPlease Help ASAP!!!arrow_forwardInclude the code to any h files usedWrite two c++ programs to implement a distributed version of a multithreaded Huffman decompressor using the one in project 1 The server program The user will execute this program using the following syntax: ./exec_filename port_no < input_filename where exec_filename is the name of your executable file, port_no is the port number to create the socket, and input_filename is the name of the file with the alphabet's information. The port number will be available to the server program as a command-line argument. The server program receives from STDIN the alphabet's information (using input redirection). The input file has multiple lines, where each line contains information (character and frequency) about a symbol from the alphabet. The input file format is as follows: A char representing the symbol. An integer representing the frequency of the symbol. Example Input File: E 3 G 3 F 1 H 2 Given the previous input file, the expected output for the…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





