Linux
Linux
You are working on a project and need to organize your files properly. Follow these
steps to create and manage your project files using basic Linux commands:
1. Navigate to Your Home Directory:
o Start by finding out where you are. Use pwd to confirm that you're in the
home directory. If not, use cd ~ to get there.
2. Create a Project Directory:
o Create a new directory called MyProject to store all your project files.
o Command: mkdir MyProject
3. Enter the Project Directory:
o Navigate into the MyProject directory.
o Command: cd MyProject
4. Create Subdirectories:
o Inside MyProject, create two subdirectories: Docs and Source.
o Command: mkdir Docs Source
5. Create an Empty File:
o Inside the Docs directory, create an empty file called README.txt.
o Command: touch Docs/README.txt
6. List Directory Contents:
o List the contents of the Docs directory to ensure the README.txt file was
created.
o Command: ls Docs
7. Write in the README File:
o Use a text editor (nano or vi) to open README.txt and write a brief
description of your project.
o Command: nano Docs/README.txt
8. Create and Move a Source File:
o Create a new file called main.py in the Source directory and then move it
to MyProject.
o Command: touch Source/main.py
o Command: mv Source/main.py .
9. Copy the README File:
o Make a copy of the README.txt file and save it as README_backup.txt
in the same directory.
o Command: cp Docs/README.txt Docs/README_backup.txt
10. Clean Up:
o You realize you no longer need the Source directory. Remove it.
o Command: rmdir Source
11. View the README File:
o Display the contents of README.txt to verify your notes.
o Command: cat Docs/README.txt