Linux common commands:

(1) View linux memory and hard drive: free and -h df
(2) Which one command to view the disk space quota own file system: the repquota
(3) How to view a summary of usage and a Linux command: whatis *
(4) belongs to which user data dictionary: the data dictionary enter sys user, sys, and steam is automatically created.
(5) how a page view the contents of large files: through a conduit command: CAT test.txt | More
(6) which bash built-in command can perform mathematical operations: the let c = A + b
(7) What hash use: it manages the built-in hash table to see the full path of the command has been executed, view the used and the number of commands executed by the command.
(8) How to restart the server without removing all running processes: the disown -r
(9) How to Print the directory stack: dirs
(10) How to view the current list of commands supported by the system: compgen -c
(11 ) how to bind a command or macro button, if the key is, we must first obtain a sequence of characters buttons f12: the press ctrl +, and then press f12, we can get the character sequence of F12 ^ [[24 ~, then use the bind bind, bind ' "^ [[24 ~": "date"', may be used showkey -a view corresponding to the key sequence.
(12) awk command: It excels text formatting, such as a simple awk '{print $ 1, $ 2, "String"}' test, test file output first and second columns of "String"
, (13) the definition of du and df, except: du display size of the file or directory, df displays information about each file where the file system, the default is to display all file systems. du is the user-level commands, df disk allocation map to view the file system and consider the meta data.
(14) How to take command aliases: Alias 'LS -a'
(15) Find What command by command: which can only view the execution command, such as binary files, documentation and source files.
(16) See what kinds of environment variables command: See all using env, a view, such as: home: env $ HOME.
(17) What command specified by the command prompt:

    \u:显示当前用户账号

    \h:显示当前主机名
    
    \W:只显示当前路径最后一个目录
    
    \w:显示当前绝对路径(当前用户目录会以~代替)
    
    $PWD:显示当前全路径
    
    $:显示命令行’$'或者’#'符号
    
    \#:下达的第几个命令
    
    \d:代表日期,格式为week day month date,例如:"MonAug1"
    
    \t:显示时间为24小时格式,如:HH:MM:SS
    
    \T:显示时间为12小时格式
    
    \A:显示时间为24小时格式:HH:MM
    
    \v:BASH的版本信息 如export PS1=’[\u@\h\w\#]$‘  

(18) the absolute path is represented by what? The current directory under the parent directory is represented by what? Home directory is represented by what? What switch catalogs, said:?
Absolute path: as etc / int.d, the current directory and the parent directory: ./ ../, home directory: ~ /, change directory: cd
(19) to see how the current process? How an exit? How to view the current path?
View the current process: ps, an exit: exit, view the current path: pwd
(20) how clear the screen? How to exit the current command? How to perform sleep? How to view the current user id? View help specify what order?
Clear screen: clear, exit the current command: ctrl + c to exit completely, perform sleep: ctrl + z suspends the current process to restore the background, view the current user id: "id": View shows the current login account uid and gid and affiliated groups and user name, check the specified help: help
(21) LS command performs what function? With which parameters can be, any difference:
list directories and files in the specified directory, a is all documents, l details, including the size of the number of bytes, read and write privileges executable like.
(22) order to establish links and hard links soft:
soft link: ln -s slink source
hard link: LN Link Source
(23) directory created what order? Create a file what order? Copy the file what order? Permission to modify what order?
Create a directory: mkdir
to create the file: touch, vi, vim
copying files: cp
modify the permissions: chmod
(24-) to view the contents of the file have what command?
vi filename # editing view, you can modify the
cat filename # show all file contents
more filename # page display file contents
similar less filename # and more, better can forward flip
tail filename # see only the tail can also specify the number of rows
head filename head # view only, you can also specify the number of rows
(25) free to write file command? How to bring to the screen output string spaces, such as "the Hello world"?
Vi or vim
echo the Hello world
(26) terminal which is a file folder? Black hole which command file which folder?
Terminal: / dev / tty
black hole file: / dev / null
(27) which moved and renamed command?
mv mv
(28) which command to copy files? If you need to copy a folder with it? If you need to have prompted it?
???? cp -r cp
(29) to delete the file which command? If you need even directories and directory delete a file it? Delete empty folders what order?
Delete files: rm, delete the directory together with:? Rm -r, remove empty folder: rmdir
What a wildcard at (30) Linux? Represent the mean?
"?" May be replaced by a single character
, "*" may be substituted for any number of characters
in square brackets "[charset]" charset Alternatively any single character set, such as [AZ], [abABC]
(31 is) what command contents of a file of statistics? (Number of lines, words, bytes)
WC -l command -c count the number of bytes statistics number of lines -w count the words
(32) Grep command what is the use? How to ignore case? How to find free line of the string?
Grep is a powerful text search tool, it can use a regular expression search text, and print out the matching rows.
grep [stringstring] filename grep [^ String] filename
(33) in the Linux process in several states? Ps displayed in the information, what are represented by symbols?
Have the following statuses: (1) non-terminal state, (2) Pause / tracking installed state, (3) the ready state, (4) the operating state, (5) can interrupt the sleep state, (6) zombie, (7 ) exit status

    D 不可中断 Uninterruptible(usually IO)
    R 正在运行,或在队列中的进程
    S 处于休眠状态
    T 停止或被追踪
    Z 僵尸进程
    W 进入内存交换(从内核 2.6 开始无效)
    X 死掉的进程  

(34) how to make a command to run in the background
are generally using & at the end of the command to let the program run automatically (after the command is not available spaces)
(35) show all processes using the ps, ps to see how the use of the specified process information?
ps -ef (system v output)
PS -aux BSD format output
PS -ef | grep pid
(36) which commands designed to view the background tasks?
the -l the Job
(37) the background to the foreground task performed using what order? To stop background tasks in the background to implement what order?
To perform background tasks to the foreground fg
to stop background tasks execute in the background BG
(38) to terminate the process what order? With what parameters?
kill [-s <message name or number>] [program] or kill [-l <message number>]
the kill-9 pid
(39) to search for files what order? Format is what?
find <specified directory> <specified file> <specified criteria>
whereis file name plus parameters and
locate the file name only plus
find direct search the disk, the slower
find / -name "String *"
(40) See who's currently in use by the host What orders? Find information terminal where their what order?
Find where their terminal information: who am i
to view who is currently using the host: the WHO
(41) used to view the list of commands:
History
(42) What command to view disk usage space, free space?
df -hl
file system capacity has been available by the mount point% with
the Filesystem Size Used Avail the Use% Mounted ON / dev / hda2. 19G 45G 24G, 44 is% /
/ dev / hda1 494M 450M 19M. 4% / Boot
(43 is) what order Check whether the network connectivity:
netstat, ping Baidu website or directly.
(44) ip address and interface information see what command
ifconfig

Guess you like

Origin www.cnblogs.com/Mr-RanX/p/11525431.html