Assignment #1 – Basic Linux Commands

Task A: Practice with the Basic Linux Commands

You can take one screenshot to cover the answer for multiple tasks.

  1. (10 pt) How do you find the IP address of your Linux machine using the command line?

2. (10 pt) Display your current directory in a terminal

3. (10 pt) Use the echo command to print your name to the console.

4. (10 pt) Display your first and last names in two separate lines using a single echo command
(tip: how to enable the interpretation of escape characters?

5. (10 pt) How to change to home directory using cd and absolute pathname

(10 pt) Create a new file named “forXXXX.txt” in your home directory (replace “XXXX” with
your own MIDAS). Then, use the long listing format to display the contents in your home
directory. What is the size of the file you just created?

The size of the file fornsimp004 is zero.

7. (20 pt) Create a new directory named “XXXX” in your home directory (replace “XXXX” with
your own MIDAS). Then, use the long listing format to display the contents in your home
directory. What is the size of the file you just created?

The size of the file nsimp004 is 4096.

(20 pt) Copy /etc/passwd file to your home directory. The copy should be named
as“passwd_XXXX” (replace “XXXX” with your own MIDAS) in your home directory. Then,
complete the following two subtasks: complete the following two subtasks: Use the proper command to display the first six lines in this file. Search the keyword “www” in this file

Leave a Reply

Your email address will not be published.