Operations 18 min read

Master Linux Basics: Filesystem, Commands, Permissions, and User Management

This guide provides a comprehensive overview of Linux operating system fundamentals, covering installation references, filesystem hierarchy, essential command-line operations, user and group management, permission handling, process control, and common software installation methods, complete with practical examples and command syntax.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Master Linux Basics: Filesystem, Commands, Permissions, and User Management

Operating System Overview

Operating System (OS) is the fundamental software that manages hardware and software resources on a computer. It runs directly on the bare metal and provides the platform for all other applications.

Linux Installation

Installation steps are described in the Linux installation tutorial. URL: https://blog.csdn.net/huaijiu123/article/details/82083452

Filesystem Hierarchy

/var

: variable data such as logs, spools, temporary files. /home: each user’s personal files and configuration. /proc: virtual files exposing kernel and process information; they do not occupy disk space. /bin: essential binaries required for system boot and basic commands. /etc: system and service configuration files. /root: home directory of the superuser. /dev: device files that abstract hardware as files.

Basic Command-Line Operations

Show current directory: pwd Change directory: cd [directory] (e.g., cd ~ for the user’s home, cd .. for the parent, cd - to return to the previous directory, cd / for the root).

List files: ls (options: ls -l for long format, ls -a to include hidden files, ls -la for both).

Create directories: mkdir folder_name or recursively mkdir -p folder/subfolder.

Remove empty directories: rmdir folder_name (or rmdir -p folder_name for recursive removal).

Delete files or directories: rm -rf path (forceful removal, use with caution) or rm -ri path for interactive confirmation.

Copy files/directories: cp source destination (recursive: cp -r src dst, interactive: cp -ri src dst).

Move or rename: mv old_name new_name (also moves files across directories).

Create empty file: touch filename View or edit files:

vi filename

File Editing with vi

The vi editor has three modes:

Command mode – enter commands to manipulate text.

Insert mode – edit the file content; press Esc to return to command mode.

Ex (last‑line) mode – execute commands such as :wq! to save and quit or :q! to quit without saving.

vi command mode
vi command mode
vi insert mode
vi insert mode
vi ex mode
vi ex mode

Viewing Files

cat filename

– display file content. cat > filename – create a new file and write to it. head -n N filename – show the first N lines. tail -f filename – follow a file (useful for logs). tail -n N filename – show the last N lines.

Permission Management

Linux defines three permission types (read, write, execute) for three classes of users (owner, group, others) using the symbols r, w, x. Example output of ls -l: drwxr-xr-x 2 root root 4096 Sep 23 2011 bin Interpretation: d – directory. rwx – owner has read, write, execute. r-x – group has read and execute. r-x – others have read and execute.

Changing permissions is done with chmod. Two syntax styles exist:

Symbolic mode: chmod u+rwx,g+rw,o+rw filename – use u, g, o for owner, group, others and + / - to add or remove r, w, x.

Numeric mode: Permissions are represented by three octal digits (owner, group, others). For example, chmod 753 filename gives rwx to owner, r-x to group, and -wx to others; chmod 777 filename grants full access to everyone.

chmod example
chmod example

Process Management

Common commands to view and control processes:

List processes: ps -ef | grep keyword – shows user, PID, PPID, CPU usage, and command.

Terminate a process: kill -9 PID – forcefully kill the process identified by its PID.

ps -ef | grep sshd
kill -9 1234

Common Utilities

clear

– clear the terminal screen. man command – view the manual page for a command. service sshd start, service sshd restart, service sshd stop – control the SSH daemon. nohup java -jar jar-0.0.1-SNAPSHOT.jar & – run a Java JAR in the background without hanging up.

Software Installation

Three primary methods for installing software on Linux:

Tar archives: Use tar to extract packages. tar -zxvf package.tar.gz – extract gzip‑compressed archive. tar -jxvf package.tar.bz2 – extract bzip2‑compressed archive. tar -xvf package.tar – extract plain tar archive.

RPM packages: Red Hat package manager. rpm -qa | grep keyword – check if a package is installed. rpm -ivh package.rpm – install with progress. rpm -e package_name – uninstall.

YUM: Front‑end to RPM that resolves dependencies automatically. yum install package_name – installs the package and any required dependencies.

yum installation
yum installation

User and Group Management

Linux assigns each user a unique UID and each group a GID. The root user (UID 0) has full privileges.

Add a user: useradd username (optionally specify UID with -u UID).

Delete a user: userdel username or userdel -r username to remove the user’s home directory.

Modify a user: usermod [options] username (e.g., usermod -l newname oldname to change login name, usermod -g groupname username to change primary group).

Set password: passwd username.

Add a group: groupadd groupname (optionally specify GID with -g GID).

Delete a group: groupdel groupname.

Switch user: su username (temporary) or su - username (login shell).

Show current user: whoami.

Show groups of current user: groups.

Show UID/GID: id.

user management
user management

Permission Operations

Changing file permissions uses chmod in symbolic or numeric mode (see Permission Management section). Example symbolic command: chmod u+rwx,g+rw,o+r filename Example numeric command:

chmod 754 filename
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.

LinuxSystem AdministrationUser Management
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.