Master Linux Basics: OS Overview, Commands, Users & Permissions
This guide provides a comprehensive overview of Linux operating system fundamentals, covering file system structure, essential command-line tools, user and group management, permission handling, process control, and common software installation methods.
操作系统概述
Linux 操作系统安装
Linux 文件系统
Linux 命令操作
Linux 权限管理
用户和用户组
用户操作命令
权限操作
Linux 进程管理
Linux 其他常用命令大全
Linux 系统软件安装
常用软件安装
Operating System Overview
Operating System (OS) is software that manages and controls computer hardware and software resources, running directly on the bare metal. All other software must rely on the OS to operate.
Linux Installation
For detailed installation steps, refer to the Linux installation tutorial.
Linux File System
/var : Variable files such as logs, spools, and temporary files.
/home : User files, configuration, documents, and caches.
/proc : Virtual files representing kernel and process information; they do not occupy disk space.
/bin : Essential binary executables needed at system startup, usable by all users.
/etc : System configuration files (firewall, startup scripts, etc.).
/root : Home directory of the superuser.
/dev : Device files; hardware is abstracted as files for easy read/write operations.
Linux Command Operations
pwd : Show the current directory.
cd : Change directory. Examples: cd [directory] , cd ~ , cd .. , cd - , cd / .
ls : List files. Options: ls -l , ls -a , ls -la .
mkdir : Create directories. mkdir folder , mkdir -p path/to/folder .
rmdir : Remove empty directories. rmdir folder , rmdir -p path .
rm : Delete files or directories. rm -rf file_or_dir , rm -ri file_or_dir .
cp : Copy files or directories. cp -r src dest , cp -ri src dest .
mv : Move or rename files/directories. mv old_name new_name .
touch : Create an empty file. touch filename .
vi : Powerful text editor. Use vi ++ filename to edit or create a file.
vi has three modes: command mode, insert mode, and last‑line mode (accessed with Esc : ).
cat : Display file contents or create a file with redirection ( cat > filename ).
head : Show the beginning of a file. Example: head -n 10 filename .
tail : Show the end of a file or follow updates. tail -f filename , tail -n 20 filename .
Because the consequences of forced deletion are severe, it is generally not recommended to use rm -rf . The rm command without the r option cannot delete directories, only files.
User and Group
A user is a collection of permissions identified by a unique UID. Users belong to at least one group, identified by a GID. UID and GID values above 500 are typically used for regular users to avoid conflicts with system accounts.
The root user has the highest privileges and belongs to the root group. Only root can add or delete users. When a user is created without specifying a group, a group with the same name is automatically created.
User Management Commands
su : Switch user. su username or su - username .
whoami : Show the current logged‑in user.
groups : List groups the current user belongs to.
id : Show UID and GID of the current user.
useradd : Add a new user. useradd username or useradd -u UID username .
passwd : Change a user's password. Example: passwd sang .
userdel : Delete a user. userdel username or userdel -r username to also remove the home directory.
usermod : Modify user information. Examples: usermod -l newname oldname , usermod -g newgroup username .
groupadd : Add a new group. groupadd groupname or groupadd -g GID groupname .
Permission Operations
Linux defines three basic permissions: read (r), write (w), and execute (x). Use ls -l to view permissions. drwxr-xr-x 2 root root 4096 Sep 23 2011 bin Explanation of the fields from left to right: directory flag, owner permissions, group permissions, others permissions, link count, owner, group, size, date, name.
The chmod command changes permissions. Syntax: chmod [options] [mode] file.
Permission mode uses u, g, o for owner, group, others, with + or - to add or remove r, w, x. Example: chmod u+rwx,g+rw,o+rw file1 Numeric mode uses octal numbers: 7 = rwx, 5 = r-x, 4 = r--, etc. Example:
chmod 753 file1 chmod 777 file1Linux Process Management
Use ps to view running processes and obtain their PIDs. ps -ef | grep [process_keyword] Sample output shows user, PID, PPID, CPU usage, and command path.
Use kill to terminate a process. Example: kill -9 PID.
Other Common Commands
clear : Clear the terminal screen.
man : Show manual pages for commands.
mnt : Mount filesystems.
SSH service commands: service sshd start , service sshd restart , service sshd stop .
Run a JAR in the background: nohup java -jar jar-0.0.1-SNAPSHOT.jar & .
Software Installation
Common installation methods:
tar : Extract tar, tar.gz, or tar.bz2 packages. Example: tar -zxvf package.tar.gz , tar -jxvf package.tar.bz2 , tar -xvf package.tar .
rpm : Install, query, or remove RPM packages. Examples: rpm -ivh package.rpm , rpm -qa | grep name , rpm -e package.rpm .
yum : Resolve dependencies and install RPMs from repositories. Example: yum install package .
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.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
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.
