Master Linux Basics: From Kernel Fundamentals to Powerful Command‑Line Skills
This comprehensive guide walks developers through the essential concepts of Linux, covering the difference between the kernel and distributions, key command‑line tools, file and permission management, process handling, networking basics, and advanced Vim editing techniques, empowering programmers to become proficient in Linux system operations.
Linux Basics: From Kernel to Command Line Mastery
Learning Linux is essential for programmers; front‑end developers often overlook it, yet mastering the Linux kernel, distributions, and command line boosts productivity and system security.
What Is Linux?
Linux refers to the kernel maintained by Linus Torvalds, providing hardware abstraction, file system control, and multitasking. A Linux distribution combines the kernel with various software packages.
Linux vs. Windows
Stability and efficiency
Free or low‑cost
Fewer vulnerabilities and fast patches
Multi‑tasking and multi‑user support
Robust permission model
Suitable for embedded systems
Low resource consumption
Common Linux Distributions
RHEL (Red Hat Enterprise Linux) – widely used in production
Fedora – upstream of RHEL, community‑driven
CentOS – binary‑compatible rebuild of RHEL
Debian – stable, security‑focused
Ubuntu – Debian‑based, user‑friendly for desktops and servers
Connecting to a Remote Server via SSH
ssh [email protected]Enter the password to log in and start managing the remote machine.
Understanding the Shell
The shell is a command‑line interpreter that provides a prompt (e.g., $) for user input. Common shells include Bash, Zsh, Fish, and others.
Common Shells
Bash – default on most Linux systems
Zsh – powerful with plugins
Fish – user‑friendly syntax
Basic Commands
pwd– display current directory ls – list files and directories cd – change directory mkdir – create a directory touch – create an empty file rm – delete files or directories cp – copy files or directories mv – move or rename files cat – display file contents less – view file contents page by page head and tail – view beginning or end of a file
File Permissions
Permissions are displayed as a ten‑character string (e.g., drwxr-xr-x) where the first character indicates the type (d for directory, - for file, l for link) and the next nine characters represent read (r), write (w), and execute (x) permissions for owner, group, and others.
chmod 740 file.txt # owner rw-, group r--, others ---
chmod -R 777 /var/www # recursive changeManaging Users and Groups
useradd– add a new user passwd – set user password userdel – delete a user groupadd – create a group usermod – modify user attributes groups – list groups a user belongs to
Process Management
ps -ef– list all processes top – interactive process monitor kill PID – terminate a process bg / fg – move jobs between background and foreground jobs – list background jobs
Searching Files
find /path -name "pattern"– locate files by name locate keyword – fast search using a database grep -r "text" /path – recursive text search
Redirection and Pipelines
Use > to redirect output to a file, >> to append, 2> for error output, and the pipe | to pass the output of one command as input to another.
ls -l | grep "\.txt" > txt_files.txtPackage Management with yum
yum install package– install a package yum update – update all packages yum remove package – uninstall a package yum search keyword – search the repository
File Compression
Combine tar with gzip or bzip2 to create compressed archives.
tar -czvf archive.tar.gz folder/ # create gzipped archive
tar -xvf archive.tar.gz # extract archiveCompiling Software from Source
Download the source tarball.
Extract it with tar -zxvf.
Enter the directory and run ./configure.
Compile with make.
Install with make install.
Networking Basics
ifconfig– display network interfaces (install net-tools if missing) host example.com – resolve domain to IP ssh user@host – secure remote login scp file user@host:/path – copy files securely rsync -av source/ destination/ – efficient synchronization
System Control
reboot– restart the system halt or poweroff – shut down
Vim Editor Essentials
Vim operates in several modes: Normal (command) mode, Insert mode, Visual mode, and Command‑line mode.
Press i to enter Insert mode.
Press Esc to return to Normal mode.
Use : to enter Command‑line mode (e.g., :wq to save and quit).
Visual mode: v for character selection, V for line selection, Ctrl+v for block selection.
Common commands: dd delete line, yy yank (copy) line, p paste, /pattern search, :%s/old/new/g replace globally.
Split windows: :sp file (horizontal) or :vsp file (vertical). Navigate splits with Ctrl+w followed by arrow keys or Ctrl+w Ctrl+w.
Advanced Vim Features
Run external commands with :!command, merge files using :r filename, and customize Vim permanently by creating a ~/.vimrc file with settings such as set number to display line numbers.
By mastering these Linux fundamentals and Vim techniques, developers can efficiently navigate, automate, and manage their development environments.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Linux Cloud Computing Practice
Welcome to Linux Cloud Computing Practice. We offer high-quality articles on Linux, cloud computing, DevOps, networking and related topics. Dive in and start your Linux cloud computing journey!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
