Linux file management commands

Order spelling in english describe
cat concatenate Concatenate files and print to standard output.
chattr change attribute The Linux chattr command is used to change file attributes.
chgrp change group Change the group to which a file or directory belongs.
chmod change mode Commands to Control User Permissions on Files
chown change owner Commands to set file owner and file association group.
cksum Check that the CRC of the file is correct. Ensure that files are not corrupted during transfer from one system to another.
cmp compare Compare two files for differences
diff different Diff for comparing files
diffstat According to the comparison results of diff, display statistics
file file Identify file types
find find Find files in the specified directory. Any string preceding the parameter will be treated as the name of the directory to be searched.
git The Linux git command is a file manager in text mode
gitview View the content of the file, it will display both hexadecimal and ASCII format codes
indent Used to adjust the format of C source code files. And formatted to facilitate programmers to read.
cut Display the text from num1 to num2 from the beginning of each line.
ln link files Create a synchronous link for a file in another location
less less can browse files at will, support page turning and search, support page up and page down
locate To find documents that meet the conditions, he will go to the database that saves the names of documents and directories to find documents or directories that meet the template style conditions. (locate is different from find: find is to find on the hard disk, and locate is only found in the /var/lib/slocate database.)
lsattr list attribute Used to display file properties
mattrib ? Change or display properties of MS-DOS files.
mc ? Provides a menu-based file management program
mdel ? Delete files in MSDOS format
mv move file Rename or move a file or directory to another location
from Reads the contents of the given file and displays the contents in octal characters.
paste Merge each file column-by-column.
patch The command is used to patch files, which is one of the upgrade methods of the Linux system core
rcp remote copy Copy a remote file or directoryrcp [email protected]:./testfile testfile #复制远程文件到本地
scp secure copy Used to copy files and directories between Linux. scp is encrypted, rcp is not encrypted, and scp is an enhanced version of rcp.
rm remove Used to delete a file or directory
slocate Find a file or directory. (slocate itself has a database, which stores information about files and directories in the system) slocate is a secure version of locate
split Divide a file into several.
tee Read data from standard input and output its contents to a file
tmpwatch Delete temporary files
touch Modify the time attributes of files or directories, including access time and change time. If the file does not exist, the system will create a new file.
umask
which The which command will search for qualified files in the directory set by the environment variable $PATH.
whereis This directive looks for matching files in a specified directory. These files should be source code, binaries, or help files. This command can only be used to find binary files, source code files and man pages,
copy copy file To use for copying files or directories.
awk AWK is a language for manipulating text files and is a powerful text analysis tool.

dev/null : In Unix-like systems, /dev/null is called a null device, which is a special device file that discards all data written to it (but reports that the write operation was successful), and reading it will immediately get an EOF.

Using cat $filename > /dev/null will not get any information, because we redirect the file information that should have been displayed through standard output to /dev/null.

使用 cat $filename 1 > /dev/null 也会得到同样的效果,因为默认重定向的 1 就是标准输出。 如果你对 shell 脚本或者重定向比较熟悉的话,应该会联想到 2 ,也即标准错误输出。

如果我们不想看到错误输出呢?我们可以禁止标准错误 cat $badname 2 > /dev/null

Guess you like

Origin blog.csdn.net/u013795102/article/details/116757414