Cat CD
Chmod chown
CP CUT
Name: Cat
Use permission: All users
How to use: cat [-abeensttuv] [--help] [--Version] FileName
Description: Connect the file to the basic output (screen or plus> filename to another)
parameter:
-n or --Number is numbered by 1st of all outputs
-b or --Number-nonblank and -n, but not numbered for blank lines
-b or --Number-nonblank and -n, but not numbered for blank lines
-S or - SQUEEZE-Blank When there is a blank line with two consecutive lines, it is changed to a row.
Row
-v or --show-nonprinting
example:
CAT -N TEXTFILE1> TextFile2 Enter the file of TextFile1 plus the line number
TextFile2 in this archive
CAT -B textFile1 TextFile2 >> TextFile3 puts the file of TextFile1 and TextFile2
The case is added to the TextFile3 after adding the line number (the blank line does not add)
Name: CD
Use permission: All users
How to use: CD [DIRNAME]
Description: Transform work catalog to Dirname. The DirName representation can be an absolute path or relative way
path. If the directory name is omitted, transform to the user's Home Directory (that is, just login
The directory where you are located.
In addition, "~" is also expressed as HOME DIRECTORY, "." Means the current directory
, ".." The last layer directory of the current directory location.
Example: Jump to / usr / bin /:
CD / usr / bin
Jump to your own home Directory:
CD ~
Jump to the upper two layers of the current directory:
Cd ../ ..
Cd ../ ..
Directive Name: Chmod
Use permission: All users
How to use: chmod [-cfvr] [--help] [--version] mode file ...
Description: Linux / UNIX file access rights are divided into three levels: file owners, groups, others. use
CHMOD can be used to control how files are accessed by others.
Tie count:
Mode: Permissions Set strings, formats are as follows: [Ugoa ...] [[ - =] [rwxx] ...] [, ...], where U
Indicates the owner of the file, G indicates that the owner of the file belongs to the same group (group), o table
Demoned others, A means that these are all.
Represents increased permissions, indicates cancellation, = indicates unique setting permissions.
r indicates that readable, W represents written, x represents executable, X indicates that only when the file is a sub-directory
Or the file has been set to be executable.
-c: If this file authority does have changed, it will display its change action.
-f: If this file is not changed, do not display an error message.
-v: Details showing permission changes
-R: The same permissions change in the current directory with the subdirectory (ie, in the way
Change)
--help: Display auxiliary instructions
--Version: Display version
Example: Set the file file1.txt to everyone can read:
CHMOD UGO R File1.txt
Setting the file file1.txt can be read:
Setting the file file1.txt can be read:
CHMOD A R File1.txt
Set the file file1.txt and file2.txt to this file owner, which is written with its own same group, but other people cannot be written:
CHMOD UG W, O-W File1.txt File2.txt
Set the ex1.py to only the file owner can perform:
CHMOD u x ex1.py
Set all the files and subdirectories in the current directory to anyone read:
CHMOD -R A R *
In addition, CHMOD can also use numbers to express permissions such as CHMOD 777 file.
Grammatical: chmod abc file
Where A, B, C are each number, which represents USER, Group, and Other permissions.
R = 4, w = 2, x = 1
To RWX attribute 4 2 1 = 7;
To RW-attribute 4 2 = 6;
To R-X attribute 4 1 = 7.
example:
CHMOD a = rwx file
with
CHMOD 777 File
Effect
CHMOD UG = RWX, o = X File
with
with
CHMOD 771 FILE
Effect
If you use CHMOD 4755 FileName, this program has root permissions
Directive Name: Chown
Use permission: root
How to use: chmod [-cfhvr] [--help] [--version] user [: group] file ...
Description: Linux / UNIX is multi-person multi-work industry, all of which have owners. Use Chown
You can change the owner of the file. In general, this instruction only is by the system administrator (root)
Used, general users do not have permission to change others' file owners, and no authority can
The owner of the file is changed to others. Only the system administrator (root) has such permissions.
Tie count:
User: User IDGROUP: New Archive owner: New Archive owner's user group
GROUP-C: If the owner does have changed, it displays its change action -f: if this file
The owner cannot be changed or the error message is not displayed - h: only for the link (LINK), not the
LINK really pointing profile - V: Details of the owner change - R: All of the current directory
The file is changed with the subdirectories (ie, changed by one by one) - Help:
Assistment --Version: Display version
Example:
Set the owner of the file file1.txt to the User Group User Jessie:
Chown Jessie: Users file1.txt
Users of all files in the current directory with the owner of the subdirectories to users of the user group
Lamport:
Lamport:
Chown -r Lamport: users *
Name: CP
Use permission: All users
Use mode:
CP [options] Source Dest
CP [Options] Source ... Directory
Description: Copy a file to another, or copy several files to another directory.
Put on
-a will copy the file status, permissions and other materials as much as possible.
-r If the Source contains a directory name, the files in the directory are also copied to the destination.
-f If the destination already has the same file, it is deleted before the replication is removed.
example:
Copy the file aaa (already existing) and name BBB:
CP AAA BBB
Copy all C language to the finished subdirectory:
cp * .c finished
Name: CUT
Use permission: All users
Usage: Cut-CNum1-Num2 FileName Description: Shows the text from the beginning of Num1 to Num2 from the beginning.
example:
Shell >> Cat Example
Shell >> Cat Example
TEST2
this is test1
Shell >> Cut -c0-6 example ## print starts the first 6 words
TEST2
THIS I
Name: find
Usage: find
Instructions for use :
List of files that comply with Expression in the archive system. You can refer to the name, category,
The combination of different information such as time, size, permissions, only fully matched.
Find determines the Path and Expression in the command according to the following rules - (),!
The front part is path, after which is Expression. If PATH is a empty string, use the current path.
If Expression is the empty string, use -print as the preset expression
There are more than two or thirty options that can be used in Expression, which only introduces the most commonly used part.
-mount, -XDEV: Only check and specify files under the same archive system, avoid listing others
Archives in the archive system
-AMIN N: Readed in the past N minutes
-anewer file: Archives read later than files File
-Atime N: Files read in N days in the past
-cmin N: Modified in the past N minutes
-cnewer file: file updated than file file
-ctime N: Archives in the past N days
-ctime N: Archives in the past N days
-empty: Empty Archive - GID N or -Group Name: GID is n or the group name is
Name
-ipath p: -path p: The path name is compliant with the file, IPath will ignore the case
-Name Name, -iname name: The file name is compliant with the file. INAME will ignore cases
-Size N: The file size is n unit, b represents the block of 512-bit group, c represents the number of words, K
Represents Kilo Bytes, W is two bit yuan groups. -type C: The file type is C file.
D: Directory
C: Dictionary device file
B: Block device file
P: Total list
F: general file
l: Symbol connection
S: socket
-PID N: Process ID is the file
You can use () to separate the arithmetic, and use the following operations.
EXP1 -AND EXP2
! expr
-Not EXPR
EXP1 -OR EXP2
EXP1, EXP2
example:
List of all extended files in the current directory and its subdirectory is C.
List of all extended files in the current directory and its subdirectory is C.
# Find. -name "* .c"
List all the general files in their underlying directory
# Find. -ftype f
List all files updated in the current directory and its subdirectory
# Find. -ctime -20
Name: Less
Use permission: All users
Use mode:
Less [option] FileName
Description:
The role of Less is very similar to more, which can be used to browse the content of the text file.
LESS allows users to go back
To browse some parties that have been seen, because the Less did not read the entire file at the beginning,
When the opening of the large file is opened, it will be quickly than the general instrument editor (such as vi).
Example: Directive Name: ln
Use permission: All users
How to use: ln [options] Source Dist, where Option is:
[-BDFINSVF] [-S backup-suffix] [-V {numbered, existing, simple}]
[--help] [--version] [-]
Description: In the Linux / UNIX archive system, there is a so-called link, we can regard it as a file
The alias, and the link can be divided into two types: hard links and soft links (Symbolic Link),
The alias, and the link can be divided into two types: hard links and soft links (Symbolic Link),
Hard connection means that a file can have multiple names, while the soft connection is to produce a special
The file, the content of this file is to point to another file. Hard link is existing in the same archive system
And soft links can span different archives systems.
Ln Source Dist is a link (dist) to SOURCE, as for the use of hard links or softchain
Decided by the parameters.
Whether it is a hard link or soft link, it will copy the original file, and only very small amounts of disk.
space.
-f: When the link will delete the file with the DIST name -D: Allow system managers hard chain of themselves
Directory -i: Inquire about the file when deleting the file with the DIST name: When the soft connection is performed,
Dist is considered a general archive-S: Symbolic link -V: display it before connecting
Document -B: Backup will be backed up or deleted when the link is overlooked - S Suffix: files that will be backed up
Plus, the word tail - V Method: Specify how backup - HELP: Display auxiliary
Ming --Version: Display version
Example:
Generate a Symbolic Link: ZZ with the file yy
Ln -s yy zz
Generate a Hard Link: ZZ with the file yy
ln yy xx
Name: Locate
Use permission: All users
How to use: Locate [-q] [-d] [--Database =]
Locate [-r] [--Regexp =]
Locate [-r] [--Regexp =]
Locate [-qv] [-o] [--output =]
Locate [-e] [-f] <[- l] [-c]
<[- u] [-u]>
Locate [-VH] [--Version] [--help]
Description:
Locate allows users to quickly search for the specified file in the archive system. The method is to build first
Establish a database including all file names and paths in the system, after looking for this, just query this
The database does not have to actually go deep into the archive system.
In a general distribution, the establishment of the database is placed automatically in the contab. One
Used as long as used
# locate your_file_name
The model is OK. parameter:
-u
-U
Establish a database, -U will start by the root directory, and -U can specify the starting position.
-e
will
Exclude outside the range of findings.
-L
If it is 1. Start safe mode. In safe mode, the user will not see the file that cannot be seen.
case. This will slow down, because Locate must obtain the right to share the file in the actual archive system
material.
material.
-f
Except for a specific archive system, for example, we have not to put the files in the PROC archive system.
In the database.
-Q
Quiet mode does not display any error messages.
NN
At most displayed output.
-r
Use the regular operation to do the conditions for finding.
-o
Specifies the name of the information inventory.
-d
Specify the path to the database
-H
Display auxiliary message
-V
Show more messages
-V
Display program version message example:
LOCATE chDRV: Looking for all files called ChDRV
LOCATE-N 100 A.out: Look for all files called A.out, but only 100
Locate -u: Establish a database
Locate -u: Establish a database
Name: LS
Use permission: All users
How to use: ls [-ALRTAFR] [name ...]
Description: Displays the contents of the specified working directory (list the files and subdirectories included in the current working directory).
-a Displays all files and directories (LS instead of opening the archive name or directory name "." is considered hidden file.
Not listed)
-L In addition to the file name, the file type, authority, owner, and file size is also detailed.
-r Displays the file in the opposite order (originally in the order of English)
-t lists the priorities of the file according to the establishment time
-A, but not listed "." (Current directory) and ".." (parent directory)
-F adds a symbol after listed by the file name; for example, the executable is added "*", the directory is added "/"
-R If there is a file in the directory, the following files are also listed.
example:
List all the names in the current working directory, the beginning of the beginning, and the more advances are reached:
Ls -ltr S *
List all directories and file details below / bin directory:
Ls -lr / bin
List all files and directories in the current work directory; directory is added "/" after the name, after the file is executed
Add "*":
LS -AF
Name: more
Use permission: All users
Use permission: All users
How to use: more [-dlfpcsu] [-num] [ / pattern] [ linenum] [filenames ..]
Description: Similar to Cat, but will make the user's page-by-page reading at a page, and the most basic finger
The order is displayed in the next page to press the blank key (SPACE), press the B button to return (back) one page display
And there is also a function of searching strings (similar to VI), in use, press H.
Parameters: -num number displayed
-d Tips, display [Press Space to Continue, Q to Quit.], in the screen.
If the user presses the wrong button, [Press H for instructions.] Is displayed instead of beep.
-l cancels the function of meeting special character ^ l (paper feed characters)
When the number of lines of -F calculates, the number of rows after the actual line, not the number of rows after the automatic wrap (some single lines are too long
It will be expanded to two rows or more than two lines)
-p does not display each page in a rolling manner, but first cleared the screen and then display the content.
-C is similar to -p, different is to display content and then clear other old materials.
-S When you encounter a blank line with two consecutive lines, it is changed to the blank line of a line.
-u does not display the lower quotation marks (different depending on the termage specified by the environment variable TERM)
/ Search the string (Pattern) before each file is displayed, then start displaying from the string
NUM starts from the Normal line
Filenames wants to display the file file, which can be an example:
More -s testfile Displays the contents of TestFile, if there are two consecutive lines of blank lines
Displayed in a row of blank lines.
More 20 Testfile starts the contents of Testfile from the 20th line.
Name: MV
Use permission: All users
Use mode:
MV [Options] Source Dest
MV [Options] Source ... Directory
Description: Move a file to another, or move several files to another.
Parameters: -i If the destination already has the same name file, first ask if the old file is overwritten.
example:
Rename the file AAA as BBB:
MV AAA BBB
Move all C language programs to the finished subdirectory:
mv -i * .c
Name: RM
Use permission: All users
How to use: rm [options] name ...
Description: Delete files and directories.
Put on
-i before the deletion, please ask for confirmation one by one.
-f even if the original file property is set to read, it is also directly deleted without one by one.
-r Detects the directory and below.
example:
Delete all C language program files; ask one by one before deleting confirmation:
Rm -i * .c
Rm -i * .c
Delete all files in the Finished subdirectory and subdirectory:
RM -R finished
Name: RMDir
Use permissions: All users with appropriate permissions in current directory
How to use: rmdir [-p] DIRNAME
Description: Delete empty directories.
Parameters: -P is that when the subdirector is deleted, it will also be deleted by the way.
example:
Delete the subdirectory named AAA in the working directory:
RMDir AAA
In the BBB directory in the working directory, delete the subdirectory called TEST. BBB after Test delete
The directory is an empty directory, then BBB is also deleted.
RMDIR -P BBB / TEST
Name: split
Use permission: All users
How to use: split [option] [INPUT [prefix]]
Description:
Split a file into several files. The file from the Input is output into fixed-size files, and its file is in order
Prefixaa, Prefixab ...; prefix preset value `x. If there is no INPUT file or is `-, it is from
Standard input read data.
匡 兜
-b, --Bytes = Size
-b, --Bytes = Size
The size value is the size of each output file, and the unit is BYTE.
-C, --Line-bytes = size
In each output, the maximum number of BYTEs in a single line.
-L, --Lines = Number
The Number value is the size of the column size of each output.
-Number
The same as -l Number.
--Verbose
Print the detection information to standard error output before each output file is opened.
--help
Display auxiliary information and then leave.
--Version
Listed by this information and then leave.
Size can join the unit: b represents 512, K represents 1k, M represents 1 meg.
example:
Postgressql Large Data Library Backup and Recycling:
Because postgres allows the form to be larger capacity of your system file, you have to dump to a single
The file may have a problem, and the file segmentation is filed using Split. % PG_Dump DBNAME | SPLIT -B 1M - FileName.dump.
Reload
% CreatedB DBName
% cat filename.dump. * | PGSQL DBNAME
% cat filename.dump. * | PGSQL DBNAME
Name: Touch
Use permission: All users
Use mode:
Touch [-ACFM]
[-r reference-file] [--file = reason "File]
[-t mmddhhmm [[cc] yy] [. ss]]
[-d Time] [--DATE = TIME] [--Time = {Atime, Access, Use, Mtime, Modify}]
[--NO-CREATE] [--help] [--version]
File1 [file2 ...]
Description:
Touch command changes the time record of the file. LS -L can display the time record of the file.
parameter:
a Changing the read time record of the file.
m change the modification time record of the file.
C If the purpose file does not exist, it will not establish a new file. Like -No-Create.
F is not used, is to retain to compatibility with other UNIX systems.
r Use the reference file time record, like the effect of thefile.
D Setting time and date, you can use a variety of different formats.
T Time Record of the file is set, the format is the same as the DATE instruction.
--NO-CREATE does not establish a new file.
--Help lists the instruction format.
--Version lists this message.
--Version lists this message.
example:
The simplest way of use, change the file when you record the time. If the file does not exist, the system will
Establish a new file.
Touch file
TOUCH file1 file2
Change the time record of File to 18:3:39 on May 6, 2,000 years. Time format can
Refer to the DATE directive, at least you need to enter MMDDHHMM, which is the month and minutes.
Touch -c -t 05061803 file
Touch -c -t 050618032000 file
Change the File time record into ReferenceFile.
Touch -R ReferenceFile File
The time record of File is changed to 18:3:36 on May 6, two thousand years old. Time can be used
AM, PM or 24-hour format, date can be used in other formats such as 6 May 2000.
Touch -d "6:03 pm" file
Touch -d "05/06/2000" File
Touch -d "6:03 PM 05/06/2000" File
Name: AT
Use permission: All users
How to use: At -V [-q queue] [-f file] [-mldbv] Time
Explanation: AT allows users to specify certain programs or instructions at Time, TIME
The format is HH: mm in which HH is hour, MM is minutes, or even you can specify AM, PM,
Midnight, Noon, Teatime (is 4 pm).
Midnight, Noon, Teatime (is 4 pm).
If you want to specify the time within more than a day, you can use MMDDYY or MM / DD / YY format,
Medium MM is minutes, DD is the day, yy refers to the year. In addition, the user can even use it like
The NOW time interval is flexible specified time, where the time interval can be Minutes, Hours,
Days, weeks
In addition, the user can also specify Today or Tomorrow to represent today or tomorrow. When the time is specified
After pressing Enter, the AT will enter the conversation mode and ask for input instructions or programs. When you are input, press
CTRL D can complete all the actions, as for the result of the execution, will be sent back to your account.
Tie count:
-V: Print Publication No.
-q: Use the specified 伫 伫 (queue) to store, the data of the AT is stored in the so-called queue, making
Users can use multiple queue at the same time, while Queue's number A, B, C ... Z, and A, B,
... Z total 52
-m: If there is no output result after the program / instruction is executed, it is also necessary to send a letter to the user.
-f file: Read the pre-written command file. Users don't have to use the conversation mode to enter, you can
First write all the specified first to the file again, then read again
-l: List all specified (users can also use ATQ directly without AT -L)
-d: Delete design (can also use ATRM directly without AT -D)
-v: list all specified that has been completed but has not been deleted
Example:
5 pm after three days of execution / bin / ls:
AT 5PM 3 days / bin / ls
5 pm after three weeks of performed / bin / ls:
5 pm after three weeks of performed / bin / ls:
AT 5PM 2 Weeks / Bin / LS
Tomorrow's 17:20 execution / bin / date:
At 17:20 Tomorrow / BIN / DATE
The last day of 1999 printing the end of world!
At 23:59 12/31/1999 echo the end of world!
Name: CAL
Use permission: All users
How to use: CAL [-MJY] [MONTH [YEAR]]
Description:
Display calendar. If there is only one parameter, it represents the year (1-9999), showing the annual calendar. Must
All written: `` Cal 89 will not be the annual calendar showing 1989. Use two parameters, then the month
And year. If there is no parameter, this month's calendar is displayed.
September 3rd, on September 1752, a new calendar of Western calendar is used, and most of the countries will use the new calendar, there are 10
The sky is removed, so the monthly calendar of the month is different. It was before this.
匡 兜
-M: Displayed on weekdays for weekly first day.
-J: Displayed by Kaisa, that is, the number of days from January 1 is displayed.
-y: Show this year calendar.
example:
CAL: Shows the monthly calendar of this month.
[root @ mylinux / root] # Date
Tue aug 15 08:00:18 CST 2000
Tue aug 15 08:00:18 CST 2000
[root @ mylinux / root] # CAL
August 2000
Su Mo Tu We TH fr Sa
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
[root @ MYLINUX / root] #
CAL 2001: Shows the annual calendar of AD.
[root @ MYLINUX / ROOT] # CAL 2001
2001
January February March
Su Mo Tu We TH fr Su Mo Tu We TH fr sa
1 2 3 4 5 6 1 2 3 1 2 37 8 9 10 11 12 13 4 5 6 7 8 9 10 4 5 6 7 8 9 10
14 15 16 17 18 19 20 11 14 16 17 11 12 13 14 15 16 17
21 22 23 24 25 26 27 18 19 20 21 22 23 24 18 19 20 21 22 23 24
28 29 30 31 25 26 27 28 25 26 27 28 29 30 31
April May June
Su Mo Tu We TH fr Su Mo Tu We TH fr sa
1 2 3 4 5 6 7 1 2 3 4 5 1 2
1 2 3 4 5 6 7 1 2 3 4 5 1 2
8 9 10 11 12 13 14 6 7 8 9 10 11 12 3 4 5 6 7 8 9
15 16 17 18 19 20 21 14 15 16 17 18 19 10 11 12 13 14 15 16
22 23 24 25 26 27 28 20 21 22 23 24 25 26 17 18 19 20 21 22 23
29 30 27 28 29 30 31 24 25 26 27 28 29 30
July August September
Su Mo Tu We TH fr Su Mo Tu We TH fr sa
1 2 3 4 5 6 7 1 2 3 4 1
8 9 10 11 12 13 14 5 6 7 8 9 10 11 2 3 4 5 6 7 8
15 16 17 18 19 20 21 12 14 15 16 17 18 9 10 11 12 13 14 15
22 23 24 25 26 27 28 19 20 21 22 23 24 25 16 17 18 19 20 21 22
29 30 31 26 27 28 29 30 31 23 24 25 25 26 27 28 29
30
October November DecEmber
Su Mo Tu We TH fr Su Mo Tu We TH fr sa
1 2 3 4 5 6 1 2 3 1
7 8 9 10 11 12 13 4 5 6 7 8 9 10 2 3 4 5 6 7 8
14 15 16 17 18 19 20 13 14 16 17 9 10 11 12 13 14 15
21 22 23 24 25 25 26 27 18 19 20 21 22 23 24 16 17 18 19 20 21 22
28 29 30 31 25 26 27 28 29 30 23 24 25 26 27 28 29
30 31
[root @ MYLINUX / root] #
CAL 5 2001: Shows AD in May 2001.
CAL 5 2001: Shows AD in May 2001.
[root @ MYLINUX / ROOT] # CAL 5 2001
May 2001
Su Mo Tu We TH fr Sa
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
[root @ MYLINUX / root] #
Cal -m: The first day of week is the week, showing this month.
[root @ mylinux / root] # Cal -m
August 2000
Mo Tu We TH fr SU
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 2728 29 30 31
[root @ MYLINUX / root] #
Cal -jy: Displays the number of days from January 1st.
[root @ MYLINUX / ROOT] # Cal -jy
2000
2000
January February
Sun Mon Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat
1 32 33 34 35 36
2 3 4 5 6 7 8 37 38 39 40 41 42 43
9 10 11 12 13 14 15 44 45 46 47 48 49 50
16 17 18 19 20 21 22 51 52 53 54 55 56 57
23 24 25 26 27 28 29 58 59 60
30 31
March April
Sun Mon Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat
61 62 63 64 92
65 66 67 68 69 70 71 93 94 95 96 97 98 99
72 73 74 75 76 77 78 100 101 102 103 104 105 106
79 80 81 82 83 84 85 107 108 109 110 111 112 113
86 87 88 89 90 91 114 115 116 117 118 119 120
121
May June
Sun Mon Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat
122 123 124 125 126 127 153 154 155
128 129 134 131 132 133 134 156 157 158 159 160 161 162
135 136 137 138 139 140 141 163 164 165 166 167 168 169
142 143 144 145 146 147 148 170 171 172 173 174 175 176
142 143 144 145 146 147 148 170 171 172 173 174 175 176
149 150 151 152 177 178 179 180 181 182
July August
Sun Mon Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat
183 214 215 216 217 218
184 185 186 187 188 189 190 219 220 221 222 223 224 225
191 192 193 194 195 196 197 226 227 228 229 230 231 232
198 199 200 201 202 203 204 233 237 238 239
205 206 207 208 209 210 211 240 241 242 243 244
212 213
September October
Sun Mon Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat
245 246 275 276 277 278 279 280 281
247 248 249 250 251 252 253 282 283 284 285 286 287 288
254 255 256 257 258 259 260 289 290 291 292 293 294 295
261 262 263 264 265 266 267 296 297 298 299 300 301 302
268 269 270 271 272 273 274 303 304 305
November december
Sun Mon Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat306 307 308 309 336 337
310 311 312 313 314 315 316 338 339 340 341 342 343 344
317 318 319 320 321 322 323 345 346 347 348 349 350 351
324 325 326 327 328 329 330 352 353 354 355 356 357 358
324 325 326 327 328 329 330 352 353 354 355 356 357 358
331 332 333 334 335 359 360 361 362 363 364 365
366
Name: crontab
Use permission: All users
Use mode:
Crontab [-U user] filecrontab [-u user] {-l | -r | -e}
Description:
Crontab is used to make the user in the fixed time or fixed interval execution program, in other words,
It is a similar manner. -u user refers to setting the schedule of the specified user, this premise is you
There must be its permissions (such as ROOT) to specify the schedule of others. If you do not use -u
User, means it means setting your own schedule.
Number of meals:
-e: Execute a text editor to set a time program, the denoted text editor is VI, if you want to use another
The text editor, first set the Visual environment variable to specify that the text editor (for example,
SetENV Visual Joe)
-r: Delete the current schedule
-L: List the current schedule
The format of the schedule is as follows:
F1 F2 F3 F4 F5 Program
Where F1 is a minute, F2 represents hours, and F3 represents the day in one month, F4 represents the month
F5 means the first few days in the week. Program represents the program to be executed.
F5 means the first few days in the week. Program represents the program to be executed.
When F1 is *, it is indicated that the Program is executed every minute, and the f2 is * indicates that every hour is executed.
The rest of the formula
When F1 is A-B, it is to be executed from the first minutes to the first time, and F2 is a-b.
It is to be executed from paragraph A to B.
When F1 is * / N, it is performed once every N minute, and F2 is * / n to indicate each N hour.
Time interval is performed once, the rest
When F1 is A, B, C, ... indicated first, b, c, ... minutes to perform, F2 is A, B,
c, ... indicate paragraphs A, B, C ... to be executed hours, the rest
Users can also store all settings first in the file file, in the way of crontab file.
Set the time schedule.
Example:
Perform an hour per hour per hour / bin / ls:
0 7 * * * / bin / ls
In December, every time, 6:00 pm, every 20 minutes is executed once
/ usr / bin / backup:
0 6-12 / 3 * 12 * / usr / bin / backup
Monday to Friday, send a letter every day at 5:00 pm
Alex@domain.name:
0 17 * * 1-5 Mail -s "hi"
Alex@domain.name tmp / maildata
0:20 points per day, 2:20, 4:20, 4:20 .... Executive Echo "Haha"
20 0-23 / 2 * * * Echo "Haha" Note:
When executed in the time you specified, the system will send you a letter to you, show the content executed.
When executed in the time you specified, the system will send you a letter to you, show the content executed.
If you don't want to receive such a letter, please add> / dev / null 2> & 1 in every line of empty
I.e.
Name: Date
Use permission: All users
Use mode:
Date [-u] [-d datestr] [-s datestr] [--UTC] [--Universal]
[--DATE = DATESTR] [--SET = DATESTR] [--help] [--version] [ FORMAT]
[Mmddhhmm [[cc] yy] [. Ss]]
Description:
Date can be used to display or set the date and time of the system, in display, the user can set the desire
The format, format is set to a plus number, and the list of available tags is as follows:
Time:
%: Print%
% N: Next line
% T: jumping
% H: Hours (00....
% I: Hours (01..12)
% K: Hours (0..23)
% L: Hours (1..12)
% M: Minutes (00..59)
% P: Display Local AM or PM
% R: Direct display time (12 hours, format HH: mm: ss [ap] m)
% R: Direct display time (12 hours, format HH: mm: ss [ap] M)
% S: From January 1, 1970 00:00 UTC to the number of seconds
% S: second (@ 10)
% T: Direct display time (24-hour system)
% X: equivalent to% h:% m:% s
% Z: Show time zone
Date:
% A: Sun..sat
% A: Sunday..SATURDAY
% B: Month (Jan..dec)
% B: January..DECEMBER
% C: Direct display date and time
% D: Japan (01..31)
% D: Direct Display Date (mm / DD / YY)
% H: same% B
% J: The first day of the year (001..366)
% M: Month (01..12)
% U: The first day of the year (00..53) (the first day of Sunday is one week)
% W: The first day of the week (0..6)
% W: The first day of the year (00..53) (in the first day of Monday)
% x: Direct display Date (mm / dd / yy)
% Y: The last two digits of the year (00.99)
% Y: Complete Year (0000..9999)
% Y: Complete Year (0000..9999)
If it does not start with the plus sign, it means to set the time, and the time format is
MMDDHMM [[cc] yy] [. SS], where mm is month, DD is the day, HH is hour, mm is minutes
, CC is the first two digits of the year, YY is two digits after the year, SS is the number of seconds.
Tie count:
-d DateStr: Displays the time set in DateStr (non-system time)
--help: Display auxiliary message
-s datestr: Set the time set to the time set in DateStr
-u: Show current Greenwich Time
--Version: Display version number
Example:
During the display time, the time is jumped, then display the current date:
Date % T% N% D
Display months and days:
Date % B% D
Display date and set time (12:34:56):
Date --Date 12:34:56
Note:
When you don't want to have meaningless 0 (for example, 1999/03/07), you can insert - symbols in the mark, such as Date % - H:% - M:% - S will not be in seconds The meaning of the meaning of the meaning, like the original
08:09:04 will change to 8: 9: 4. In addition, only the permissions (such as root) can set the system
between.
When you change the system time with the root identity, please write the system time to write system time in clock -w.
When you change the system time with the root identity, please write the system time to write system time in clock -w.
In CMOS, the system time will continue to hold the latest correct value when it is rebooted next time.
Name: SLEEP
Use permission: All users
How to use: Sleep [--help] [--version] Number [SMHD]
Description: Sleep can be used to delay the current action for a while
Parameter Description :
--help: Display auxiliary message
--Version: Display version number
Number: Time length, back can be connected to S, M, H or D
Where S is second, m is minutes, H is hour, D is the number of days
Example:
Shows the current time after 1 minute, then display time again:
Date; Sleep 1M; Date
Name: Time
Use permission: All users
How to use: Time [Options] Command [arguments]
Description: The purpose of the TIME instruction is the time and system resources required to measure the time consumption of the specific instruction.
Waiting for information. For example, CPU time, memory, input and the like, and the like. It is necessary to pay special attention to some information
It doesn't display it on Linux. This is because some resource allocation in Linux and Time finger
The preset method is not the same, so that the TIME instruction cannot be obtained.
Put on
-o or --Output = file
-o or --Output = file
Set the result output file. This option writes the output of the Time to the specified file. If the file has been
The system will override its content.
-a or --append
With -O use, the result will be written to the end of the file without overwriting the original content.
-f format or - format = format
Set the display mode with the Format string. When this option is not set, the system is preset.
format. However, you can use the environment variable Time to set this format, so you don't have to log in every time you log in.
The system must be set once.
Generally set, you can use
t
Indicates the jump, or use
n
Reverse the wrap. Each material uses% as a preamble. If you want to use a percentage symbol in the string, use
. (People who have learned C language will feel very familiar)
There are four major items that the TIME instructions can display, namely:
Time Resources
Memory Resources
IO Resources
Command info
The detailed content is as follows:
Time Resources
E Execute the time spent, the format is: [Hour]: minute: second. Please pay attention to this number and
E Execute the time spent, the format is: [Hour]: minute: second. Please pay attention to this number and
Does not represent the actual CPU time.
e Execute the time spending the instruction, the unit is second. Please note that this number does not mean the actual CPU time.
.
The time spent on the core mode during the execution of the S command is seconds.
U The time spent in the user mode during execution, the unit is second. P Execute the occupation ratio of the CPU when the command is executed. In fact, this number is the core model plus the user mode.
The CPU time is divided by total time.
Memory Resources
M The maximum value of the entity memory occupied during execution. Unit is KB
T execute the average value of the entity memory occupied, the unit is KB
K The total amount of memory (Stack Data Text) occupied by the K executive program is KB.
D Executive Program The average size of the unshared data area, the unit is KB
P Execute the average size of the unshared stack, the unit is KB
X The average of the shared text is executed, and the unit is KB
The size of the Z system memory page is byte. This is a constant for the same system.
IO Resources
F This program's main memory page error occurrence number. The so-called major memory page error refers to a memory
The body page has been replaced into the SWAP file and has been assigned to other programs. This page
The content must be read again from the replacement.
R The number of times the secondary memory page of this program is incorrect. The so-called secondary memory page error refers to a memory
Although the body page has been replaced into the replacement file, it has not been assigned to other programs. The content of this page is not
Destruction, do not have to read from the replacement
Destruction, do not have to read from the replacement
W This program is swapped to the number of replacement files
C This program is forced to interrupt (like the distributed CPU time is exhausted)
W This program voluntarily disrupts (like a one waiting for an I / O execution, like a disk read, etc.)
number
I number of files entered by this program
O number of files outputted by this program
r Socket Message received by this program
s Socket Message sent by this procedure
K This program received by the signal (Signal)
Command info
C Execution parameters and instruction name
X command end code (exit status)
-p or --portability
This option will automatically set the display format as:
Real% e
User% u
SYS% S
The purpose of this is to compat with the POSIX specifications.
-v or --verbose
This option will list all the resources used in all programs, not only in general English statements, but also
Bright. People who don't want to spend time to set or just start to contact this instruction is quite useful.
example:
example:
Use the following instructions
Time -V PS -AUX
We can get the results of PS -AUX and the system resources taken. As listed below:
User PID% CPU% MEM VSZ RSS TTY Stat Start Time Command
Root 1 0.0 0.4 1096 472? s APR19 0:04 Init
Root 2 0.0 0.0 0 0? SW APR19 0:00 [KFlushd]
Root 3 0.0 0.0 0 0? SW APR19 0:00 [KPIOD]
......
Root 24269 0.0 1.0 2692 996 PTS / 3 r 12:16 0:00 ps -aux
Command being timed: "ps -aux"
User Time (Seconds): 0.05
System Time (Seconds): 0.06
Percent of CPU this Job Got: 68%
Elapsed (Wall Clock) Time (H: MM: SS OR M: SS): 0: 00.16Average Shared Text Size (KBYTES): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average Total Size (KBYTES): 0
Maximum Resident Set Size (KBYTES): 0
Average Resident Set size (kbytes): 0
Major (Requiring I / O) Page Faults: 238
Minor (Reclaiming A Frame) Page Faults: 46
Minor (Reclaiming A Frame) Page Faults: 46
Voluntary Context Switches: 0
Involuntary Context Switches: 0
SWAPS: 0
FILE SYSTEM INPUTS: 0
File System Outputs: 0
Socket Messages SENT: 0
Socket Messages Received: 0
Signals Delivered: 0
Page Size (bytes): 4096
EXIT STATUS: 0
Name: uptime
Use permission: All users
How to use: uptime [-v]
Description: Uptime provides the following information, no other parameters:
Current time
The system is turned on to the time
The number of users connected
Recently, five minutes and fifteen minutes of system load
Parameters: -v Displays version information.
Example: uptime
The result is:
10:41 AM UP 5 Days, 10 min, 1 Users, Load Average: 0.00, 0.00, 1.99
10:41 AM UP 5 Days, 10 min, 1 Users, Load Average: 0.00, 0.00, 1.99
Name: CHFN
Use permission: All users
Usage: shell >> CHFN
Description: Provide users to change individual information for Finger and Mail Uname
example:
Shell >> CHFN
Changing Finger Information for User
Password: [DEL]
Name []: johnney huang ### provides information when providing finger
Office []: NCCU
Office phone []: [DEL]
Home phone []: [DEL]
Name: chsh
Use permission: All users
Usage: shell >> Chsh
Description: Change the user shell setting
example:
Shell >> Chsh
Changing Fihanging Shell for User1
Password: [DEL]
New shell [/ bin / tcsh]: ### [is currently used by Shell]
[DEL]
[DEL]
Shell >> Chsh -l ### 展 / / etc / shells archive content
/ BIN / BASH
/ bin / sh
/ BIN / ASH
/ bin / bsh
/ bin / tcsh
/ bin / csh
Name: finger
Use permission: All users
How to use: finger [Options] user [@address]
Note: Finger allows the user to query some other user's information. The information will be listed is: login name
User name
Home Directory
Shell
Login Status
Mail status
.plan
.project
.forward
Where. PLAN, .Project and .Forward are the user in his Home Directory
Where. PLAN, .Project and .Forward are the user in his Home Directory
Information in .PLAN, .Project and .Forward and other files. If there is no. Finger finger
Order is not limited to queries on the same server or look for users on a remote server.
Just give an address like an e-mail address.
Put on
-L
Multi-line display.
-S
Single line display. This option only displays the login name, real name, terminal name, idle time, login
Time, office number and phone number. If the user is inquiry is the user of the remote server, this
An option is invalid.
Example: The following instructions can check the information of this machine:
Finger root
The results are as follows:
Login: root name: root
Directory: / root shell: / bin / bash
NEVER Logged IN.
No Mail.
NO PLAN.
Name: Last
Use permission: All users
How to use: shell >> Last [Options]
Explanation: The display system has been a message from the beginning of the month.
Explanation: The display system has been a message from the beginning of the month.
Put on
-R 省 Hostname's field
-Num show before NUM
UNAME Display Uname login message
TTY restriction login message contains terminal code
example:
Shell >> Last -R-2
Johnney PTS / 1 MON AUG 14 20:42 STILL Logged in
Johnney PTS / 0 MON AUG 14 19:59 Still Logged in
WTMP Begins Tue Aug 1 09:01:10 2000 ### / var / log / wtmp
Shell >> Last -2 Minery
Minery PTS / 0 140.119.217.115 MON AUG 14 18:37 - 18:40 (00:03)
Minery PTS / 0 140.119.217.115 Mon Aug 14 17:22 - 17:24 (00:02)
WTMP Begins Tue Aug 1 09:01:10 2000
Name: login
This order will not be done! Oh, I am not here, I have a push ink to delay everyone's beautiful youth ^ _ ^
Name: Passwd
Use permission: All users
How to use: Passwd [-k] [-l] [-u [-f]] [-d] [-s] [username]
Description: Used to change the password of the user
parameter:
parameter:
-k
-L
-u
-f
-d Turn off the user's password authentication function, the user will not need to enter a password during login, only
The user of root privileges can be used.
-S Displays the specified user's password authentication species, only the user who has root privileges can be used.
[username] Specifies the account name.
Name: WHO
Use power line: All users can use
How to use: WHO - [husfv] [user]
Note: There are those users in the display system being on, and the data displayed contains the user ID, the terminal used, connected from there, online time, lag time, CPU usage, action, etc.
Tie count:
-h: Do not display the title column
-u: Do not display user action / work
-s: Show with short format
-f: Do not display the user's online location
-V: display program version
Name: / etc / aliases
Use permission: System managers
How to use: please update your database with newaliases
Description:
Sendmail uses an action that is converted by the user name in / etc / aliases. when
Sendmail receives a letter to XXX, it will be given to another according to the content of the AliaSes file.
user. This feature creates a user who is only valid in the letters system. E.g
Mailing List uses this feature, in MailingList, we may create a call
Redlinux@link.ecE.uci.edu's mailingList, but actually doesn't call
REDLINUX users. The actual AliaSS file is to give the letter to this user.
The Mailing List process is responsible for the job.
/ etc / aliases is a text mode file, Sendmail needs a binary format
/etc/aliases.db. NEWALIASES's functionality is to convert / etc / aliases into one
SENDMAIL can understand the database. example:
# newaliases
The following command will do the same thing.
# sendmail -bi
Related commands:
Mail, Mailq, Newaliases, Sendmail
Name: Mail
Use permission: All users
How to use: mail [-iinv] [-s Subject] [-C cc-addr] [-b bcc-addr] user1
User 2 ...]
Description:
Description:
Mail is just a directive, Mail is also an email program, but use mail to read the letter.
People should be very few! For system managers, Mail is useful because managers can use
Mail writes Script, regularly sending some memorandum of memo reminding the system.
parameter:
i ignore the interrupt signal of TTY. (Interrupt)
I forced set into interactive mode. (Interactive)
v prints the message, such as the location of the send letter, state, and the like. (Verbose)
n Do not read the mail.rc setting file.
S Mail title.
C CC mail address.
B BCC email address.
example:
Get the letters to one or more email addresses, because there is no other options, users must
Enter the title and the contents of the letter, etc. User2 does not have a host location, it will be given to the mail server.
User2 user.
User1@emil.address
User1@email.address user2
Sending the content of mail.txt to user2 simultaneously CC to USER1. If this line of instructions are set
Cronjob can send a memorandum to the system.
Mail -s Title - C User1 USER2 Directive: MESG Use permission: All users Use permission: All users How to use: MESG [y | n] Explanation: Decide if other people are allowed to pass on their own terminal Put on Y: Allow messages to the terminal interface. n: Do not allow messages to the terminal interface. If there is no setting, the message delivery is fixed by the terminal interface. Example: Changing the current message settings, modification is not allowed to pass on the terminal interface: MESG N Directives related to MESG are: Talk, Write, Wall. Name: Talk Use permission: All users Use mode: Talk Person [TTYNAME] Description: Talk to other users Tie count: Person: Prepare the user account of the intercom, if the user is on other machines, you can enter Person@machine.name TTYNAME: If the user has more than two TTY connectors, you can choose the right TTY. Message Example. 1: Talking to the user rolland on the machine now, and Rolland has only one connection: Talk Rolland Next, wait for the RollaEnd response, if rollaend accepts, rollaend enters the `Talk Jzlee` Next, wait for the RollaEnd response, if rollaend accepts, rollaend enters the `Talk Jzlee` You can start talking, please press CTRL C Example. 2: Talk to the user rolland on Linuxfab.cx, use PTS / 2 to talk: Talk RollaEnd@linuxfab.cx PTS / 2 The next step is to respond, if rollaend is accepted, Rollaend Enter the `Talk Jzlee @ Jzlee.home`, you can start talking, please press Ctrl C Note: If the word of the screen will appear abnormal characters, try to update the screen picture in Ctrl L. Name: Wall Use permission: All users Use mode: Wall [Message] Instructions for use: Wall transmits the message to each MESG to be set to YES. When using terminal interface When it is incorporated, add EOF (usually using Ctrl D). Example: Communication "hi" gives each user: Wall Hi Name: Write Use permission: All users Use mode: Write user [TTYNAME] Description: Communication to other users Tie count: Tie count: User: User account for preparing message TTYNAME: If the user has more than two TTY connectors, you can choose the right TTY. Message Example. 1: The news is given to Rolland, and the Rolland has only one connection: Write rolland The next is to hit the message, please press CTRL C. Example .2: Communication to Rolland, rolland's connection with PTS / 2, PTS / 3: Write RollaEnd PTS / 2 The next is to hit the message, please press CTRL C. Note: If the other party sets MESG N, the interpretation will not pass to the other party. Name: kill Use permission: All users Use mode: Kill [-siGnal | -p] [-a] PID ... Kill -l [Signal] Description: KILL sends a specific signal (Signal) to the stroke ID is the stroke of the PID according to the letter Number and do specific actions, if there is no specified, the preset is a signal to be terminated (TERM) Put on -S (Signal): Among them, the signals are HUP (1), KILL (9), TERM (15), which represents heavy run, cut off, end; detailed signals can be used with kill -l -p: Print PID, does not send the signal -p: Print PID, does not send the signal -L (Signal): List all available signal names example: Cut the PID 323 stroke (kill): KILL-9 323 Running the PID 456 (Restart): Kill-Hup 456 Name: Nice Use permission: All users How to use: nice [-n adjustment] [-adjustment] [--adjustment = adjustment] [--help] [--version] [Command [arg ...]]] Description: Execute the program with a changed priority, if not specified, the current scheduling is printed Supreme, the internal Adjustment is 10, the range is -20 (highest priority) to 19 (minimum preferred sequence) Put on -n adjustment, -adjustment, --adjustment = adjustment is all of the original priority Add Adjustment --help display help message --Version Display Version Information example: Put the priority of the LS 1 and execute: Nice -n 1 ls Add 10 priority to 10 and execute: Add 10 priority to 10 and execute: Nice LS adds the priority of the LS 10 and execute Note: Priority is used to determine the parameters assigned by the CPU, Linux is used. "Round-Robin" algorithm is used to do CPU schedule, the higher the priority, and it may be obtained. The more CPU time. Name: PS Use permission: All users How to use: ps [options] [--help] Description: Show the dynamics of the moment parameter: There are a lot of PS parameters, and only several common parameters are listed here and -A lists all itinerary -W Display widened can display more information -au shows more detailed information -AUX shows all strokes that contain other users Au (x) output format: User PID% CPU% MEM VSZ RSS TTY Stat Start Time Command User: Tour owner PID: PID % CPU: Used CPU usage % MEM: Occupation Memory Use VSZ: The size of the virtual memory occupied RSS: The size of the memory RSS: The size of the memory TTY: The secondary device number of the terminal (Minor Device Number Of TTY) Stat: The status of this trip: D: I / O action in uninterrupted still (通 □ □ 缜 B) R: is being executed S: Static state T: Pause Z: No existence but temporarily unable to eliminate W: There is not enough memory paging to allocate N: low priority stroke L: There is a memory paging assignment and lock in memory (instant system or A I / O) START: Time of the trip Time: Time to do Command: Directive executed example: PS PID TTY TIME CMD 2791 TTYP0 00:00:00 TCSH 3092 TTYP0 00:00:00 PS % PS -A PID TTY TIME CMD 1? 00:00:03 init 2? 00:00:00 Kflushd 2? 00:00:00 Kflushd 3? 00:00:00 Kpiod 4? 00:00:00 Kswapd 5? 00:00:00 MDRECoveryd .......% ps -aux User PID% CPU% MEM VSZ RSS TTY Stat Start Time Command Root 1 0.0 0.7 1096 472? S Sep10 0:03 init [3] Root 2 0.0 0.0 0 0? SW SEP10 0:00 [KFLUSHD] Root 3 0.0 0.0 0 0? SW SEP10 0:00 [KPIOD] Root 4 0.0 0.0 0 0? SW SEP10 0:00 [KSWAPD] ........ Name: PStree Use permission: All users Use mode: PStree [-a] [-c] [-h | -hpid] [-l] [-n] [-p] [-u] [-g | -u] [pid | user] PStree -V Description: Display all itiners in a tree diagram, the tree map will be pid (if there is specified) or INIT This basic stroke is root (root), if there is a specified user ID, the tree map will only display the The trip owned by the user parameter: -a Displays the full instructions and parameters of the itinerary, if it is replaced by the memory body, add parentheses -c If there is a rebounded stroke name, it is listed separately (the preset value will be added in front * -c If there is a rebounded stroke name, it is listed separately (the preset value will be added in front * example: PStree INIT - - AMD | -apmd | -ATD | -httpd --- 10 * [httpd] % PStree -P INIT (1) - - AMD (447) | -apmd (105) | -ATD (339) % PStree -C INIT - - AMD | -apmd | -ATD | -HTTPD - - HTTPD | | | -HTTPD | | | -HTTPD | | | -HTTPD .... Name: renice Use permission: All users How to use: renice priority [[-p] pid ...] [[-g] pgrp ...] [[-U] user How to use: renice priority [[-p] pid ...] [[-g] pgrp ...] [[-U] user ...]]]] Explanation: Re-specify the priority of one or more strokes (one or more will be based on the next Number Put on -p PID re-specifies the priority of the Id of the stroke to PID -g PGRP Re-specifies the id for the stroke group (one or more Priority -u User re-specifies priority for the stroke owner for the User example: The stroke ID is 987 and 32 stroke and the priority number of the trip owner for Daemon and root plus 1 : RENICE 1 987 -U daemon root -p 32 Note: Each trorate has a unique ID Name: TOP Use permission: All users How to use: TOP [-] [D DELAY] [q] [c] [s] [s] [i] [n] [b] Explanation: Display Process dynamics instantly Put on D: Change the displayed update speed, or press S in the Trolver Command Column (Interactive Command) Q: There is no delayed display speed. If the user is the sufficiency of SuperUser, the TOP will Will be implemented in the highest priority C: Switch the display mode, there are two modes, one is only the name of the execution file, the other is to C: Switch the display mode, there are two modes, one is only the name of the execution file, the other is to display the complete path and the name S: accumulation mode, the subunion that will be completed or disappeared (Dead Child Process) CPU Time accumulated S: Safety mode, cancel the conversation instruction, avoid potential crisis i: No idle (IDLE) or useless (Zombie) stroke N: Update the number of times, will exit TOP after completion B: Batch file mode, use "N" parameters together, can be used to output the results of TOP to the file Inside example: Show out ten times after ten times; TOP-N 10 The user will not use the conversation instruction to the stroke command: Top -s Enter the update display twice into the file name to top.log: TOP-N 2 -B Name: Skill Use permission: All users How to use: skill [signal to send] [options] Select the rules of the program Description: Send a signal to the executable program, the preset message is Term (interrupt), the more common information is HUP, INT, KILL, STOP, CONT, and 0 Information has three ways: -9, -sigkill, -kill, can be listed using -l or -l Available messages. Available messages. General parameters: -f fast mode / has not been completed -i interactive mode / each action will be confirmed -V Detailed output / list of selected programs -w Intelligent warning message / has not been completed -n no action / display program code Parameters: The rules of the selection can be that the terminal code, the user name, the program code, the command name. -T Terminal Code (TTY or PTY) -u user name -P program code (PID) -c Command Name You can use the signal: The known signal name, signal code, and function will be listed below. Name (code) function / description ALRM 14 leaves HUP 1 leave INT 2 leave Kill 9 leaves / forced close PIPE 13 leaves Poll leaves PROF leave Term 15 leaves USR1 leaves USR1 leaves USR2 leaves VTALRM leaves STKFLT leaves / only for I386, M68K, ARM, and PPC hardware Unused leaves / only for I386, M68K, ARM, and PPC hardware TSTP stop / generate behavior related to content TTIN stop / generate behavior related to content Ttou stop / generate behavior related to content STOP stop / forced shutdown CONT From the new start / if the stop state is started, otherwise ignore PWR ignores / leave in some systems Winch ignores CHLD ignores ABRT 6 core FPE 8 core Ill 4 core Quit 3 core SEGV 11 core TRAP 5 core SYS core / perhaps no actual EMT core / perhaps no actual BUS core / core failure XCPU core / core failure XCPU core / core failure XFSZ core / core failure example: Stop all programs on the PTY device Skill -kill -v PTS / * Stop three users USER1, USER2, USER3 Skill -stop User1 User2 USER3 Other related commands: kill Name: EXPR Use permission: All users ### String length Shell >> EXPR Length "this is a test" 14 ### Digital Commercial Number Shell >> EXPR 14% 9 5 ### From the location Shell >> Expr Substr "This Is A Test" 3 5is IS ### Digital Skewers Only The First Character Shell >> Expr Index "Testforthegame" e 2 ### String truly reproduced ### String truly reproduced Shell >> EXPR Quote THISATSTFORMELA ThisisatestFormela Name: TR ### 1. Compare to the part to change all uppercase files in the directory to lowercase files? There seems to be many ways, "TR" is one of them: #! / bin / sh DIR = "/ tmp / testdir"; Files = `Find $ DIR -TYPE F`; For i in $ files DO Dir_name = `Dirname $ I`; Ori_filename = `basename $ I` New_filename = `Echo $ Ori_FileName | TR [: Upper:] [: Lower:]`> / dev / null; #echo $ new_filename; MV $ DIR_NAME / $ Ori_FileName $ DIR_NAME / $ New_FILENAME DONE ### 2. ourselves ... LowerCase to Uppercase Tr Abcdef ... [del] Abcde ... [DEL] TR A-Z A-Z Tr [: Lower:] [: Upper:] Shell >> Echo "this is a test" | TR A-Z A-Z> WWW Shell >> Echo "this is a test" | TR A-Z A-Z> WWW Shell >> Cat WWW This is a test ### 3. Remove the string of unwanted Shell >> Tr -d this ### Remove about T.E.S.T THIS MAN MAN Test e ### 4. Replace strings Shell >> Tr -s "this" "test" THIS Test TH TE Directive: CLEAR Uses: Clear the screen. How to use: Enter clear on Console. Name: Reset, Tset How to use: tset [-iqqrs] [-] [-e ch] [-i ch] [-k ch] [-M mapping] [Terminal] Instructions for use: Instructions for use: Reset actually and tset is a command that is the purpose of setting the terminal. In general, This command automatically determines the current terminal of the current terminal from the environment variable, command column, or other configuration gear. . If the specified type is?, This program will ask the user to enter the terms of the terminal. Since this program sets back the terminal back to the original state, in addition to the use of login, when the system terminal Because the program is not properly implemented, you can also use it to reset the terminal O For example, if you accidentally use the CAT directive to the terminal, there is often a terminal that does not respond to the keyboard input. Or respond to some strange characters. You can reply to the original state with RESET. . Option Description: -p Display the terminal category on the screen, but do not make the set action. This command can be used to achieve the current final Terminal of the terminal. -e ch Set the ERASE unit into CH -i ch Set the interrupt character to CH -k ch Will delete a line of characters set to Ch -I Don't do settings, if you don't use the option -Q, the current value of Erase, interrupts and delete characters will still be sent to the screen. -Q Do not display ERASE, interrupt and delete the value of the character to the screen. Do not display ERASE, interrupt and delete the value of the character to the screen. -r Print the terminal machine class on the screen. -S Send the type of command to the setting TERM to the terminal, usually in .login or .profile example: Let the user enter a terminal model and set the terminal to the type other preset state. # RESET? Set the ERASE character set Control-h # RESET -E ^ B Display the string of the setting on the screen # reset -s ERASE IS Control-B (^ b). Kill IS Control-U (^ U). Interrupt IS Control-C (^ c). Term = xterm; Name: Compress Use permission: All users How to use: Compress [-dfvcv] [-B Maxbits] [file ...] Description: Compress is a fairly ancient UNIX file compression instruction, and the compressed file will add one .z The extended file is distinguished from uncompressed files, and the compressed file can be decompressed in uncompress. To be The extended file is distinguished from uncompressed files, and the compressed file can be decompressed in uncompress. To be A plurality of files are pressed into a compressed file, and the file TAR must be compressed first. Because Gzip can produce More ideal compression ratio, the general people have changed with Gzip to compress tools. parameter: C Output results to standard output equipment (general refers to the screen) F forced writing to the file, if the destination already exists, it will be overwritten (Force) v The message executed by the program on the screen (Verbose) b Set the upper limit of the number of common strings, calculate with bit yuan, can set the value of 9 to 16 bits. due to The greater the value, the more common strings that can be used, the larger the compression ratio, so the preset value is generally used. BITS (BITS) D decompress the compressed file V list publication message example: Complicate Source.dat into Source.dat.z, if Source.dat.z already exists, content will Covered by the compressed file. Compress -f Source.dat Complicate Source.dat into source.dat.z and prints the compression ratio. -V and -f can be used together Compress -VF Source.dat When the compressed data is output, import Target.dat.z can change the compressed file name. Compress -c Source.dat> Target.dat.z The larger the value of -b, the larger the compression ratio, the range is 9-16, and the preset value is 16. Compress -b 12 Source.dat Compress -b 12 Source.dat Unfolding Source.dat.z into Source.dat. If the file already exists, the user presses Y to determine the cover. Cover files, if you use the -DF, you will automatically cover your files. Since the system will automatically join .Z is extended Name, so Source.dat will automatically be treated as Source.Dat.z. Compress -d Source.dat Compress -d source.dat.z Name: LPD Use permission: All users How to use: LPD [-l] [#port] LPD is a resident printing machine management, which manages local or distal printers based on / etc / printcap content. / ETC / PRINTCAP defined in each printing machine must be in / var / lpd A corresponding directory, the directory in the directory indicates a print waiting to be sent to the appropriate device. jobs. This file is usually generated by the LPR. LPR and LPD constitute a system that can work offline, when you use LPR, the printer does not need Can be used immediately, or even exist. LPD will automatically monitor the situation of the printing machine, when the press is online, The file will be sent immediately. This has to wait for the previous work to complete the previous job. parameter: -l: Display some of the unlocked messages on the standard output. #port: In general, LPD will use GetServbyName to get the appropriate TCP / IP Port, you can Use this parameter to force LPD to use the specified port. example: This program is usually performed at the beginning of the system from the program in /etc/rc.d. Name LPQ - Display the work usage of unfinished lists in the listing machine LPQ [L] [P] [User] Description LPQ displays items that are not completed in the list of lists managed by the LPD. example Example 1. Display all work in the LP list machine # lpq -pljprank Owner Job Files Total Size1st Root 238 (Standard Input) 1428646 BYTES related functions LPR, LPC, LPD Name: LPR Use permission: All users How to use: lpr [-pprinter] Send the file or sent by the standard input to the printing machine, the printing machine management program LPD This file will be given to the appropriate program or device processing later. LPR can be used to give the material to the local Or the remote host is handled. parameter: -pprinter: Send the data to the specified printer Printer, the preset value is LP. example: Send www.c and kkk.c to the printing machine LP. lpr-plp www.c kkk.c Name: lprm Name: lprm - Remove the usage by a work by the print machine / usr / bin / lprm [p] [file ...] Description The work that has not yet been completed will be placed in the printing machine, which will often be delivered to the print. The work of the table is canceled. Since each printer has a separate storage, you can use -P this life Set the printed machine you want to function. If there is no setting, the system preset press will be used. This command will check if the user has enough permissions to delete the specified file, in general, only files The owner or the system administrator has this permission. example Remove Work in the printing machine HPPrinter Lprm -Phpprinter 1123 Working No. 1011 is removed from the preset printing machine LPRM 1011 Name: fdformat Use permission: All users How to use: fdformat [-n] Device Instructions for use : Low-order formatting for the specified soft disc device. When using this instruction to format the floppy disk, it is best The specified image is the device: / dev / fd0d360 disk machine A:, magnetic 360KB disk / DEV / FD0H1440 disk machine A:, magnetic disk is 1.4MB disk / DEV / FD1H1200 disk machine B:, magnetic disk is 1.2MB disk / DEV / FD1H1200 disk machine B:, magnetic disk is 1.2MB disk If you use a device like / dev / fd0, if the disk inside is not a standard capacity, formatting may fail. In this case, the user can specify the necessary parameters first with the setFDPRM instruction. parameter: -N Close the confirmation function. This option closes the formatted confirmation step. example: FDFORMAT-N / DEV / FD0H1440 Format the magnetic disk of the disk machine A into a 1.4MB magnetic sheet. And the confirmation step is omitted. Name: MFormat Use permission: All users Use mode: MFORMAT [-T cylinders] [-h heads] [-s sectors] [-l volume_label] [-f] [-I fsver-sion] [-s syzecode] [-2 Sectors_ON_TRACK_0] [-M Software_sector_size] [-a] [-X] [-C] [-H Hidden_sectors] [-r Root_sectors] [-B boot_sector] [-0 rate_on_track_0] [-A Rate_on_other_tracks] [-1] [-k] Drive: The DOS archive system is established on a magnetic sheet that has been made in low-order formatting. If you compile MTOOLS Open the parameters of USE_2M, and the part is related to the parameters of the 2M format. Otherwise these participation Number (like S, 2, 1, m) does not act. parameter: -T magnetic column (Synlider) -H head (HEAD) -S number of magnetic regions per magnetic -S number of magnetic regions per magnetic -l tag -F The formatted magnetic disc is formatted to FAT32, but this parameter is still in the experiment. -I Sets the version number in the FAT32. This is of course still in the experiment. -S magnetic area size code, calculation mode for sector = 2 ^ (size code 7) -C Magnetic bush (Cluster) of the magnetic area. If the given number can cause the number of magnets that exceed the limit of the FAT table MFORMAT automatically enlays the number of magnetic regions. -S -M Software magnetic area size. This number is the magnetic area size returned by the system. Usually the same as the actual size . -A If this parameter is added, MFormat generates a set of ATARI systems to this soft disc. -X Format the flop to XDF format. Before use, you must use the XDFCOPY instruction to make a low-order format. The actions. -C Generates a disk image file (Disk Image) that can be installed with MS-DOS archive system. Of course This parameter is meaningless under an entity disk machine. -H hidden the number of magnetic regions. This is usually suitable for a split area that formats the hard drive because of a split area. The front also has a division table. This parameter is not tested, it can not be used. -N disk serial number The size of the -R root directory, the unit is the number of magnetic regions. This parameter is only valid for FAT12 and FAT16. -B uses the specified file or the power-on magnetic area of the device as the boot magnetic area of this flap or division area. when However, the hardware parameters in it will move. -k Try to maintain the original boot magnetic area. -0 Data transfer rate of the 0th rail -0 Data transfer rate of the 0th rail -A Data transfer rate outside the track -2 use 2M format -1 Do not use 2M format example: MFORMAT A: This will use the preset value to format the disk in A: (already / DEV / FD0). s Name: MKDOSFS Use permission: All users How to use: MKDOSFS [-C | -L filename] [-f number_of_fats] [-F fat_size] [-i volume_id] [-M message_file] [-n volume_name] [-r root_dir_entry?] [-s sector_per_cluster] [-v] DEVICE [block_count] Description: Establish a DOS archive system. Device means that you want to establish a device code for a DOS archive system. Like / dev / hda1, etc. Block_count is the number of blocks you want to configure. in case Block_count is not specified, the system automatically calculates the number of blocks that meet the size of the device. Block_count is not specified, the system automatically calculates the number of blocks that meet the size of the device. parameter: -c Create a file system before checking there is a bad track. -l reads bad track records from the determined file. -f Specifies the number of FAT, File Allocation Table. The preset value is 2. Objective The front file system of the front Linux does not support more than 2 FAT tables. Usually this doesn't need to be changed. -F Specifies the size of the FAT table, usually 12 or 16 positions. 12-bit groups are commonly used for disks The slice, the 16-bit group is used in the general hard disk division area, that is, the so-called FAT16 format. This value is usually The appropriate value will be selected. Usually use FAT16 on the disk usually does not act, vice to the hard disk Use FAT12. -i Specifies the Volume ID. Generally, a number of four-bit tuples, like 2E203A47. if not Give the system will be generated. -m When the user tries to boot using this magnetic or divided zone, the system will give the system when there is no working system. Users a warning message. This parameter is used to change this message. You can edit the archive first Ok, then specify this parameter, or use -m - This system will ask you to enter this text directly. It is important to pay special attention, the strings in the archive don't More than 418 words, including the expanded jumper symbol (Tab) and the wrap symbol (the wrap symbol is under DOS Count two characters! ) -n Specifies Volume Name, which is a disk label. Like the Format directive under DOS, It is not possible. There is no preset value. -r Specifies the maximum number of files under the root directory. The so-called number of files here includes the directory. The preset value is in a flop disc The upper 112 or 224 is 512 on the hard drive. Nothing, don't change this number. Ok, then specify this parameter, or use -S Magnetic area of each magnetic busner. Must be two times. But unless you know you are What, this value does not give it. -v provides additional messages example: MKDOSFS-N TESTER / DEV / FD0 Format the disk in the A slot into a DOS format and will label Set to Tester