Linux Lab
Linux Lab
Introduction
In this lab, you will use Command Line Interface (CLI) commands to manage
files and directories in Linux.
Recommended Equipment
Instructions
Question:
ls
3. Create three new directories: ITEfolder1, ITEfolder2, and ITEfolder3
using the mkdir command:
ls
cd ITEfolder3
Question:
Question:
a. What command did you use to create the nested folders?
b. Answer: Type your answers here.
3. Navigate to ITEfolder5 using:
cd ITEfolder4/ITEfolder5
Question:
a. After issuing the cd .. command, what is your current directory?
b. Answer: Type your answers here.
Step 4: Create Text Files
1. Navigate to the ITEfolder1 directory:
cd ~/ITEfolder1
2. Create text files doc1.txt, doc2.txt, file1.txt, and file2.txt using the
echo command:
echo "This is doc1.txt" > doc1.txt
echo "This is doc2.txt" > doc2.txt
echo "This is file1.txt" > file1.txt
echo "This is file2.txt" > file2.txt
6. Delete doc2_renamed.txt:
rm ~/ITEfolder1/doc2_renamed.txt
Question:
a. What single command would you use to delete all files with
"doc2" in the filename?
b. Answer: Type your answers here.
7. Use a wildcard (*) to move file1.txt and file2.txt into ITEfolder3:
mv ~/ITEfolder1/file* ~/ITEfolder3/
Question:
a. Were you able to delete the directory? Why or why not?
b. Answer: Type your answers here.
3. Delete ITEfolder1 and all its contents using:
rm -r ~/ITEfolder1
Reflection Question
What are the advantages of using CLI vs. GUI?
o Type your answers here.
End of Lab.