Piping and "-"
Tar cvf /home | Tar xvf-
Use-to replace stdout stdin
The difference between this and the pipeline is that the pipeline is the output character stream, which is considered the previous file.
Tee Dual Guide
-A |
Accumulate writes to File |
two redirect ls | Tee A.txtdesktopdownloadsdropboxgoagentworkcat A.txt......ls | Tee a.txt > B.txt
Jobs
CTRL + Z: The task is paused ctrl+y: only when the process attempts to read input from the terminal is suspended &: task is FG in the background: let the process run in the foreground
-L |
List PID and process names |
-P |
PID number only |
-R |
Running the Run |
-S |
Paused stop |
%N |
Job number |
%string |
Command starts with a STRING |
%? STRING |
Command contains a STRING |
%+ |
The most recently called |
%% |
The most recently called |
%- |
Dilger recently called. |
Jobs [1]+ Stopped cat > a[2]- Stopped cat > BFG Remove Cat A at this time by performing FG and the default is to remove the + sign c8> to remove 2, use FG 2, or FG- can also be used FG? B, but FG. A is not, and cat has a conflict
Kill
-I. |
Interactive, to remove a hint |
-E |
Exact, plus a name not exceeding 15 characters |
-I. |
Ignore case |
SIGNAL Signal
-L |
List SIGNAL |
-1 |
Re-reading the configuration file of the parameter once |
-2 |
CTRL + C |
-9 |
Force removal of a job |
-15 |
Terminate a work in a normal way |
-17 |
CTRL + Z |
General PID By default, you can omit the% number, but there are exceptions, work control, and so on.
Kill-signal PID
Ps
List the order of execution in the background
-A,-E |
To show all the process. |
-A |
and the terminal process. |
-X |
Use with-A to list more complete information |
Output formatting rules
L |
Long format |
J |
Job format |
-F |
The complete output |
Format of L
F:flags
4 Stands for Root
1 means subroutine
S:stat
R:running
S:sleep
D: Sleep states that cannot be awakened
T:stop
Z:zombie (zombie State) program has been terminated but cannot be removed to memory
Uid/pid/ppid ...
C: Represents CPU usage.
Addr:kernel function., which indicates which part of the program is in memory, running-
SZ: How much memory is used on behalf of the program
Wchan: Indicates whether the program is currently running,--that is, running.
TTY: The terminal location of the login, remote login using the dynamic Terminal interface (pts/n);
Time: The CPU time that is spent using the CPU.
Cmd:command name.
Trap
Trap "Echo ' hit Control-c '" INTtrap"Echo ' Try to kill me '" term whiledo sleep
Wait
Wait for the above task to finish before doing the following to prevent concurrency.
Do something ...
Wait
Do another thing
At
-F <FILEnAME> |
The file to be executed |
-L |
Lists the jobs that are currently being searched for pending runs. Atq |
-R |
Clear ATM |
-M |
Send mail to users after completing work |
Time |
H HH. MM hh:mm h:m, supports a.m. and p.m. |
DATE |
Today, tomorrow |
At now + 2minuteat 11.10PMATQ list atrm +n First use ATQ to see which program is and then delete
Batch performs work when the system is idle
Crontab
MINUTE HOUR Day MONTH WEEK COMMAND # If there is no qualification required *.
Note: Sunday is expressed in 0, indicating that the COMMAND, 1, 0, Week time and sun and moon time should not be present in Sunday and Monday
0 * * * Dropbox start # indicates that 22:00 runs Dropbox every day to backup */5 * * * * COMMAND # indicates that every 5 minutes crontab FILENAME is executed
Export editor= "Emacs"
-u <user>, |
define user |
-e |
edit user's crontab |
-l |
list user's crontab |
-r |
delet E user ' s crontab |
-i |
prompt before deleting |
-n |
set host in cluster to run users ' Crontabs |
-c |
get host in cluster to run users ' Crontabs |
-x <mask>, |
enable debugging |
Backup File/var/spool/cron/user # Root
Daemon
reside in memory. The process that has been working in the background.
Top
-D |
Number of seconds to follow, default is 5 seconds, the number of seconds to update the screen |
-B |
Perform the top in batch mode |
-N |
Paired with-B, indicating that a few top outputs are required |
-P |
Specifying certain PID for observation and detection |
Keys:
? |
Display key commands that can be entered |
P |
Sort display as CPU usage resources |
M |
Sort display with Memory's usage resources |
N |
Sort by PID |
T |
Sorted by CPU Time |
K |
Give a signal to a PID (signal) |
R |
Re-create a nice value for a PID |
Q |
The case of leaving top |
Free
List Memory Information
Linux Notes--process