Author: Madhan Gopalakrishnan | Published on : 12-02-2025

Linux is a powerful and flexible operating system that is widely used in servers, desktops, and embedded systems. To navigate and manage Linux efficiently, understanding its File System and Basic Commands is crucial.
📂 Linux File System Explained
The Linux file system is a structured way of storing and organizing files on disk. It follows a hierarchical directory structure with the root directory ( / ) at the top.
🔍 File System Structure
Directory | Description |
---|---|
/ (Root) | The top-level directory. All other directories stem from here. |
/bin | Essential user command binaries (like ls , cp , mv ). |
/boot | Boot-related files (kernel, bootloader). |
/dev | Device files (hardware components like sda , tty ). |
/etc | System configuration files. |
/home | User home directories (/home/username ). |
/lib | Essential libraries for system binaries. |
/mnt | Temporary mount points for external devices. |
/opt | Third-party application software. |
/proc | Virtual file system with process information. |
/root | Home directory for the root user. |
/sbin | System binaries used by the superuser. |
/tmp | Temporary files (deleted on reboot). |
/usr | User applications and utilities. |
/var | Variable files like logs and cache. |
📌 Note: Linux does not use drive letters like Windows (C:
, D:
), instead, everything is part of the root (/
) hierarchy.
🎯 Basic Linux Commands
📁 File & Directory Management
Command | Description |
---|---|
pwd | Print current working directory. |
ls | List files in the directory. |
cd /path | Change directory. |
mkdir new_folder | Create a new directory. |
rmdir folder | Remove an empty directory. |
rm file | Delete a file. |
rm -r folder | Delete a directory and its contents. |
cp file1 file2 | Copy a file. |
mv file1 file2 | Move or rename a file. |
touch newfile | Create an empty file. |
find / -name file | Search for a file. |
📜 File Content Manipulation
Command | Description |
---|---|
cat file | Display file contents. |
tac file | Display file contents in reverse. |
head -n 10 file | Show the first 10 lines of a file. |
tail -n 10 file | Show the last 10 lines of a file. |
nano file | Open a file in the Nano editor. |
vim file | Open a file in the Vim editor. |
less file | View file contents with navigation. |
grep 'word' file | Search for a word in a file. |
🛠️ File Permissions & Ownership
Command | Description |
---|---|
ls -l | Show file permissions and details. |
chmod 777 file | Change file permissions. |
chown user file | Change file owner. |
chgrp group file | Change file group. |
umask 022 | Default file permission settings. |
🖥️ System Monitoring Commands
Command | Description |
---|---|
top | Show running processes. |
htop | Interactive process viewer. |
ps aux | Display active processes. |
df -h | Show disk usage. |
du -sh folder | Show directory size. |
free -m | Show memory usage. |
uptime | Display system uptime. |
whoami | Show current user. |
uname -a | Show system information. |
hostname | Show system hostname. |
🌍 Networking Commands
Command | Description |
---|---|
ping google.com | Test network connection. |
ifconfig | Show IP configuration (deprecated). |
ip a | Show IP addresses. |
netstat -tulnp | Show active network connections. |
wget URL | Download files from the web. |
curl URL | Fetch data from a URL. |
🔄 Process Management
Command | Description |
---|---|
kill PID | Kill a process by ID. |
killall process | Kill all instances of a process. |
pkill name | Kill process by name. |
bg | Resume a suspended process in the background. |
fg | Resume a background process to the foreground. |
jobs | Show background jobs. |
nohup command & | Run a process immune to logout. |
📌 User Management
Command | Description |
---|---|
who | List logged-in users. |
id username | Show user ID and groups. |
passwd | Change user password. |
adduser username | Add a new user. |
deluser username | Delete a user. |
usermod -aG group user | Add a user to a group. |
💡 Conclusion
Mastering Linux starts with a strong foundation in its file system and basic commands. This guide provides a solid starting point to navigate, manage files, and execute essential tasks.
Keep practicing, and soon you’ll be comfortable using Linux like a pro! 🚀
📢 Next Steps:
- Practice these commands in a Linux terminal.
- Explore advanced topics like shell scripting and system administration.
- Stay curious and experiment with different Linux distributions.
Happy Learning! 🎉