0% found this document useful (0 votes)
14 views4 pages

Linux

Uploaded by

d
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views4 pages

Linux

Uploaded by

d
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Scenario: Organizing Project Files

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

pwd - Print Working Directory


 ls - List directory contents
 cd - Change Directory
 mkdir - Make Directory
 rmdir - Remove Directory
 rm - Remove files or directories
 touch - Create an empty file
 cp - Copy files or directories
 mv - Move or rename files or directories
 cat - Display file contents
 nano - Text editor
 vi - Text editor
 man - Manual page for commands
 echo - Display a line of text or variables
 sudo - Execute a command as superuser
 df - Display disk space usage
 du - Show disk usage of files and directories
 chmod - Change file permissions
 chown - Change file owner and group
 ps - Display active processes
 kill - Terminate a process by PID
 grep - Search for patterns within text
 find - Search for files in a directory hierarchy
 tar - Archive files
 zip/unzip - Compress or extract files
 ssh - Secure Shell for remote login
 scp - Secure Copy files between hosts
 wget - Download files from the internet
 curl - Transfer data from or to a server
 apt-get - Package management for Debian/Ubuntu
 yum - Package management for RedHat/CentOS
 top - Display real-time system processes
 free - Display memory usage
 uname - Show system information
 history - Show command history
 alias - Create shortcuts for commands
 df - Show disk space usage
 hostname - Display or set the system's hostname
 ping - Test network connectivity
 ifconfig - Display or configure network interfaces (deprecated, use ip instead)
 ip - Show/manipulate routing, devices, and tunnels
 netstat - Network statistics
 uptime - Show system uptime
 whoami - Display the current user
 date - Display or set the system date and time

You might also like