Home > Operation and Maintenance > Linux Operation and Maintenance > I haven't collected these 50 commands in Linux yet!

I haven't collected these 50 commands in Linux yet!

藏色散人
Release: 2021-10-14 16:30:06
forward
2464 people have browsed it

The following column linux system tutorial will introduce you to 50 commands for Linux file management. I hope it will be helpful to friends in need!

1.Linux cat command

The cat command is used to connect files and print to on the standard output device.

2.Linux chattr command

The Linux chattr command is used to change file attributes.

3.Linux chgrp command

The Linux chgrp command is used to change the group to which a file or directory belongs.

In the UNIX system family, the control of file or directory permissions is managed by the owner and the group to which it belongs. You can use the chgrp command to change the group to which files and directories belong. The setting method can be the group name or group identifier.

4.Linux chmod command

Linux/Unix file calling permissions are divided into three levels: file owner, group, and other. Use chmod to control how files are called by others.

5.Linux chown command

Linux/Unix is ​​a multi-person, multi-tasking operating system, and all files have owners. Use chown to change the owner of the specified file to the specified user or group. The user can be the user name or user ID; the group can be the group name or group ID; the file is a space-separated list of files whose permissions need to be changed, and wildcards are supported.

Generally speaking, this command can only be used by the system administrator (root). Generally, users do not have the permission to change the file owner of others, nor do they have the permission to change the owner of their own file to someone else. . Only the system administrator (root) has such permissions.

6.Linux cksum command

The Linux cksum command is used to check whether the CRC of the file is correct. Ensure that files are not corrupted during transfer from one system to another.

CRC is a debugging check method. The standard of this check method is specified by CCITT and can detect at least 99.998% of known errors.

After the specified file is submitted to the command "cksum" for verification, the command will return the verification result for the user to check whether the file is correct. If no file name is specified or "-" is given, the "cksum" command reads data from the standard input device.

7.Linux cmp command

The Linux cmp command is used to compare two files for differences.

When the two files compared to each other are exactly the same, this command will not display any information. If differences are found, the character and column number of the first difference will be marked by default. If no file name is specified or "-" is given, the cmp command reads data from the standard input device.

8.Linux diff command

The Linux diff command is used to compare the differences between files.

diff compares the similarities and differences of text files line by line. Therefore, if directories are specified to be compared, diff will compare files with the same file name in the directory, but will not compare subdirectories.

9.Linux git command

The Linux git command is a file manager in text mode.

Git is a program used to manage files. It is very similar to Norton Commander under DOS and has an interactive operation interface. Its operation method is almost the same as Norton Commander.

10.Linux find command

The Linux find command is used to find files in the specified directory. Any string preceding the parameter will be treated as the name of the directory to be searched. If you use this command without setting any parameters, the find command will search for subdirectories and files in the current directory. And all found subdirectories and files will be displayed.

11.Linux file command

The Linux file command is used to identify file types.

Through the file command, we can identify the type of the file.

12.Linux diffstat command

The Linux diffstat command displays statistics based on the diff comparison results.

diffstat reads the output results of diff, and then counts the insertion, deletion, modification and other difference measurement of each file.

13.Linux ln command

The Linux ln command is a very important command. Its function is to establish a synchronous link for a certain file in another location.

When we need to use the same file in different directories, we don’t need to put a file that must be the same in every required directory. We only need to put it in a fixed directory. This file can then be linked using the ln command in other directories without repeatedly occupying disk space.

14.Linux cut command

The Linux cut command is used to display the text from num1 to num2 from the beginning of each line.

15.Linux indent command

The Linux indent command is used to adjust the format of C original code files.

indent can identify C original code files and format them to make them easier for programmers to read.

16.Linux gitview command

The Linux gitview command is used to view the contents of the file. It will display character codes in both hexadecimal and ASCII formats.

17.Linux less command

less is similar to more, but you can use less to browse files at will, while more can only move forward, but not backward, and less is in The entire file is not loaded before viewing.

18.Linux locate command

The Linux locate command is used to find documents that meet the conditions. It will go to the database where the document and directory names are saved to find the template pattern. The document or directory of the condition.

Generally, we only need to enter locate your_file_name to find the specified file.

19.Linux lsattr command

The Linux lsattr command is used to display file attributes.

Use chattr to change the attributes of a file or directory. You can execute the lsattr command to query its attributes.

20.Linux mattrib command

The Linux mattrib command is used to change or display the attributes of MS-DOS files.

mattrib is the mtools tool command, which simulates the attrib command of MS-DOS and can change the attributes of MS-DOS files.

21.Linux mc command

The Linux mc command is used to provide a menu-based file management program.

After executing mc, you will see a menu-style file management program, divided into 4 parts.

22.Linux mdel command

The Linux mdel command is used to delete MSDOS format files.

There will be a prompt message before deleting read-only.

23.Linux mdir command

The Linux mdir command is used to display the MS-DOS directory.

mdir is the mtools tool command, which simulates the MS-DOS dir command and can display the directory contents in the MS-DOS file system.

24.Linux mktemp command

The Linux mktemp command is used to create temporary files.

A temporary file created by mktemp for use by shell scripts.

25.Linux more command

Linux more command is similar to cat, but it will be displayed page by page, which is more convenient for users to read page by page. The basic command is to press the space key to display the next page, and press the b key to display the next page. It also has a search string function (similar to vi). In-use documentation , please press h.

26.Linux mmove command

The Linux mmove command is used to move files or directories, or change names in the MS-DOS file system.

mmove is the mtools tool command, which simulates the MS-DOS move command. It can move existing files or directories in the MS-DOS file system, or change the name of existing files or directories.

27.Linux mread command

The Linux mread command is used to copy MS-DOS files to a Linux/Unix directory.

mread is the mtools tool command, which can copy MS-DOS files to the Linux file system. This command is no longer commonly used, and the mcopy command is generally used instead.

28.Linux mren command

The Linux mren command is used to change the name of an MS-DOS file or directory, or to move a file or directory.

mren is an MS-DOS tool command, which is similar to the ren command under DOS and can change the name of an MS-DOS file or directory.

The source file must be a file that already exists on the disk. If the drive letter and path are ignored, it means the file on the current disk and current directory.

The new file name is the name of the file to be replaced. You cannot add a drive letter and path different from the source file before the new file name, because this command can only change the file name on the same drive.

29.Linux mtools command

The Linux mtools command is used to display the instructions supported by mtools.

mtools is a tool program for the MS-DOS file system, which can simulate many MS-DOS instructions. These instructions are all symbolic links of mtools, so they will have some common features.

30.Linux mtoolstest command

The Linux mtoolstest command is used to test and display mtools related settings.

mtoolstest is the mtools tool command, which can read and analyze the mtools configuration file and display the results on the screen.

31.Linux mv command

The Linux mv command is used to rename files or directories, or move files or directories to other locations.

32.Linux od command

The Linux od command is used to output file contents.

The od command will read the contents of the given file and render its contents in octal characters.

33.Linux paste command

The Linux paste command is used to merge columns of files.

Thepaste command will merge each file column by column.

34.Linux patch command

The Linux patch command is used to patch files.

Thepatch command allows users to modify and update the original file by setting a patch file. If you only modify one file at a time, you can directly issue commands in the command line and execute them sequentially. If you cooperate with the method of patching files, you can patch a large number of files at one time. This is also one of the core upgrade methods of Linux systems.

35.Linux rcp command

The Linux rcp command is used to copy remote files or directories.

The rcp command is used to copy files or directories remotely. If more than two files or directories are specified at the same time, and the final destination is an existing directory, it will copy all previously specified files or directories. Directory is copied into this directory.

36.Linux rm command

Linux rm command is used to delete a file or directory.

37.Linux slocate command

The Linux slocate command finds files or directories.

slocate itself has a database that stores information about files and directories in the system.

38.Linux split command

The Linux split command is used to split a file into several.

This command splits a large file into smaller files. By default, it will be cut into a small file every 1000 lines.

39.Linux tee command

The Linux tee command is used to read the standard input data and output its contents into a file.

The tee command reads data from the standard input device, outputs its content to the standard output device, and saves it as a file.

40.Linux tmpwatch command

The Linux tmpwatch command is used to delete temporary files.

Execute the tmpwatch command to delete unnecessary temporary files. You can set the file expiration time in hours.

41.Linux touch command

The Linux touch command is used to modify the time attributes of a file or directory, including access time and change time. If the file does not exist, the system will create a new file.

ls -l can display the time record of the file.

42.Linux umask command

The Linux umask command specifies the default permission mask when creating a file.

umask can be used to set [permission mask]. [Permission mask] is composed of three octal numbers. After subtracting the permission mask from the existing access permissions, the default permissions when creating the file can be generated.

43.Linux which command

Linux which command is used to find files.

which command will search for files that meet the conditions in the directory set by the environment variable $PATH.

44.Linux cp command

The Linux cp command is mainly used to copy files or directories.

45.Linux whereis command

The Linux whereis command is used to find files.

This command will search for files that meet the conditions in a specific directory. These files should be raw code, binary files, or help files.

This command can only be used to find binary files, source code files and man pages. Generally, you need to use the locate command to locate files.

46.Linux mcopy command

The Linux mcopy command is used to copy MSDOS format files to Linux, or to copy MSDOS files from Linux to a disk.

mcopy can copy a single file to the specified file name, or copy several files to the specified directory. The source and destination files can be MSDOS or Linux files.

The mcopy command is an mtools tool command that can copy files in a DOS system or copy files between DOS and Linux operating systems.

47.Linux mshowfat command

The Linux mshowfat command is used to display the records of MS-DOS files in FAT.

mshowfat is the mtools tool command, which can display the record number of MS-DOS files in FAT.

48.Linux rhmask command

The Linux rhmask command is used to encrypt and decrypt files.

Execute the rhmask command to create an encrypted file, which is convenient for users to transmit the file on the public network without being arbitrarily stolen.

49.Linux scp command

The Linux scp command is used to copy files and directories between Linux.

scp is the abbreviation of secure copy. scp is a secure remote file copy command based on ssh login under Linux system.

50.Linux awk command

AWK is a language for processing text files and a powerful text analysis tool.

The reason why it is called AWK is because it takes the first characters of the family names of its three founders, Alfred Aho, Peter Weinberger, and Brian Kernighan.

The above is the detailed content of I haven't collected these 50 commands in Linux yet!. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template