First, Linux common commands
- All command operations are performed on the server:
1) Classification
- software Operation command : Software installation, uninstall;
- server hardware Resources and disk operations : There are several CPUs, how much memory;
- File and folder Operations Command : New, delete, read and write operations;
- System User Action commands : Add users to the system, etc. (root is one of the users added)
- firewall-Related settings : The firewall is turned on by default, after opening will cause great trouble, need to set;
- Power-up operation (sudo) and file transfer operations : the use of the account after the removal of the rights required to use sudo, the local Windows server on the file upload to other server operations;
2) Software Operation command
- install software :yum install xxx
- Uninstall software :yum remove xxx
- search Software :yum search xxx
- Cleanup Cache :yum Clean Packages
- List installed :Yum list
- Package Information :yum info xxx
3) Server hardware resources and disk operations
- View memory usage:free-m, ("-M": Representation in megabytes)
- total: Memory 992 m
- used: used 108 m
- Free: remaining 640 m
- View hard disk usage:df-h, ("-H": Presentation in visual form)
- Filesystem: Represents all file systems under the disk of the server;
- Size: The total amount of disk space allocated by the server to each file system;
- used: Each file system has used its own disk space size;
- Avail: The amount of disk space remaining on each file system;
- use%: The use of the disk space of each file system LV;
- mounted: Each file system corresponds to the root directory, that is, the physical address to store them;
- Viewing the overall system load:w/top, (returns a specific value)
- After using the top command, press the Q key to exit;
- load Average: The average load value, in the Operation dimension represents the server health indicators;
- When load average = 1, the CPU is already full load carrying, the machine is more dangerous and needs processing;
- When load average > 1, indicates that the CPU has been overclocked running;
- Operations, the general "threshold" is set to 0.6 or 0.7, when the load average > 0.6/0.7, CPU Utilization into the dangerous "alarm threshold";
- Set 0.6 or 0.7 as "threshold", 0.4 or 0.3 of the CPU space is reserved for early prevention and rescue;
- load average: Average load;
- 0.00: Average CPU load for the last 1 minutes;
- 0.01: Average CPU load for the last 5 minutes;
- 0.05: Average CPU load for the last 15 minutes
Second, the file Operation command
- Linux system, all things are files, no format;
- ls: displays all files in the current directory;
- Ls-al (or "ll"): Displays all the files in the current directory as a list;
- CD + path: Enter the directory, (you can enter the specified directory from any directory)
1) directory Structure of Linux files
- /: root directory;
Go to root directory:CD/
- home directory; (storing a lot of user information, such as root)
- / tmp: Temp directory, (will be cleaned periodically, saved files are not stored in this directory)
- / etc: Configuration directory; (store config file: yum, SSH, etc.)
- / usr: User program directory; (store user program)
2) file Basic Operation command
- "./+ XX" : Indicates the current directory;
- Command + XX: Also indicated under current directory;
- Command + path/xx: Indicates the file or folder under the specified path;
- All operation commands of the file ( except PWD), you can manipulate files or folders under any directory, as long as the path is specified;
- ls: View the files in the directory
- ls: View the files in the current directory;
- ls + path: View the file under the specified path;
- Touch: Create a new file;
- touch xx, touch./xx: New file under current directory;
- Touch path/xx: Creates a new file under the specified path;
- mkdir: Create a new Folder;
- mkdir xx, mkdir./xx: Create a new folder under the current directory;
- mkdir path/xx: Create a new folder under the specified directory;
- mkdir-p path/xx1/xx2/xx3: Create a new multi-layer folder under the specified directory;
- CD Path: Enter the specified directory;
- RM xx: Delete a file or folder under a directory
- rm xx, rm./xx: Delete files from the current directory;
- RM path/xx: Delete the first file/folder in the specified directory;
- rm-r xx: Delete the folder under the current directory and all the files/folders underneath it; (ask for selection when deleting)
- rm-rf xx: Force delete the folder in the current directory and all the files/folders under it at once; (not asked when deleted)
- rm-r path/xx, rm-rf path/xx: Delete multi-level folders under the specified directory;
- cp: Copy files from the specified directory to another specified directory
- CP xx Path, CP./XX path: The xx file under the current directory is copied to the specified path directory;
- CP xx path/xx_1, CP./XX path/xx_1: The xx file under the current directory is copied to the specified path directory, and the file name is changed to Xx_1;
- CP path1/xx path2: Copy the xx file under the path1 directory to the path2 directory;
- CP path1/xx path2/xx_1: Copy the xx file under the path_1 directory to the path_2 directory, and change the file name to Xx_1;
- mv: moving files or folders
- mv xx Path, mv./XX path: Moves the xx file in the current directory to the path directory;
- mv xx path/xx_1, mv./xx path/xx_1: Move the xx file under the current directory to the path directory and rename it to Xx_1;
- mv Path1/xx path2: Move directory path1 file xx to path2 directory;
- mv Path1/xx path/xx_1: Move directory path1 under the file xx to path2 directory, and renamed to Xx_1;
- pwd: Displays the path to the current directory
3) Text Editor Vim
4) file Permissions 421
- Maximum permissions: 7/7/7 (because 4 + 2 + 1 = 7)
5) file Search, find, read
6) file compression and decompression
Linux:linux Common Command Explanation