Both Linux command

xiaoxiao2021-03-20  211

Directive: FSTAB Usage Permissions: Super User Usage: Use the editor to modify / etc / fstab (EG. Vi / etc / fstab) Description: Store file system and directory structure 200 file FSTAB field Description: First column (fs_spec): Actual Device Name 2 (FS_FILE): Mount Point, third column (FS_VFSTYPE): This partition archives system, common: Minix, Ext, ext2, msdos, ISO9660 , NFS, SWAP (FS_MNTOPS): Parameters (FS_FREQ) at MOUNT: Whether to record when using DUMP, enter 0 sixth column (fs_passno): Decide to execute FSCK when booting Order example: IDE hard disk is divided into two partitions and a swap, there is a CRC with a soft disc server: / dev / hda1 / ext2 defaults 1 1 / dev / hda5 / home extra2 defaults 1 2 / dev / cdrom / mnt / cdrom iso9660 NOAUTO, User, RO 0 0 / DEV / HDA6 SWAP SWAP DEFAULTS 0 0 / DEV / FD0 / MNT / FLOPPY EXT2 NOAUTO, OWNER 0 0NONE / PTS Defaults 0 0none / dev / pts devpts GID = 5, Mode = 620 0 0 Name: SU Use Permissions: All users use methods: su [-fmp] [-c command] [-ss shell] [--help] [- v [] [-] [user [arg] Description: Changes to other users, in addition to root, you need to type the user's password parameters: -f or -fast does not have to read the startup file (such as csh.cshrc, etc.), only for CSH or TCSH- M -P or --PRESERVE-Environment Performs SU When the Environment Variable -C Command or --Command = Command Changes to the user who is User and performs the instruction (Command) and then change back to the original user-Shell or - SHELL = shell Specifies the shell (Bash CSH TCSH, etc.) to be executed, the preset value is / etc / pa SSWD SHELL - HELP Display Description File - Version Displayed Information - -l or --Login This parameter is added, it seems to be the same as the user, most of the environment. Variables (Home Shell User, etc.) are mainly based on this user, and the working directory will also change. If no user is specified, the user accounts that Rootuser wants to change will pass to the new shell parameter quote: Su -c ls root change account is root and exits returns to the original user after executing the LS instruction. Su root -f change account is root and passes into the -f parameter to the newly executed shell. Su - Clsung Change Account is CLSUNG and change the work directory to the CLSUNG home directory (Home Dir).

Name: Shutdown Usage Permissions: System Manager User: Shutdown [-t Seconds] [-RKHNCFF] Time [message] Description: Shutdown can be used to perform shutdown, and send information to all users being executed before shutdown SHUTDOWN can also be used to turn on. Parameters: -t seconds: After a few seconds, the shutdown program - K: does not really shut down, just transfer the warning message to all only users -R: turn it back on the machine after shutdown - H: After shutdown, shut down - N: Do not use the normal procedure to shut down, use the forced way to kill all executions after the procedure is turned off - C: Cancel the current shutdown action -f: When shutdown, do not do FCSK actions (check Linux file system) -F: When turning off, forced FSCK action Time: Setting the shutdown time message: Passing to all users: Reboot Use Permissions: System Manager User: Reboot [-n] [-w] [- D] [-f] [-i] Description: If the system's RunLvel is 0 or 6, turn it back, otherwise replace the parameters with the shutdown instruction (plus -r parameter): -N: Do not do before rewilling Memory data writes back to the hard disk - W: Don't really turn off, just write records to / var / log / wtmp file - D: Write records to / var / log / wtmp file (- n This parameter contains -D) -f: forced restarting, no calling shutdown this command-i: first stop all networks before restarting: Reboot Restart. Reboot -w Makes an analog to the restoring (only the record does not really restart).

Name: AddUser Use Permissions: System Administrator Usage: Adduser [-c Comment] [-d Home_Dir] [- E Expire_Date] [-f inactive_time] [- g initial_group] [-g group [, ...]] [ -m [-k skeleton_dir] | -M] [-p passwd] [- s shell] [-u uid [-o]] [-N] [-r] loginid or adduser -d [-g default_group] [ B Default_Home] [- f Default_inactive] [- E DEFAULT_EXPIRE_DATE] [- s Default_Shell] Note: Adduser and UseRadd Directive For the same instruction (via symbol Symbolic link) Description: Add user account or update preset user data parameters : -C Comment New User's annotation information of the password (usually / etc / passwd) -D home_dir Set the user's home directory to Home_dir, the preset value is the preset home, add the user account loginid- e expire_date Set this account (format YYY-MM-DD), the preset value is a permanent valid -f inactive_time example: adduse is adder. Relative, there is also an instruction of the user, Userdel. Syntax: Userdel [login id] Name: MOUNT User Permissions: User's User Yes in System Manager or / ETC / FSTAB: Mount [-HV] mount -a [-ffnrsvw] [-t vfstype] mount [-fnrsvw] [ -O Options [, ...]] Device | Dirmount [-fnrsvw] [-t vfstype] [-o Options] Device Dir Description: Interpreate the content of a file into file system, then hang it in a directory The position is above. When this command is executed, until we use umnount to remove this archive system so that all files below this command will be temporarily invoked. This command can be used to hang any file system, you can even use the -O LOOP option to use a general file as a hard drive to split the system. This feature is very practical for the interpretation of RamDisk, RomDisk, or the ISO 9660 video file. Parameter -V Display Program Version -H Display Assistive message -V displays more messages, usually and -f is used to deactivate. -a hangs all files defined in / etc / fstab. -F This command is usually used with -A, which generates a stroke for each MOUNT action. Mounting action can be accelerated when the system needs to hang a large number of NFS archives systems. -f is usually used in the defective purpose. It will make MOUNT do not perform actual hangs, but simulate the entire hanging process. It is usually used with -V. -n In general, Mount will write a data in / etc / mtab after hanging. However, this action can be canceled with this option without writing to the archive system in the system. -S-R is equal to -O RO-W equal to -O RW-L to hang the hard disk containing a particular tag. -U hangs the archive system of the file segmentation number. -L and -u must make sense when / proc / partition is present. -t specifies the type of archive system, usually does not have to be specified. Mount will automatically select the correct type. -o async opens the non-synchronous mode, all file read and write actions are executed in a non-synchronous mode. -o sync is executed in synchronous mode. -o atime-o noatime When the ATIME is turned on, the system will update the file "last call time" when the file is read. When we use the Flash file system, you may choose to turn this option to reduce the number of writes.

-o auto-o noauto opens / close automatic mount mode. -o Defaults uses preset options RW, SUID, DEV, EXEC, AUTO, NOUSER, and ASYNC.-O DEV-O Nodev-o Exec-o NOEXEC allows the execution file to be executed. -o SUID-O Nosuid allows the execution of the file to be executed under root privileges. -o User-O Nouser user can perform Mount / Umount action. -o remount is reused in different ways in different ways. For example, the system is originally read, and now re-hangs with readable writable mode. -o RO is hung by a only reading mode. -o rw is hung in readable write mode. -o loop = Using LOOP mode to use a file as a hard disk split to hang the system. The example will hang / dev / hda1 under / mnt. # mount / dev / hda1 / mnt The / dev / hda1 is hung under / mnt with the only read mode. #mount -o ro / dev / hda1 / mnt Use the image file of /tmp/image.iso this disc to be used under / mnt / cdrom. In this way, the Linux optical disc ISO file that can be found on the general network can be used to view its content without burning a disc. #mount -o loop /tmp/image.iso / mnt / cdrom related command umount directive: fdisk use: Observe the hard disk entity usage and split hard disk. How to use: 1. Enter fdisk -l / dev / sda on Console to observe the hard disk entity usage. Second, enter FDISK / DEV / SDA on Console to enter the split hard disk mode. 1. Enter m Display all commands. 2. Enter the P display the hard disk segmentation. 3. Enter a Set the hard disk boot area. 4. Enter n Set a new hard disk split area. 4.1. Inputting E hard drive is [Extended] Split Area (Extend). 4.2. Input P hard drive is [Main] Split Area (PRIMARY). 5. Enter T changes the hard disk split area properties. 6. Enter d Delete the hard disk split area properties. 7. Enter Q End does not store the hard disk split area properties. 8. Enter the end and write to the hard disk split area properties.

Directive: E2FSCK Use Permissions: Super User Way: E2FSck [-pacnydfvfv] [-B Superblock] [-B Blocksize] [-L | -L Bad_Blocks_File] [-C FD] Device Description: Check Using Linux Ext2 archive system PARTITION: DEVICE: Prepare Checking hard disk partition, for example: / dev / sda1-a: Check the partition, if there is a problem, automatic repair, equivalent -P function-B: Set the location of Superblock - B: Set the size of the unit Block -c: Check that the partition has a bad track -c file: save the results in the File to view the -d: Print E2FSCK debug result -f: Forced check -f: Before starting check, clear the Device's buffer cache, avoid errors - L BAD_BLOCKS_FILE: Add a BLOCK data with bad tracks to BAD_BLOCKS_FILE: Set the BAD_BLOCK data to Bad_Blocks_File, if there is no file Then -N: Turn the file system in [only reading] mode to check the partition, if there is a problem, automatic repair-V: Detailed display mode -V: Show current E2FSCK version -Y: Pre-set Derfened all the questions when checking [Yes]: Check / dev / hda5 is normal, if there is an abnormality, automatic repair, and set if there is a question answer, answer [Yes]: E2FSCK -A -Y / DEV / HDA5 Note: Most of the cases of using e2fsck check the situation of hard disk partition, usually special, so it's best to first check the partition umount, then execute E2FSCK, if you want to check / when you want to check, please enter Singal User Mode is executed again.

Name: DF Use Permissions: All Users> Usage: DF [Options] ... [file] ... Display the status of the archive system, or see all the status of all archives (preset) -A, - All contains all files with 0 blocks - BLOCK-SIZE = {Size} Use {size} Size block-h, --Human-Readable uses human readable format (preset value does not add this option) ...) - h, --si is very like -h, but with 1000 unit instead of 1024-i, --inodes lists INODE information, does not list the use of Block-K, --kilobytes is like - Block-size = 1024-l, --Local limit list file structure - M, - Megabytes is like -block-size = 1048576 - No-sync does not sync before information (preset value) - P, --portability uses POSIX Output Format - Sync Sync-t before acquiring information, --Type = Type limits the Type-t of the archive system, --Print-Type Displays the form of the archive system - X, - Exclude-type = TYPE Limits List the archive system Do not display Type-V (ignore) - Help Display this helper and leave --Version output version information and leave the name: DD Usage Permissions: All users DD this instruction in manual Definition is Convert and Copy A File Usage: DD [Option] If you want to watch Manual online, you can try: DD --help or info DD If you want to see how this version: DD --Version input or Output DD if = [stdin] of = [stdout] How much is forced input or output, how much bytesbs: dd -ibs = [byte] -Obs = [size] Forced only how many bytescbs = BYTES Skip after a period Seek = blocks Jump after entering Skip = Blocks Of course, you can take this easy copy CD (note that your disc is the standard ISO9660 format to do this!) DD if = / dev / cdrom of = CDROM .iso, where the IF is followed and the content behind it is adjusted according to your needs. Then give the system this instructions can be burned: cdrecord -v cdrom.iso This is not in cdrecord, so the above instruction is the most simple but does not necessarily meet your hardware environment .... Directive: CLEAR Utue: Clear Sound blow. How to use: Enter clear on Console.

Name: TR ### 1. For example, if you want to convert all uppercase files in the directory to lowercase files? There seems to be many ways, / "TR /" is one of them: #! / Bin / shdir = / "/ TMP / TESTDIR / "; Files =` Find $ DIR -TYPE F`; for i in $ filesdodir_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_filenamedone ### 2. In your own test ... LowerCase to Uppercasetr Abcdef ... [del] Abcde. .. [DEL] TR AZ A-ZTR / '[: Lower:] /' / '[: Upper:] /' Shell >> ECHO / "This Is A Test /" | TR AZ AZ> Wwwshell >> Cat wwwt Is A Test ### 3. Remove the unwanted string shell >> Tr -d this ### Remove the testthismanteste ### 4. Replace strings shell >> TR -S / "this /" / "TEST / "THISTESTTTHTE Name: TOP Usage Permissions: All users use mode: TOP [-] [D delay] [q] [c] [s] [s] [i] [n] [b] Description: Show Process in real time Dynamic Parameters: D: Change the displayed update speed, or in the conversation instruction column (Interactive Command) Press SQ: There is no delay display speed, if the user has the superuser permission, TOP will be the highest priority Performing a C: Switching display mode, there are two modes, one is only the name of the execution file, the other is to show the full path and the name S: cumulative mode, the sub-stroke that is completed or disappeared (Dead Child Process) CPU Time accumulates S: Safety mode, cancels the conversation instructions, avoids potential crisis i: No idle (IDLE) or useless stroke N: update, will exit TOPB after completion : Batch file mode, match / "n /" parameter together, can be used to output the result of TOP to the file: display update ten times and exit after ten times; Top -n 10 users will not use conversation instructions Under the stroke command: Top -s will update the update to display the results into the file name to top.log: TOP-N 2 -B

The parameters of the PS are very large, only a few common parameters are listed and the meaning of the inextriction -A listing all the strokes -W display widening can display more information -Au display more detailed information -AUX display all included Other users' stroke AU (x) Output format: user pid% CPU% MEM VSZ RSS TTY Stat Start Time Commanduser: Itiners PID: PID% CPU: User CPU usage% MEM: Memory usage VSZ : Occupable Virtual Memory Size RSS: The Submersible Memper Number Of TTY: Terminal Device Number Of TTY Stat: D: Uninterrupted Still (Plution □ 缜 B I / O action) R: In progress S: Static status T: Pause to execute Z: Do not exist but temporarily unable to eliminate W: Not enough memory paging assigns <: high priority stroke N: low priority stroke L: There is a memory paging assignment and lock in memory (real-time system or AI / o) Start: Time Time: Execute Time Command: The instructions performed: pspid Tty Time cmd2791 TTYP0 00:00:00 TCSH3092 TTYP0 00:00:00 PS% PS -APID TTY TIME CMD1? 00:00:03 init2? 00:00:00 kpiod4? 00:00:00 kswapd5? 00:00:00 mdrecoveryd. ...% PS -AUXUSER PID% CPU% MEM VSZ RSS TTY Stat Start Time Commandroot 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? SW SEP10 0:00 [KPIOD] root 4 0.0 0.0 0 0? SW SEP10 0:00 [kswapd] ........ Name: Kill Use Permissions: All users use Mode: Kill [-s signal | -p] [-a] pid ... kill -l [signal] Description: KILL sends a specific signal (SIGN Al) Do a specific action for the stroke ID as the PID according to this signal. If no designation is specified, the preset is a signal parameter to the termination (TERM): Among them, the signal is HUP (1), Kill (9), TERM (15), represents heavy run, cut off, end; detailed signals can be printed with kill -lp: PID, does not send signal -L (Signal): List all available signal names Example: Chopping the PID 323 (Kill): Kill -9 323 Running the PID 456 Running: Kill -Hup 456 Name: CAT Usage Permissions: All users use mode: Cat [-ABeensttuv ] [--HELP] [--Version] filename Description: Connect the file to the basic output (screen or plus> filename to another) parameters: -n or --Number starts to all outputs The number number-B or -Number-Nonblank and -n are similar, but the blank line that is changed to a row for the blank line of the blank line without numbered - s or - SQUEEZE-Blank. -v or --show-nonprinting example: cat -n textfile1>

TEXTFILE2 Plus TextFile1 files After adding the line number, enter the textfile2. Cat -b textfile1 textfile2 >> TextFile3 adds the contents of TextFile1 and TextFile2 to TEXTFILE3 after adding the line number (blank line does not add). Example: After adding the file content of TextFile1, enter the textfile2. Cat -n textfile1> textFile2 adds the contents of TextFile1 and TextFile2 to TextFile 3 after the line number (blank line does not add). CAT -B TEXTFILE1 TEXTFILE2 >> TextFile3cat / dev / null> /etc/test.txt This is the empty /etc/test.txt file content CAT can also be used to make image file. For example, you want to make a soft disc's image, put the soft disc to play CAT / dev / fd0> Outfile, if you want to write image file to floppy disc, please play Cat IMG_FILE> / DEV / FD0 Note: 1. Outfile Refers to the output image file name. 2. IMG_FILE refers to image file. 3. If you write from Image File back DEVICE, the device capacity needs to be quite. 4. Usually used in the production of boot magnetic sheets. Directive Name: CHMOD Usage Permissions: All users use mode: chmod [-cfvr] [--help] [--version] mode file ... Description: Linux / UNIX file transfer rights are divided into three levels: file owner , Group, other. Use CHMOD how to control how to be called by others. Parameters: Mode: Permissions set strings, formats are as follows: [Ugoa ...] [[ - =] [, ...], where u indicates the owner of the file, g represents With the owner of the file belongs to the same group (Group), o represents the other people, and 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 represents only when the file is a subdirectory or the file has been set to be executed. -c: If this file authority does have changed, it is displayed in the change action -f: If this file authority cannot be changed, do not display the error message-V: Display permission change - R: All files in current directory Permissions change with the subdirectory (ie, changed one by one by hand) - Help: Display auxiliary instructions --Version: Display version example: Set file file1.txt to everyone can read: chmod ugo R file1.txt Sets the file file1.txt to be read: chmod a r file1.txt Sets file file1.txt and file2.txt owner, with its own same group can write However, others cannot be written: Chmod Ug W, OW file1.txt file2.txt Sets EX1.py to only this file owner can be executed: chmod u x ex1.py will be in current directory All archives and subdirectories are available to anyone: ChMOD -R A R * Also CHMOD can also use numbers to indicate rights such as CHMOD 777 File syntax: chmod abc files, B, C each as a number The permissions of User, Group, and Other, respectively.

R = 4, w = 2, x = 1 To RWX attribute 4 2 1 = 7; to RW-attribute 4 2 = 6; if the R-X property is 4 1 = 7. Example: chmod a = rwx file and chmod 777 FILE effect The same CHMOD UG = RWX, o = x file and chmod 771 File effects same If you use CHMOD 4755 FileName, this program has root permission name: CP usage rights: All users How to use: CP [options] Source destcp [options] Source ... Directory Description: Copy a file to another, or copy several files to another directory. Parameters: -a copies the status of file status, permissions, etc. -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 and name it BBB: CP AAA BBB copies all C language programs to the finished subdirectory: CP * .c finished Name: crontab Usage Permissions: All users use: crontab [-U user] Filecrontab [-U user] {-l | -r | -e} Description: crontab is used to make the user in a fixed time or fixed interval execute program, in other words, that is, the like Time history. -u user refers to the schedule that sets the specified user. This premise is that you have to have its permissions (such as root) to specify the schedule of others. If you don't use -u user, it means to set your own schedule. Number of meals: -e: Perform a text editor to set a time schedule, the constant text editor is VI, if you want to use the other text editor, first set the Visual environment variable to specify the use of that text editor. (For example, SETENV Visual Joe) -r: Delete the current Turkey -L: Lists the current schedule meter format as follows: F1 F2 F3 F4 F5 program where F1 is a minute, F2 represents hours, F3 Represents the day in one month, F4 means the month, F5 represents the first few days in the week. Program represents the program to be executed. When F1 is *, it is indicated that both Program, F2 is *, which is executed every hour, which is executed every hour, and the classes will be implemented from the first minutes to the second time to execute, F2 When AB is to be executed from paragraphs A to B, the rating of F1 is * / n, indicating that each time interval is executed once, and F2 is * / n to execute each time time interval, The balance is pushed to f1 as a, b, c, ... indicating the first, b, c, ... minutes to perform, F2 is A, B, C, ..., represent, first, b, c ... An hour to execute, and its push users can also store all settings first in the file file, and set the time schedule with the crontab file.

Example: Perhab / bin / ls: 0 7 * * * / bin / ls per hour per hour per hour, per day to 12 o'clock, every 20 minutes per day / usr / bin / backup: 0 6-12 / 3 * 12 * / usr / bin / backup Monday to Friday 5:00 pm alex@domain.name: 0 17 * * 1-5 mail -s / "hi /" alex@domain.name / dev / null 2> & 1 after each line of empty: Mail Use Permissions: All users usage: mail [-iinv] [-s Subject] [-c cc-addr] [- B bcc-addr] User1 [user 2 ...] Description: Mail is not only an instruction, but Mail is also an email program, but people who use Mail to read the letter should be very small! For system managers, Mail is useful, because managers can write to Script with Mail, regularly send some memorandum of reminder systems. Parameters: I ignore the interrupt signal of TTY. (Interrupt) I forced to set up interactive mode. (Interactive) V lists the message, such as the location, state, etc. of the send letter, etc. (Verbose) N Do not read the mail.rc setting file. S Mail title. C CC mail address. B BCC email address. Example: Getting the letters to one or more email addresses, because no other options are added, the user must enter the contents of the title and the letter. User2 does not have a host position, it will give the user2 user of the mail server. Mail User1@email.addressmail User1@emil.address User2 Name: Finger Use Permissions: All users User: Finger [Options] User [@address] Description: Finger allows the user to query some other user information. The information listed is: login nameuser namehome DirectoryShelllogin statusmail status.plan.project.forward where .plan, .project and .forward are the user in his home directory. PLAN, .Project and .Forward portfolio. data. If there is no. The Finger directive is not limited to queries on the same server, and you can also find the user on a remote server. Just give an address like an e-mail address. Parameters: -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. This option is invalid if the user is a remote server.

Example: The following instructions can be queried by this manager: Finger root results are as follows: login: root name: rootdirectory: / root shell: / bin / bashnever logged in. NO Mail.no Plan. Name: AT Usage Permissions: All User use: at -v [-q queue] [-f file] [-mldbv] Time Description: AT can make users specifying a program or instruction in Time, Time's format is HH: mm The HH is hour, mm is minutes, and even you can specify AM, PM, Midnight, Noon, Teatime (4 pm). If you want to specify the time in more than a day, you can use mmddyy or mm / dd / yy format, where mm is minute, DD is the day, yy refers to the year. In addition, the user can even use a NOW time interval to elastic designation 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 and press Enter, AT will enter the conversation mode and ask for an instruction or program. When you press Ctrl D, press Ctrl D to complete all the actions, as for the result of the execution, will be sent back to your account . Parameters: -v: Printing No. Published No. -Q: Use the specified 伫 伫 (Queue) to store, the data of the AT is stored in the so-called queue, the user can use multiple queue at the same time, and the Queue's number A, B, C ... Z and A, B, ... Z Total 52 - M: Even if the program / instruction does not output the result, send a letter to the user -f file: read in advance Command file. Users do not have to use the conversation mode to enter, first write all the specified first to the file once again read -L: List all the specified (the user can also use ATQ directly without AT -L) -D : Delete the specified (the user can use ATRM directly without using AT -D) -V: List all the specified examples that have been completed but have not been removed: 5 pm after three days of execution / bin / ls: AT 5PM 3 days / bin / ls three weeks later 5 pm on 5 pm / bin / ls: at 5pm 2 weeks / bin / ls tomorrow 17:20 execution / bin / date: at 17:20 Tomorrow / bin / date1999 The last day's last minute printed the end of world! At 23:59 12/31/1999 echo the end of world! Name: MV Usage Permissions: All users User: MV [options] Source destmv [options] SOURCE ... Directory Description: Move a file to another file or move several files to another directory. Parameters: -i If the destination already has the same name file, first ask if the old file is overwritten.

Example: Move the file aaa to bbb: MV AAA BBB Moves all C language programs to the finished subdirectory: mv -i * .c Name: Locate Use Permissions: All users use mode: locate [-q] [- D] [--DATABASE =] 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 specified files in the archive system. Its method is to build a database including all file names and paths in the system, and then only query this database when looking for, without having to actually go into the archive system. In a general distribution, the establishment of the database is placed automatically in the contab. General users can use the type of # locate your_file_name when using. Parameters: -u-u Set the database, -U will start with the root directory, and -U can specify the starting location. -e will exclude the range of findings. -l if it is 1. Start safe mode. In safe mode, the user will not see the file that is not available. This will slow down because Locate must obtain the permission information of the file in the actual archive system. -f excludes specific archives systems, for example, we have not referended files in the ProC archive system in the database. -q quiet mode does not display any error messages. -N is displayed to display an output. -r Use a regular arithmetic condition for the condition. -o Specifies the name of the data inventory. -d to specify the path of the database - H Display Auxiliary Message-V Display More News - V Displays Version Message Sample: Locate ChDRV: Looking for all files called ChDRV Locate -N 100 a.out: Looking for all called A.out The file, but only 100 locate -u: Creating a database locate command can quickly find the file when searching the database, the database is updated by the UpdatedB program, Updatedb is built by Cron daemon, the locate command is more than the database It is faster by the entire hard disk information to search for information, but the difference is that the file found by Locate is established or just renamed. It may not be found, in the internal value, updatedb will run once every day, can be modified CRONTAB to update the set value. (etc / crontab) Locate Specifies the file to search for eligible, it will store the file and the database name of the directory name, find the file or directory of the model style condition, you can use special characters (such as "*" or " "", Etc.) to specify the model style, such as the specified model is KCPA * Ner, Locate will find all the start strings to KCPA and end the file or directory ending NER, if the name is Kcpartner If the name of the directory is KCPA_NER, will be column All files, including subdirectories, including subdirectory. Locate instructions and find findings are similar, but Locate is to create all files and directory information in the hard disk first through the Update program, and then find the index directly when performing LOACTE, and the query speed will be fast, index database is general It is managed by operating system, but it can also be directly updated directly to the index database immediately.

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

New Post(0)