A Linux command a day (20): find -exec command
find is a very common Linux command, but we usually find more than just a look, there will be further operations, this is where exec comes into play.
find is a very common Linux command, but we usually find more than just a look, there will be further operations, this is where exec comes into play.
We often have to look for a file in linux, but we don’t know where it is, we can use some of the following commands to search for it.
The whereis command can only be used for program name searching, and only searches binary files (argument -b), man description files (argument -m) and source files (argument -s).
The find command under Linux searches for files in the directory structure and performs the specified operations.
locate allows users to quickly search for a specific file in the file system.
The tail command writes a file to standard output from the specified point.
head and tail are as easy to understand as its name, it is used to display the beginning or end of a certain amount of text blocks, head is used to display the beginning of the file to the standard output, and tail is of course to see the end of the file.
The less tool is also a tool for paging files or other output, and is supposed to be the orthodox linux tool for viewing the contents of files, which is extremely powerful.
The nl command is used on linux systems to calculate line numbers in files.
The purpose of the cat command is to concatenate files or standard input and print them.