Overview
You will learn about Linux terminal commands that will greatly help you in this class. If you are an experienced user in terminal commands or command line navigation, this exercise will just serve as a refresher. You will take a screenshot of some commands that you use, and you will also submit a tar file to Canvas for this assignment.
File Packaging
There are many times that you will find yourself needing to package or compress (or unpackage and uncompress) files while working on projects. TAR (originally Tape Archive packs / creates an archive) and Gzip (GNU zip) are two commonly used tools in Unix based operating systems. To familiarize yourself with these commands and how they work, complete the following and take a screenshot:
- Create a file (e.g., somefile.txt) using a text editor (e.g. nano)
- Use gzip to compress the file, yielding a gzipped file (somefile.txt.gz)
- Use gunzip to decompress the file, yielding the original file (somefile.txt)
- Create a second file (other.txt)
- Create an archive from both files (somefile.txt & other.txt), yielding myfiles.tar (tar -cvf)
- Extract the files from the archive (tar -xvf)
- Create a new file (somefile2.txt)
- Create an archive file from all three text files piped through gzip to create a .tar.gz (tar -zcvf)
- Type ls to view the current directory and your .tar.gz
- Unzip and Extract the .tar.gz (tar -xzvf)
- Type ls to view the current directory and your extracted file.
- Take a screenshot of the commands run in steps 7) through 11).
Once finished you should have extracted readable content from the .tar.gz. You will use these tools to package and compress files that you will submit for projects, so make sure you understand how they work!
Terminal Navigation
The navigation exercise can be completed by following these steps, including taking two screenshots (see step 4):
- Create a folder with the name format last_first (e.g., sanchez_richard) in /home/reptilian.
- Issue a command to find files that contain the phrase android_dev from the kernel source directory.
- Reissue the command from (2); this time, pipe the output of the command to a text file named txt. 4) Take a screenshot of the command in 3) and another with a listing of the directory of the first file from 2). 5) Move or copy ex1.txt into the directory created in (1).
- From /home/reptilian, create a tar file named tar of the directory from (1) (including contents).
- Use gzip to compress tar (yielding ex1.tar.gz).
- Create 7, describing steps 1-7, using a text editor (e.g. nano). (See https://liw.fi/manpages/) 9) From your local command line, use sftp to transfer the files created in (7) and (8) back to your local host.
10) Submit ex1.tar.gz, ex1.7, and your three screenshots on Canvas.
Package Installation
Sometimes youll need to install new packages from within a Linux system. On Debian-derived distributions, you can use the apt command for this. Here an example to install the man utility:
$ sudo apt install man
Once installed, you can use man to view manual pages.
File Transfer
You will need to use the local Unix shell (on Windows, via WSL or MSYS) to execute the sftp command in order to transfer files from the virtual machine to the local host:
$ sftp [email protected] Replace with VM IP address
Once connected, you can issue the help command from within sftp for more information
Reviews
There are no reviews yet.