![]() ![]() In the next example, the user searches for all the files in the reports directory with the name monday. The -print option instructs find to output to the standard output the names of all the files it locates (you can also use the -ls option to list files in the long format). If you want find to display the filenames it has found, you simply include the -print option on the command line along with any other options. The find command also has options that merely perform actions, such as outputting the results of a search. To search for a file by name, you use the find command with the directory name followed by the -name option and the name of the file. ![]() The -name option has as its criteria a pattern and instructs find to search for the filename that matches that pattern. The find command can search for a file by name, type, owner, and even the time of the last update. find then searches within the directories listed and their subdirectories for files that meet these criteria. The find command takes as its arguments directory names followed by several possible options that specify the type of search and the criteria for the search. The find command enables you to perform such a search. Once you have a large number of files in many different directories, you may need to search them to locate a specific file, or files, of a certain type. One exception to the two-character rule is the find command, which performs searches of your filenames to find a file. The cp command stands for "copy" and copies a file, mv stands for "move" and renames or moves a file, rm stands for "remove" and erases a file, and ln stands for "link" and adds another name for a file, often used as a shortcut to the original. Centos find file full#The commands are shortened forms of full words, consisting of only two characters. If you have a large number of files, you can also search them to locate a specific one. Linux provides you with several file commands that enable you to search for files, copy files, rename files, or remove files (see Table 10-5 later in this chapter). File and Directory Operations: find, cp, mv, rm, and lnĪs you create more and more files, you may want to back them up, change their names, erase some of them, or even give them added names. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |