DEV Community

tamilvanan
tamilvanan

Posted on

Learn Linux - 002

Note: I’m not an expert. I’m writing this blog just to document my learning journey. πŸš€



πŸš€ What is Linux?

βœ… First Principles:

Linux is an operating system β€” the core software that lets you control a computer’s hardware, run programs, and manage files.

Just like Windows or macOS, Linux:

  • Boots the system
  • Manages memory and processes
  • Lets you open programs, connect to the internet, and store files

But Linux is different:

  • It's open source (you can see and change its code)
  • It’s modular and customizable
  • It’s used widely in servers, cybersecurity, embedded systems, and more

🧠 Why Learn Linux?

  • Most servers and cloud machines run Linux
  • Most CTFs, ethical hacking, and development tools are built for Linux
  • Learning Linux teaches you how computers really work

🧱 Linux Structure (What It's Made Of)

Linux has 4 major layers:

  1. Kernel
    The core of Linux. It talks to the hardware (CPU, memory, devices).

  2. Shell
    The command-line interface (like Bash or Zsh). You type commands here.

  3. Filesystem
    A hierarchy of folders/files starting from / (called "root").

  4. User space
    All the programs you run: browsers, editors, servers, etc.


πŸ“ Linux Filesystem: Not C:\ Drive

In Linux, everything is a file or directory. There's no "C drive".

/
β”œβ”€β”€ bin       β†’ essential commands
β”œβ”€β”€ home      β†’ users' personal files
β”‚   └── yourname/
β”œβ”€β”€ etc       β†’ config files
β”œβ”€β”€ var       β†’ logs, variable data
β”œβ”€β”€ tmp       β†’ temporary files
β”œβ”€β”€ usr       β†’ user programs and libraries
└── root      β†’ root user’s home
Enter fullscreen mode Exit fullscreen mode

πŸ”€ Basic Commands (with Meaning)

Here are essential Linux commands β€” not just what they do, but why.

πŸ“‚ File Navigation

pwd           # print working directory
cd /path/     # change directory
ls            # list files
Enter fullscreen mode Exit fullscreen mode

πŸ“ Working with Files

touch file.txt          # create a new empty file
mkdir newfolder         # make a directory
rm file.txt             # delete a file
rmdir folder            # delete a folder
mv old.txt new.txt      # rename or move
cp file.txt copy.txt    # copy files
Enter fullscreen mode Exit fullscreen mode

πŸ“„ Viewing Content

cat file.txt      # show file contents
less file.txt     # view long files
head file.txt     # first 10 lines
tail file.txt     # last 10 lines
Enter fullscreen mode Exit fullscreen mode

πŸ‘€ Linux Users and Permissions

Users

  • root: superuser with full power
  • Regular users: limited power, safer

Permissions

Every file has:

  • Owner, Group, and Others
  • Read (r), Write (w), Execute (x) permissions
ls -l
Enter fullscreen mode Exit fullscreen mode

Example:

-rwxr-xr--  1 user group 1234 file.sh
Enter fullscreen mode Exit fullscreen mode

Means:

  • Owner can read/write/execute
  • Group can read/execute
  • Others can only read

πŸ”§ Installing Software (Debian/Ubuntu style)

sudo apt update
sudo apt install nmap
Enter fullscreen mode Exit fullscreen mode
  • sudo: run as root
  • apt: package manager
  • install: download and setup software

🧠 Mental Model: Everything Is a Command

In Linux:

  • You don’t click β€” you command
  • Even graphical apps are wrappers around terminal commands
  • You gain power through understanding, not clicking

βœ… Summary: What You Should Know Now

Concept Why It Matters
Linux is modular You can control and customize everything
Shell & terminal Interface to run commands, scripts
Filesystem Understand where everything lives
Permissions Secure access and prevent errors
Package manager Easily install/update/remove tools

Top comments (1)

Collapse
 
alexahayes profile image
Alexa Hayes

Amazing!