First, declare the operating environment:
Operating system: CentOS 6.5 (Final)
Kernel version: Linux 2.6.32-432.el6.x86_64 (64-bit operating system)
TIPS1: It is recommended that all operations be performed in command-only mode (it is a matter of morning and evening to learn Linux ╮(╯▽╰)╭)
TIPS2: All commands are preceded by a "#" character, which is followed by a command, not entered in the actual operation
TIPS3: All commands are executed by the root user (some commands are not for ordinary users)
First section: Basic commands
(1) Shutdown Restart command (it seems that the shutdown command is not very good at the outset, but this is really the most basic operation)
#shutdown –h Now//immediate shutdown (root user rights)
#shutdown –h 10//10 minutes after shutdown (root user rights)
#shutdown –h 20:00//20:20-point off
#halt//Shutdown (root user)
#poweroff//Shutdown (root user)
#reboot//Restart command
#shutdown-R now//rule with shutdown command, but change "-H" to "-R"
(2) View computer Information commands
#uname –r//view kernel version
#cat/etc/redhat-release//View system Iteration
# Cat/proc/cpuinfo//View cup information
# LSUSB–TV//View all USB devices
#fdisk –l//view disk information
#hostname//view current host name
#ifconfig//View network card information (cmd in Windows is ipconfig)
#date//View system time
#date 042009082013//Modify system time in order for month (04), date (20), hour (09), Minute (08), Year (2013)
Tips:
#clear//Clear screen operation can also use CTRL + C here is to hold down CTRL and then press and hold on the keyboard for the meaning not to enter "CTRL"
Up and down keys bring up recently executed commands
Section II: Basic syntax for commands
# command Word [options] [parameter 1] [parameter 2] ...
Command word is essential, options and parameters are optional
Command Word, option, parameter must have a space between, can be one, can also be multiple
Option effect:
Adjust how commands are executed
A single character option is required before adding-
option if it is a word that needs to be added--
Multiple single-word check items can be used with one-merge
As mentioned above, the "Shutdown-h Now" command:
# shutdown-h Now
| | |
command Word parameter 1 parameter 2
Shutdown means close operation
Parameter 1 indicates shutdown
A parameter of 2 indicates that execution now
Section III: Folder commands
#ls//List files and folders in the current directory
#ls/test//List files and folders under the Test directory
#ls-A/test//lists the files and folders under the Test directory, including hidden files and folders
#ls-L//lists the files and folders in the current directory, displaying some basic information in long format including files and folders
#ls-l/test//List files and folders in the Test directory, long format display
#ll//equivalent to the LS–L command
#ls-LH//Lists files and folders in the current directory, long format display, and displays the size of files and folders
#ls-L-H//equals the previous LS–LH command
#ls-R/test//recursive display of all contents of the test directory such as: Test has/test/test1 folder, use this command to recursively display all files and folders under Test1
#pwd//shows the current file location
# CD//This command means go to that folder meaning, after you can take the parameter does not answer the parameter to return to the current user's home directory
#cd ~//back to current user home directory equivalent to "CD" command "~" means the current user home directory
#cd///to the root directory
#cd/etc//to the ETC directory in the root directory
#cd: Go back to the top-level directory of the current directory, if it is in the root directory or in the root directory
#cd: /.. Go back to the top level of the current directory in general this usage is to go back to the root directory, so it is recommended to use "CD/"
TIPS1: Relative path and absolute path
Absolute path: From/start
Relative path: Not from/start, starting from this directory
TIPS2: When going to a directory name more complex directory can use the TAB key will not finish the directory name, such as want to go to the/etc/sysconfig directory when input "/e" press the TAB key can be automatically filled to "/etc", when the option is not only one time You can "double tab" operation, such as input to "/etc/s" forget the word how to spell this time you can press the TAB key screen will prompt
[Email protected]/]#/etc/s
samba/security/sgml/ssh/subversion/
sasl2/selinux/skel/ssl/sudoers.d/
scl/setuptool.d/sound/statetab.d/sysconfig/
[Email protected]/]#/etc/s
At this point, you can look at the top one that you need, and then enter
Basic Linux Operations