Learn Linux_06_Linux management commands from scratch

Source: Internet
Author: User

Learn Linux_06_Linux management commands from scratch

I. df, du 1, df (1) df (2) df-h explicitly displays the usage of disk partitions.

(3) df test query which partition test belongs to (4) example [1] usage of the explicit disk partition

[2] files first in the root directory should not be mounted to the root directory $ df sys/


2. Run du (1) du (2) du-h to view the directory usage in an intuitive way.
(3) du-s
(4) du-sh (5) example [1] view the usage of files in the current directory and the current directory # du-h linux/
8.0 K linux/test
16 K linux/
[2] view the usage of the current directory only # du-sh linux/
16 K linux/

Ii. free 1. Used to view memory usage
2. # free
(1) total: physical memory
(2) used: used
(3) free: remaining
(4) buffers: buffer allocated by the system but not used (buffer for access to I/O)
(5) cached: cache allocated by the system but not used (file system cache)
(6)-/+ buffers/cache 436304 = 1267492-92820-738368; 1555000 = 723812 + 92820 + 738368

3. ps 1. ps: processes used by the current user # ps
PID TTY TIME CMD
5341 pts/2 00:00:00 su
5349 pts/2 00:00:00 bash
5545 pts/2 00:00:00 ps

2. ps-aux: view all processes # ps-aux

3. ps-ef: The printed information is different. The ID of the Parent and Child processes is printed. # ps-ef

4. top (similar to the Job Manager in the window) 1. top is equivalent to free + ps # top

2. Exit by q

5. Kill and killall 1. kill commands send signals to a process (in general, Kill a process)
2. kill-l: list signals # kill-l
1) SIGHUP 2) SIGINT3) SIGQUIT 4) SIGILL5) SIGTRAP
6) SIGABRT 7) SIGBUS8) SIGFPE 9) SIGKILL10) SIGUSR1
11) SIGSEGV 12) SIGUSR213) SIGPIPE 14) SIGALRM15) SIGTERM
16) SIGSTKFLT 17) SIGCHLD18) SIGCONT 19) SIGSTOP20) SIGTSTP
21) SIGTTIN 22) SIGTTOU23) SIGURG 24) SIGXCPU25) SIGXFSZ
26) SIGVTALRM 27) SIGPROF28) SIGWINCH 29) SIGIO30) SIGPWR
31) SIGSYS 34) SIGRTMIN35) SIGRTMIN + 1 36) SIGRTMIN + 237) SIGRTMIN + 3
38) SIGRTMIN + 4 39) SIGRTMIN + 540) SIGRTMIN + 6 41) SIGRTMIN + 742) SIGRTMIN + 8
43) SIGRTMIN + 9 44) SIGRTMIN + 1045) SIGRTMIN + 11 46) SIGRTMIN + 1247) SIGRTMIN + 13
(48) SIGRTMIN + 14 49) SIGRTMIN + 1550) SIGRTMAX-14 51) SIGRTMAX-1352
SIGRTMAX-11 (53) SIGRTMAX-1055 (54) SIGRTMAX-9) SIGRTMAX-857 (56)
(58) SIGRTMAX-6 59) SIGRTMAX-560 (SIGRTMAX-4) SIGRTMAX-362)
63) SIGRTMAX-1 64) SIGRTMAX 3, kill-9 pid, 9 signal is the signal to kill the process # ps
PID TTY TIME CMD
5341 pts/2 00:00:00 su
# Kill-9 5341
Root @ xin-Inspiron-N4030:/home/xin # killed
4. killall process name

Vi. rpm 1. Introduction (1) What is RPM? RPM is a software Package management tool and short for Redhat Package Manager, which was first introduced by redhat, now it has become an industry standard, such as OpenLinux and S. u. s. e. and Linux releases such as Turbo Linux all adopt rpm.
(2) What is a Package: in short, an archive Package contains all the files in the application or library, and also contains a control script, it is used for installation, uninstallation, status check, and dependency check.
2. General RPM commands

3. Install rpm package (1) rpm-ivh glibc-2.3.2-11.9.rpm (commonly used)
(2) If there is a dependency prompt, we ignore dependency forced installation, you can use rpm-ivh -- nodeps glibc-2.3.2-11.9.rpm
(3) If a file in the package to be installed is already installed when other packages are installed, you can replace the existing file with the rpm-ivh -- replacefiles glibc-2.3.2-11.9.rpm, you can also ignore file conflicts with the rpm-ivh -- force glibc-2.3.2-11.9.rpm

4. Uninstall the rpm package (1) rpm-e glibc
(2) You do not need to specify the package version number when uninstalling the package. If other software packages depend on the software package you want to uninstalling, an error will be generated during uninstalling the software package.
5. Upgrade rpm package (1) rpm-Uvh glibc-2.3.2-11.9.rpm (commonly used)
(2) Note: even if the glibc package is not installed on the system, you can use this command to install glibc smoothly.
6. query installed software packages (1) rpm-qa: Query all installed software packages
(2) rpm-q glibc: Check the version of glibc package


VII. tar 1. file backup (tar)
2. tar example (1) tar-cvf text.tar text: create a backup file
(2) tar-tvf text.tar: view a list of backup files
(3) tar-xvf text.tar: Extract files from backup files
(4) tar-zcvf text.tar.gz text: Back up and compress the file
(5) tar-zxvf text.tar.gz: Extract files from the compressed package

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.