This repository contains a Linux-based directory management assignment where various commands are used to manipulate files and directories in a structured manner. The goal is to practice and demonstrate proficiency in essential Linux commands like mkdir
, mv
, cp
, ls
, cat
, and more.
- Linux
- Bash
- File System
- Terminal
- CLI Commands
/home/OS/Lab1/
├── Archive/
├── Customer/
├── Finance/
│ ├── Cust1.txt
│ ├── Cust2.txt
│ └── Cust3.txt
└── Public/
├── Forms/
└── Info/
└── Leave.txt
Command | Description |
---|---|
mkdir |
Creates directories |
cd |
Changes directory |
cd .. |
Moves to the parent directory |
mv |
Moves or renames files/directories |
cp |
Copies files/directories |
ls |
Lists files and directories |
cat |
Displays file content |
clear |
Clears the terminal screen |
exit |
Exits the terminal session |
mkdir -p OS/Lab1/{Finance,Customer,Public/{Forms,Info},Archive} && \
cd OS/Lab1 && \
touch Finance/{Cust1.txt,Cust2.txt,Cust3.txt} \
Public/Info/Leave.txt
📌 Check Structure:
tree
.
├── Archive
├── Customer
├── Finance
│ ├── Cust1.txt
│ ├── Cust2.txt
│ └── Cust3.txt
└── Public
├── Forms
└── Info
└── Leave.txt
mv Finance/* Customer
tree
.
├── Archive
├── Customer
│ ├── Cust1.txt
│ ├── Cust2.txt
│ └── Cust3.txt
├── Finance
└── Public
├── Forms
└── Info
cp Customer/* Archive
tree
.
├── Archive
│ ├── Cust1.txt
│ ├── Cust2.txt
│ └── Cust3.txt
├── Customer
│ ├── Cust1.txt
│ ├── Cust2.txt
│ └── Cust3.txt
├── Finance
└── Public
├── Forms
└── Info
mv Public/Info/Leave.txt Archive/leave_old.txt
tree
.
├── Archive
│ ├── Cust1.txt
│ ├── Cust2.txt
│ ├── Cust3.txt
│ └── leave_old.txt
├── Customer
│ ├── Cust1.txt
│ ├── Cust2.txt
│ └── Cust3.txt
├── Finance
└── Public
├── Forms
└── Info
mv Archive/leave_old.txt Public/Forms/
tree
.
├── Archive
│ ├── Cust1.txt
│ ├── Cust2.txt
│ ├── Cust3.txt
├── Customer
│ ├── Cust1.txt
│ ├── Cust2.txt
│ └── Cust3.txt
├── Finance
└── Public
├── Forms
│ └── leave_old.txt
└── Info
cd Customer && tree
.
├── Cust1.txt
├── Cust2.txt
└── Cust3.txt
cd ../Archive && tree
.
├── Cust1.txt
├── Cust2.txt
└── Cust3.txt
cd ../Customer/ && rm *
tree
.
(empty)
cd ../ && cat {Archive,Public/Forms}/*.txt
Dear Instructor, I promise I didn’t use ChatGPT for this... or did I? 😏
I worked so hard, even my laptop cried. Please reward me with a 100%! 🥺
If I don’t get 100%, my pet rock will be very disappointed. 🪨
P.S. I’ll name my firstborn after you if you give me full marks. Deal? 🤝
clear
exit
This lab covers essential file system commands in Linux, providing hands-on experience with directory structures, file movement, copying, renaming, deletion, and file content display. This structured approach helps in understanding hierarchical file management in Linux environments.