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.