Linux Directive Daquan (3)

xiaoxiao2021-03-06  96

Name: / etc / aliases Use Permissions: System Manager Usage: Please use the newaliases update Database Description: Sendmail uses an action that is converted by the file in / etc / aliases. When sendmail receives a letter to XXX, it will be given to another by the content of the AliaSS file. This feature creates a user who is only valid in the letters system. For example, Mailing List uses this feature. In MailingList, we may create a call.

Redlinux@link.ece.uci.edu

MailingList, but actually does not have a user named RedLinux. The actual AliaSS file is to receive the Mailing List processing of the Mailing List processing. / etc / aliases is a file file, Sendmail requires a binary format /etc/aliases.db. NEWALIASES's functional is to convert / etc / aliases into a repository that SENDMAIL can understand. Example: # Newaliases The following command will do the same thing, # sendmail -bi related commands: mail, mailq, newaliases, sendmail "mail" Mail [return] Name: Mail Use Permissions: All users use: mail [-iinv] [ S Subject] [-c cc-addr] [-b bcc-addr] User1 [user 2 ...] Description: Mail is not only a directive, Mail is still an email program, but people who use Mail to read the letter should be very Less! For system managers, Mail is very useful, because managers can write into script with mail, regularly send some memorandum reminder systems. Parameters: i ignore TTY interrupt signals. (Interrupt) I forced interaction Mode. (Interactive) V lists the message, such as the location of the send letter, state, etc. (Verbose) N does not read the mail.rc setting file. SMail title. C CC mail address. B BCC email address. Example: Get the letters to one or more email addresses, because the user must enter the contents of the title and the letter, etc., and the user2 does not have the host position, which will give the mail server User2 user. Mail

User1@email.addr

Ess Mail

User1@email.addr

ESS USER2 Sending the content of mail.txt to user2 simultaneously CC to USER1. If you set this line instruction to cronjob, you can send a memo to the system user. Mail -s Title - C User1 User2

MailingList, but actually does not have a user named RedLinux. The actual AliaSS file is to receive the Mailing List processing of the Mailing List processing. / etc / aliases is a file file, Sendmail requires a binary format /etc/aliases.db. NEWALIASES's functional is to convert / etc / aliases into a repository that SENDMAIL can understand. Parameters: No parameters. Example: # Newaliase The following command will do the same thing, # sendmail -bi related commands: mail, mailq, newaliases, sendmail Name: Talk User Permissions: All users use mode: Talk Person [TTYNAME] Description: Pair with other users Talking about: Person: The user account for the interpretation, 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 newspaper example. 1: Talk to the user rollaend on the machine, then Rolland has only one connection: Talk Rollaend Next Just a RollaEnd response, if rollaend accepts, RollaEnd Enter the `Talk Jzlee`, you can start the talk, press CTRL C example. 2: Talk to the user Rolland on Linuxfab.cx, use PTS / 2 to Talk: Talk

RollaEnd@linuxfab.cx

PTS / 2 is next to the RollaEnd response, if rollaend accepts, Rollaend Enter the `Talk

Jzlee@jzlee.home

`You can start talking, please press CTRL C Note: If the word of the screen appears abnormal characters, try to update the screen screen to Ctrl L. Name: WALL Use Permissions: All users use mode: Wall [message] Use instructions: Wall transmits the message to each MESG to set the User's online user. When using the terminal interface as a standard income, the message needs to be added with EOF (usually using Ctrl D)  Example: Communication "Hi" gives each user: Wall Hi Name: Write Use Permissions: All Use How to use: Write user [TTYNAME] Description: Communication to other users: user: Prepare the user account TTYNAME: If the user has more than two TTY connectors, you can choose the right Tty Tombye example. 1: The message is given to Rolland. At this time, Rolland has only one connection: Write Rollaend is then hitting the message, and press Ctrl C example. 2: Communication to Rollaend, Rollaend has PTS / 2, PTS / 3: Write RollaEnd PTS / 2 Next is to hit the message, please press CTRL C Note: If the other party sets Mesg n, at this time, the interpretation will not pass to the other party name: KILL use permission : All users use methods: kill [-s signal | -p] [-a] pid ... kill -l [signal] Description: KILL sends a specific signal (Signal) to the stroke ID PID stroke according to this Signals do specific actions, if no specified, the preset is a signal to send the termination (TERM): which is available in HUP (1), KILL (9), Term (15), Represented, cut off, end; detailed signals can be printed with kill -l -p: PID, do not send signal -L (Signal): list all available signal name: PID 323 stroke Cut off (kill): Kill -9 323 Running the PID 456 Running (Restart): Kill-Hup 456 Name: NICE Usage Permissions: All Users User Way: Nice [-n Adjustment] [-adjustment] [- -adjustment = adjustment] [--help] [--Version] [Command [arg ...]]] Description: Execute a program with a changed priority, if not specified, the current schedule is printed Order, the internal Adjustment is 10, the range is -20 (highest priority) to 19 (minimum preferred preface) Putting  -n adjustment, -adjustment, -adjustment = adjustment, all Adjustment - HELP display restrictions --Version display Version Information Example: Put the priority of the LS 1 and execute: Nice -n 1 LS adds the priority sequence of the LS and executes: NICE LS adds the priority of the LS 10 and performs Note: Priority is a job system The parameters used to determine the CPU allocation, Linux uses the "Round-Robin" to do the CPU schedule, the higher the priority, the more CPUs that may be obtained.

Name: PS Usage Permissions: All users use mode: PS [options] [--help] Description: Show the dynamic parameters of the moment: PS [Options] Dynamic parameters: PS is very large, only a few common parameters are listed here and Ondering Introduction Meaning-A List All Tour-W Display Widening You can display more information -au Show more detailed information -AUX Display all stroke Au (x) output format containing other users: user pid% CPU% MEM VSZ RSS TTY Stat Start Time Command User: PID% PID: PID% CPU: User CPU Usage% MEM: Occupied Memory Use VSZ: Occupable Virtual Memory Size RSS: The Memory Size TTY: The secondary device number of the terminal: D: Uninterrupted stationary (Pipe □ 缜 B performs I / O action) R: is being executed S: Static state T: Pause to execute Z: No, it is temporarily unable to eliminate W: Not enough memory page can be assigned <: high-priority stroke N: low priority stroke L: There is a memory paging assignment and lock in memory (instant system or Ai / o) Start: Time Time Time: Execute Time Command: Examples of Directive: 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 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 Permissions: All users use methods: pstree [-a] [-c] [-h | -hpid] [-l] [-n] [-p ] [-U] [-g | -u] [PID | User] PStree -V Description: Display all the strokes in a tree diagram, the tree map will be pid (if there is specified) or in init this basic stroke For root (root) If there is a specified user ID, the tree graph shows only the stroke parameters owned by the user: -a Displays the full instructions and parameters of the stroke, if it is replaced by the memory body Will add bracket -c If there is a rebounded trip name, separate list (preset value is 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 .... Name: Renic Usage Permissions: All users use mode: renice priority [[-p] pid ...] [[-g] PGRP. ..] [[-u] user ...]]]

Re-specify the priority of one or more strokes (one or more of the parameters will be determined according to the parameters below), the ID -P PID re-specifies the priority of the stroke of the PID-g PGRP re-specified The priority example of the Tour Group (1 or more) of the travel group (one or more) of the PROCESS Group (one or more) - User re-specifies the priority example example of the stroke owner for the User: The stroke ID is 987 and 32 strokes and strokes The owner is a priority number of Daemon and root plus 1: renice 1 987 -u daemon root -p 32 Note: Every stroke has a unique ID  Name: TOP Usage Permissions: All Use How to use: TOP [-] [D delay] [q] [c] [s] [s] [i] [n] [b] description: Instant display of Process Dynamic Accumulation D: Changing the displayed update speed , Or Interactive Command Press SQ: No delayed display speed, if the user has the permissions of the superUser, TOP will perform C: switch display mode with the highest priority, there are two kinds. Mode, one is only the name of the execution file, the other is to display the full path and the name S: cumulative mode, the CPU Time of the DEAD CHILD Process, the CPU Time of the Dead Child Process, is accumulated S: Safety mode, Cancel the conversation command to avoid potential crisis i: No idle (IDLE) or useless (Zombie) stroke N: update number, will exit TOP B: batch file mode after completion, with "N" parameters Used together, can be used to output the results of TOP to the archives: display update ten times after exiting; Top -n 10 users will not use the conversation instruction to the stroke command: top -s will update the update 4 times The result is entered into a file name to top.log: Top -n 2 -b

Name (code) function / Description ALRM 14 Leaves HUP 1 Leaving INT 2 Leaving KILL 9 Leaving PIPE 13 Leaving PROW PROW TERM 15 Leaving USR1 Leaving USR2 Leaving VTALRM Leaving STKFLT Leaving / Only I386, M68K, ARM and PPC hardware unused leaves / only for I386, M68K, ARM, and PPC hardware TSTP stop / generating behavior TTIN stop / generating behavior Ttou stop / generate behavior of behavior stoP stop / forcing shutdown Conta from the new start / if the stop state is started from the new, otherwise ignore the PWR ignore / ignore Winch in some systems ignore CHLD ignore ABRT 6 core FPE 8 core ILL 4 core Quit 3 core SEGV 11 core Trap 5 core SYS core / perhaps Undepended EMT core / perhaps unplanned BUS core / core failure XCPU core / core failure XFSZ core / core failure example: Stop all programs Skill -kill -V PTS / * on the PTY device to stop three users User1, User2, user3 skill -stop user1 user2 user3 other related commands: kill name: EXPR Usage Permissions: All users ### string length shell >> expr length "this is a test" 14 ### Digital commercial shell> > EXPR 14% 9 5 ### From location Crapen Strings shell >> Expr Substr "this is a test" 3 5 is is ### Digital String Only The First Character Shell >> Expr Index "Testforthegame" E 2 ### String Real Reproduce Shell >> EXPR Quote THISATESTFORMELA THISATSTFORMELA Name: TR ### 1. More than one side, do all uppercase files under the directory to lowercase file name? There seems to be many ways, "TR" is one of them One: #! / 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. 自 自己 试 ... ... LowerCase to Uppercase Tr Abcdef ... [DEL] Abcde ... [DEL] TR AZ AZ TR [: Lower: ] [: Upper:] shell >> echo "this is a test" | TR AZ AZ> WWW shell >> Cat WWW this is a test ### 3. Remove unwanted string shell >> Tr -d this # ## Remove the Test this Man Man Test E ### 4. Replace Strings Shell >> Tr -s "Test" this test th TE directive:

CLEAR use: 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: Reset actually and tset is a command It uses its use of setting the status of the terminal. In general, this command will automatically determine the current terminal of the current terminal from the environment variable, command column, or other configuration. 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 enters some strange states because the program is not properly executed, you can also use it to reset the terminal O, for example Be careful to enter the binary file with the CAT directive to the terminal, often there is a terminal that does not respond to the keyboard input, or responds to some strange characters. You can reply to the original state with RESET. Option Description: -p The terminal category is displayed on the screen, but does not make the set action. This command can be used to achieve the category of the current terminal. -e ch Associates the ERASE unit into a CH -I CH to set the interrupt character into ch -K CH will delete the character of the row to set a CH -I to do the set action. If there is no option -Q, ERASE , The current value of the interrupt and deletion of the character will still be sent to the screen. -Q Do not display ERASE, interrupt, and delete the value of the character to the screen. -r Prints the terminal machine class on the screen. -s Send the typed string of the command to the TERM to the terminal, usually in .login or .profile example: Let the user enter a terminal model and set the terminal to the type. Preset status. # RESET? Set the ERASE CET to set the concol-h # reset -e ^ b Display the string of settings on the screen # reset -s Erase IS Control-B (^ b). Kill IS Control-u (^ U). Interrupt is control-c (^ c). Term = xterm; Name: compress usage rights: All users use methods: compress [-dfvcv] [-b maxbits] [file ...] Description: compress is a Pretty ancient UNIX file compression instructions, the compressed file will add a .z extended file name to distinguish an uncompressed file, and the compressed file can be decompressed in uncompress. To press the plurality of files into a compressed file, you must first turn the archive Tar and then compress. Since Gzip can generate more ideal compression ratios, the general people have changed more Gzip to archive compression tools. Parameters: c Output Results to standard output devices (General referred to screen) F Forced writing files, if the destination already exists, it will be overwritten (force) the message executed by the program on the screen (Verbose) B The upper limit of the number of common strings is set, and the value can be set to 9 to 16 BITS with bit yuan. Since the value is, the more common strings that can be used, the larger the compression ratio, so the preset value 16 bits (bits) D will extract the compressed file to extract the V-list information example: Source.dat compression Source.dat.z, if Source.dat.z already exists, the content is covered by the compressed file. Compress -f Source.dat compresses Source.dat into source.dat.z, and prints the compression ratio. -v and -f can use compress -vf source.dat to output the compressed data. Dat.z can change the compressed file name.

The larger the value of the target -c source.dat> target.dat.z -b, the larger the compression ratio, the range is 9-16, the preset value is 16. Compress -b 12 Source.dat decompresses Source.dat.z into source.dat. If the file already exists, the user presses Y to determine the coverage file, if you use the -DF program, you will automatically cover the file. Since the system will automatically join .Z is an extended file name, Source.dat will automatically be treated as Source.dat.z. Compress -d source.dat compress -d source.dat.z Name: LPD Usage Permissions: All users use mode: LPD [-l] [#port] LPD is a resident printing machine management program, it will / etc / printcap content to manage local or distal printers. Each printer defined in / etc / printcap must have a corresponding directory in / var / lpd. In the directory, a copy of the CF starts in a directory indicates a printing work waiting to be sent to the appropriate device. This file is usually generated by the LPR. LPR and LPD constitute a system that can work offline. When you use LPR, the printing machine does not need to be available immediately, and no existence. LPD automatically monitors the status 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. Parameters: -l: Display some unlocated messages on the standard output. #port: In general, LPD uses 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 - Displays unfinished work usage in the list machine LPQ [L] [P] [user] Description LPQ displays unfinished items in the list of list managers managed by the LPD. Sample Example 1. Show all work in the LP list machine # lpq -plrank Owner Job Files Total Size1st Root 238 (Standard Input) 1428646 BYTES Related Functions LPR, LPC, LPD Name: LPR Usage Permissions: All users use : Lpr [-pprinter] Sends the file or sent by the standard input to the printing machine, the printing machine management process LPD will give this file to the appropriate program or device processing. The LPR can be used to process the material to be sent to the local or distal host. Parameters: -pprinter: Send the data to the specified printer PRINTER, the preset value is LP. Example: Will www.c

And kkk.c is sent to the printer LP. LPR-PLP

Www.c

KKK.c Name: LPRM - Remove a work by the print machine to rewind usage / usr / bin / lprm [p] [file ...] Description Minder's work that has not been completed will be placed in the print In the machine, this command can be used to cancel the work of the printing machine. Since each printer has a separate storage, you can use the -P command to set the printed machine you want to function. If there is no setting, the system preset press will be used. This command checks if the user has enough permissions to delete the specified file. In general, only the owner of the file or the system administrator has this permission. Example Removing LPRM -PPrinter 1123 in the printing machine HPprinter to remove LPRM 1011 in the preset press: fdformat Use Permissions: FDFormat [-n ] DEVICE Instructions: Low-order formatting of the specified soft disc device. When using this instruction to format the floppy disk, it is best to specify the following device: / dev / fd0d360 disk machine A:, the magnetic piece is 360KB disk / DEV / FD0H1440 disk machine A:, the magnetic sheet is 1.4 MB Disk / DEV / FD1H1200 disk B:, magnetic disk is 1.2MB disk If used is 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. Parameters: -N Close the confirmation function. This option closes the formatted confirmation step. Example: fdformat-N / DEV / FD0H1440 format the magnetic disk of the disk into a 1.4MB magnetic sheet. And the confirmation step is omitted. Name: MFORMAT Usage Permissions: All users use methods: mformat [-t cylinders] [-h heads] [-S sectors] [-l volume_label] [-f] [-i fsver-sion] [-s sizecode] [ -2 Sectorserials_ON_TRACK_0] [-M Software_sector_size] [-A] [-X] [-C] [-H hidden_sectors] [-r root_sector] [-b boot_sector] [-0 rate_on_track_0] [-A rate_on_other_tracks] [-1] [-K] Drive: DOS archive system is established on a magnetic sheet that has already been low-level formatted. If you open the parameters of the USE_2M when compiling MTools, the partial parameters associated with the 2M format will work. Otherwise these parameters (like S, 2, 1, m) do not act. Parameters: Synlider Number -H Head (HEAD) - Sternium Magnetic Area - L Tag -f The magnetic disc is formatted into FAT32 format, 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, calculated the number of magnetic regions of the sector = 2 ^ (size code 7) -C magnetne (Cluster). If the given number causes the number of magnets that exceed the FAT table, MFORMAT will automatically amplify the number of magnetic regions. -s -M mouncing 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 formatting action.

-C Generates a disk image file (Disk Image) that can be installed with MS-DOS archive system. Of course, this parameter is meaningless to an entity disk machine. -H hidden the number of magnetic regions. This is usually suitable for the split area of ​​the formatting the hard drive because there is a segmentation table in front of a divided area. This parameter is not tested, it can not be used. -n disk serial number -R root directory size, 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. Of course, the hardware parameters are faded. -k Try to maintain the original boot magnetic area. -0 Data transfer rate -A Data transmission rate -2 2 2 2 2 范 范 例 例 例 例 例 例 例 例 例 例 例 例 例 例 例 例 例 例 例 例 例 例 例 例 例 例 例 例The disk formatted in the disk. Name: MKDOSFS Usage Permissions: All users use methods: 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: Create a DOS file 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. If block_count is not specified, the system automatically calculates the number of blocks that meet the size of the device. Parameters: -c Create a file before checking whether 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. At present, Linux's FAT archive system 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. The 12-bit group is usually used for the disks, and the 16-bit component group is used for the general hard disk division area, that is, the so-called FAT16 format. This value typically systematically selects the appropriate value itself. Using FAT16 on the disk usually does not take effect, it is also possible to use FAT12 on the hard disk. -i Specifies the Volume ID. Generally, a number of four-bit tuples, like 2E203A47. If you don't give your system you will be generated. -m When the user tries to boot with this magnetic or divided zone, the system will give the user a warning message to the user when there is no working system. This parameter is used to change this message. You can use the file to edit it, then specify this parameter, or use -m - so the system will ask you to enter this text directly. It is important to note that the strings in the file should not exceed 418 words, including the expanded jumper symbol (Tab) and the wrap symbol (the wrap symbol counts two characters under DOS!) -Not Specifies the Volume Name, Disk label. Like the Format directive under the DOS, you will not give it. 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 112 or 224 on the floppy disc, 512 on the hard disk. Nothing, don't change this number. -S Magnetic area of ​​each magnetic busner. Must be two times. But unless you know what you are doing, this value should not be gave.

转载请注明原文地址:https://www.9cbs.com/read-105024.html

New Post(0)