Fundamentals 52 min read

Unlock Linux Mastery: Essential Commands, Shell Tricks, and System Management

This comprehensive guide walks you through Linux fundamentals, covering the operating system basics, essential shell commands, file and directory manipulation, user and permission management, process monitoring, networking tools, package handling, compression, compilation, and advanced Vim editing techniques, all with clear examples and code snippets.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Unlock Linux Mastery: Essential Commands, Shell Tricks, and System Management

Linux Basics

Linux is a multi‑user operating system that provides a kernel and a set of core utilities. Understanding the difference between the Linux kernel and distribution packages is essential for effective system use.

Shell Overview

The Shell is a command‑line interpreter that provides a prompt, accepts user input, and executes commands. Common shells include bash, zsh, fish, and others.

Essential Commands

pwd

– display current directory. ls – list files and directories with options such as -a, -l, -h, -t, -i. cd – change directory (e.g., cd /, cd ~). mkdir – create directories ( mkdir -p path/to/dir). cp and mv – copy and move files, with -r for recursive operations. rm – delete files; use -i, -f, -r carefully. chmod, chown, chgrp – modify permissions, ownership, and groups. cat, less, head, tail – view file contents. grep – search text with options -i, -n, -r. find – locate files with complex criteria.

File Permissions

Permissions are expressed as rwx for owner, group, and others. Numeric notation (e.g., chmod 640 file) and symbolic notation (e.g., chmod u+rx,g+r,o-r file) are both supported.

User and Group Management

useradd

, passwd – add users and set passwords. userdel – delete users. groupadd, groupdel – manage groups. usermod – modify user attributes such as primary group ( -g) or supplementary groups ( -G).

Process Management

ps -ef

– list all processes. top or htop – interactive process monitor. kill, kill -9 – terminate processes by PID. bg, fg, jobs – control background and foreground jobs. nohup – run a command immune to hang‑up signals.

Networking Tools

ifconfig

(or ip a) – view network interfaces. host – resolve DNS names. ssh – secure remote login; configure ~/.ssh/config for shortcuts. scp and rsync – copy files securely, with rsync -av for incremental backups. wget – download files from HTTP/FTP URLs.

Package Management and Compilation

Use yum (or dnf) to install binary packages. When a package is unavailable, compile from source:

./configure
make
make install

Compression and Archiving

tar -cvf archive.tar dir/

– create an archive. tar -xvf archive.tar – extract. gzip / bzip2 – compress archives (e.g., tar -zcvf archive.tar.gz dir/). zip / unzip – handle ZIP files.

Vim Editor Essentials

Vim operates in four modes: Normal (interaction), Insert, Command, and Visual. Key actions include:

Navigation: h j k l or arrow keys; 0 and $ for line start/end.

Editing: i, a, o to enter Insert mode; Esc to return.

Copy/Yank: yy (line), yw (word).

Delete: dd (line), dw (word), x (character).

Paste: p.

Search: /pattern then n / N.

Replace: :%s/old/new/g.

Split windows: :sp file (horizontal) or :vsp file (vertical); navigate with Ctrl‑w + direction.

Run external commands: :!ls.

Persist configuration in ~/.vimrc (e.g., set number, syntax on, set ignorecase).

System Control

reboot

– restart the system. halt or poweroff – shut down.

This guide provides a solid foundation for everyday Linux administration, scripting, and development tasks.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxShellVimCommandLineSystemAdministration
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.