1.4.5 Using Shell Commands

Many students struggle with this lab because some of the instructions include punctuation (periods “.”) which are not part of the Linux commands, and pressing the Enter Key after typing a command is often left out.  It is also critical to insert the appropriate spaces in commands as well as case

Below is a revised version of this lab:

You are currently in the wadams home directory.

Enter the command ls -l and then press Enter Key to see a listing of the files in the directory.

Enter the command rm old_myfile.txt and then press the Enter Key to delete the file old_myfile.txt. Confirm by typing y or yes and then press the Enter Key

Enter the command ls -l and then press Enter Key to see that the file old_myfile.txt is removed from the directory.   

With every command it is necessary to press the Enter Key to execute the command.  For the first three commands above the Enter command is included.  For the rest of this lab assume you must press the enter key to execute the command.

Create a new file in the wadams home directory by entering the command touch new_myfile.txt

Enter the command ls -l to see that the file new_myfile.txt is created.

Use the vi editor to open the file new_myfile.txt for editing by entering the command vi new_myfile.txt

Press the i key to enter insert mode in vi. INSERT should appear at the bottom of the vi editor.

Enter the text: Test text for my new_myfile.txt  

Press the ESC key and enter :wq to save and exit the file.

Copy the file new_myfile.txt to the practice directory by entering the command:
cp new_myfile.txt /home/wadams/practice

Move to the practice directory by entering the command cd /home/wadams/practice

Enter the command pwd to print the working directory to validate that you are in the /home/wadams/practice directory.

Enter the command ls -l to see that the file new_myfile.txt is in the /home/wadams/practice directory.

Rename the file new_myfile.txt by entering the command mv new_myfile.txt final_myfile.t
Enter the command ls -l to see that the file name has changed to final_myfile.txt.

Subcategories

EET 131 F19 - IT Essentials I - A+ Certification (5316, 5317, 5318)

Course Summary:

Date
 
Details
Sat Sep 28, 2019
Mon Sep 30, 2019
Fri Oct 4, 2019
Sun Oct 13, 2019
Sun Oct 20, 2019
Sun Oct 27, 2019
Fri Nov 8, 2019
Thu Nov 21, 2019
Wed Nov 27, 2019
Thu Dec 5, 2019
Fri Dec 6, 2019
Mon Dec 9, 2019