Fundamentals 7 min read

Essential Linux Commands: Quick Reference for Everyday Tasks

A concise collection of common Linux commands covering file management, user administration, permissions, networking, and editor shortcuts, presented with clear examples and explanations for quick learning and reference.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Essential Linux Commands: Quick Reference for Everyday Tasks

This guide compiles frequently used Linux commands, organized as numbered questions and answers.

File and Directory Operations

Locate user accounts: /etc/passwd Delete a non‑empty directory: rm -rf directory_name Show current working directory: pwd Create a directory: mkdir directory_name Display file contents: cat filename or more filename Show last 10 lines of a file: tail -n 10 filename Count lines in a file: wc -l filename Find files containing "bin" in their name under root: ll | grep bin Create multiple files (e.g., 1 to 100):

touch file{1..100}

User and Permission Management

Create a user: useradd zhangsan Set user password: passwd zhangsan123456 Delete a user: userdel username Switch user: su username Root home directory: /root Standard user home directory: /home/zhangsan Create a group and add user to it: groupadd super then usermod -g super zhangsan Change file ownership: chown root:root test1.txt Modify permissions (owner read/write/execute only):

chmod 700 directory

System Information and Control

Show current date/time: date Reboot system: reboot Shutdown immediately: halt -p shutdown now Check network connectivity: ping host Display IP configuration: ifconfig -a Find where a command is installed: whereis command Install or remove software (YUM): yum install package_name / yum remove package_name Download files:

wget URL

Shell Redirection and Piping

Standard output (1) and error (2) redirection: 1> file, 2> error.log Combine error with output: 2>&1 Pipe output of one command to another:

command1 | command2

Vi Editor Basics

Modes: command, insert, visual

Enter insert mode: press i Enter visual mode: press v Copy a line: press y Paste: press p Delete lines 3 to 15: :3,15d Save and quit: :wq Quit without saving:

:q!

File Permission Notation

rw‑xrwxrwx (777): all users can read, write, execute.

drwx------ (700): directory, owner has full rights, others none.

Miscellaneous

Help for commands: man command Difference between /bin and /sbin: /bin contains general system binaries usable by all users; /sbin holds binaries for system administration, typically requiring root.

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.

ShellSysadminViPermissions
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.