System Tools
2025-05-21
Decompression Tool
In Linux systems, the tar command is usually preinstalled by default and requires no additional setup. It is a core tool included in almost all Linux distributions (e.g., Ubuntu, CentOS, and Debian).
Install tar (if needed):
sudo apt update && sudo apt install tar
tar supports packing/unpacking by default, but compression/decompression relies on other tools (e.g., gzip, bzip2, and xz), which are also typically preinstalled.
| Format | Compress Command | Decompress Command |
|---|---|---|
| .tar | tar -cvf file.tar dir/ | tar -xvf file.tar |
| .tar.gz | tar -czvf file.tar.gz dir/ | tar -xzvf file.tar.gz |
| .tar.bz2 | tar -cjvf file.tar.bz2 dir/ | tar -xjvf file.tar.bz2 |
| .zip | zip file.zip dir/ | unzip file.zip |
| .7z | 7z a file.7z dir/ | 7z x file.7z |
| .rar | rar a file.rar dir/ | unrar x file.rar |
Filesystem Tools
| Tool | Function | Example Command |
|---|---|---|
| df | View disk usage | df -h |
| du | Check file size in the directory | du -sh /path/to/dir |
| lsblk | List block device information | lsblk -f |
| fdisk | View disk partitions | sudo fdisk -l |
| mount/umount | Mount/unmount devices | sudo mount /dev/sdX1 /mnt |
| mkfs | Formatting tool | sudo mkfs.ext4 /dev/sdX1 |
| fsck | Check/repair filesystems | sudo fsck /dev/sdX1 |
Disk Management Tools
| Tool | Function | Example Command |
|---|---|---|
| lsblk、fdisk -l、parted | View disk information | sudo parted /dev/sdX |
| gdisk、fdisk、gparted | Partitioning tools (GPT、MBR、GUI) | sudo gdisk /dev/sdX |
| partprobe | Update partition information | sudo partprobe /dev/sdX |
| pvcreate、vgcreate、dd | Advanced management (LVM/cloning) | sudo pvcreate /dev/sdX1 |
| df、du、ncdu | View disk usage | df -h |
| mkfs.ext4、mkfs.ntfs | Formatting tools | sudo mkfs.ext4 /dev/sdX1 |
Process Management Tools
| Tool | Function | Example Command |
|---|---|---|
| ps、top、htop | View processes | ps aux |
| kill、pkill、killall | Terminate processes | kill -9 PID |
| nohup、bg、jobs | Run programs in the background | nohup python3 script.py & |
| nice 、renice | Set process priority | nice -n 19 python3 script.py |
| vmstat 、pidstart | Monitor system resources | pidstat -d 1 |
| systemctl、journalctl | Management services | systemctl status nginx |