#Day 4 -Navigating Linux: File System Hierarchy & Essential Commands Part-1 π²π₯οΈ
Unveiling the Structure and Power of Linux

Introduction :-
Linux, a powerful and widely used operating system, organizes its file system in a hierarchical structure. Everything in Linux is treated as a file, and this organized tree-like structure is crucial for managing the system efficiently. Let's explore the key directories in the Linux File System Hierarchy and delve into some essential commands for navigating and manipulating files and directories.
ππ²Linux File System Hierarchy -
Linux File System Hierarchy In Linux everything is represented as a file including a hardware program, the files are stored in a directory, and every directory contains a file with a tree structure. That is called File System Hierarchy. Linux uses single rooted, inverted tree-like structure.

Root Directory (/) π³:
Top-level directory.
Starting point of the File System Hierarchy.
All directories arise from the root directory.
/root π:
- Home directory for the root user (superuser).
/bin π¦:
User Binaries.
Common Linux commands for all users.
Contains binary executables.
/sbin π οΈ:
System Binaries.
Commands for system administrators.
Used for system maintenance.
/dev π₯οΈ:
Device Files.
Contains hardware device files.
Includes terminal devices, USB, etc.
/var π:
Variable Files.
Contains log files, databases, emails, and temporary files.
Growing file contents.
Subdirectories:
/var/log π: System log files.
/var/lib π½: Database and package files.
/var/mail π§: Email storage.
/var/tmp ποΈ: Temporary files for reboot.
/mnt ποΈ:
Mount Directory.
Used to mount a file system temporarily.
/media π°:
Removable Media Devices.
Subdirectories for mounted removable media devices.
/usr π§βπ»:
User Binaries.
Applications and files used by users.
/etc βοΈ:
Configuration Files.
Core configuration files for the system and applications.
Contains startup and shutdown scripts.
/boot π’:
Boot Loader Files.
Contains files needed to boot the system.
GRUB boot loader and Linux kernels stored here.
/opt π:
Optional Applications.
Used for third-party software not in the distribution.
Software code stored here, binary code linked to bin directory.
/home π‘:
Home Directory.
Secondary users' home directories.
/tmp βοΈ:
Temporary Files.
Contains temporary files created by the system and users.
Files deleted on system reboot.
π§Basic Linux Commands -
#pwdπ§:
- Shows the present working directory.
#lsπ:
- Lists available files and directories in the present working directory.
#unameπ₯οΈ:
- Displays the name of the kernel (OS).
#uname -rπ:
- Shows the version of the kernel.
#cdπ:
- Changes the current directory.
#clearπΊ:
- Clears the terminal screen for a fresh start.
#whoamiπ€:
- Reveals the currently logged-in username.
#historyπ:
- Displays a list of previously used commands.
#dateπ :
- Shows the current time and date.
πCreate Directory using Commands -
1) Create Single Directory :
Command:
mkdir directory_nameπExample:
mkdir docsπ2) Create Multiple Directories :
Command:
mkdir dir1 dir2 dir3πππExample:
mkdir images videos musicπΌοΈπΉπ΅3) Create Directory Path :
Command:
mkdir -p path/to/directoryπ€οΈπExample:
mkdir -p project/docsππ4) Create Number of Directories :
Command:
mkdir dir{1..5}πππππExample:
mkdir week{1..7}πππππππ
πCreate File using Commands -
1) Create Single File :
Command:
touch filenameποΈ
- Example:
touch file.txt π2) Create Multiple Files :
Command:
touch file1 file2 file3πππ
- Example:
touch doc1.txt doc2.txt ππ3) Create Number of Files :
Command:
touch file{1..5}.txtπππππ
- Example:
touch note
ππποΈCopy, Move, and Remove Files using Commands -
Copy File :
Command:
cp sourcefile destinationπExample:
cp file.txt backup/ππCopy All Data Starting with 'D' :
Command:
cp D* destinationπExample:
cp D* backup/ππ
Move File or Directory :
Command:
mv source destinationπExample:
mv file.txt documents/ππRename File or Directory:
Command:
mv oldname newnameπExample:
mv data.txt newdata.txtππ
Delete File :
Command:
rm filenameποΈExample:
rm old.txtποΈDelete Directory and File :
Command:
rm -r directory_nameποΈExample:
rm -r docsποΈ
Note :
"-r" : for recursive.Conclusion :
Understanding the Linux File System Hierarchy and basic commands is essential for effective system administration and user interaction. Whether creating directories, managing files, or navigating through the system, these commands form the foundation for efficient Linux usage. With a clear hierarchy and powerful commands, Linux provides a robust environment for both beginners and experienced users. ππ§
πThank you for taking the time to read this blog. I hope you gained valuable insights today! If you found the content helpful, please consider liking, sharing, and following for more insightful posts in the future. Your support means a lot. π Looking forward to sharing more knowledge with you! π
ππ Let's bridge the distance and connect ππ€Anup Deshmukhππ








