Introduction to Linux/Unix
Lab 4
Chapter 7- Archiving and Compression
Chapter 8 – Pipes, Redirection and RegEx
Execute and verify each command. Refer PowerPoints for reference. Do not miss any steps. Include screen capture for each command
Chapter 7 – Archiving and Compression
- Create a directory named, “lab4” in your home directory.
Command: - Change to “lab4” directory. Perform all the commands in “lab4” directory.
Command: - Archive all files from /etc/ssh directory to “ssh.tar” file within the current directory. Write the command and perform the operation. Attach your screen shot.
- Perform the following command, ls –l
- Display the contents of the “ssh.tar” archive file
- Archive and compress using “bzip2” all files from /etc/ssh directory to “ssh.tar.bz2” file within the current directory. Write the command and perform the operation. Attach your screen shot.
- Extract and Uncompress the file you performed in step 6. Write the command and perform the operation.
- Perform the following command, ls –l and attach the screen shots.
- Copy files from /etc directory starting with the following letters, “hd” to your current working directory. List and verify your operation. Attach your screen shot. I provided the copy command.
Command: cp /etc/hd* . “.” represents the current working directory. - Create a compressed file, “hddtemp.db” using “gzip” utility. Write the command and perform the operation. List and verify your operation. Attach your screen shot.
- Compressed file name extension using “gzip” utility. __
- Create a compressed file, “hdparm.conf” using “bzip2” utility. Write the command and perform the operation. List and verify your operation. Attach your screen shot.
- Compressed file extension using “bzip2” utility: __
- Uncompress the compressed file, “hdparm.conf” you performed in step 12. Write the command and perform the operation. List and verify your operation. Attach your screen shot.
Chapter 8 Pipes and Redirection and Regular Expression - Counting the word in a file.
Run the command to count the words in “hdparm.conf” file. Write the command and perform the operation. List and verify your operation. Attach your screen shot. - Searching a word in a file
a. Run the command to search the word “localhost” in /etc/hosts file. You can use the option “i” to ignore the case. Write the command and perform the operation. List and verify your operation. Attach your screen shot. Searching a word or a string in all files in a given directory
b. Run the command to find all the file in /etc/dhcp directory that contains the string “eth0” {it is zero not the letter “o”}. Write the command and perform the operation. List and verify your operation. Attach your screen shot.
Leave a Reply
You must be logged in to post a comment.