

We can use ls to see the archive file that is created for us. The tar utility will create an archive file called “page_.” tar -cvzf page_: This is the command xargs is going to feed the file list from find to.xargs -o: The -0 arguments xargs to not treat whitespace as the end of a filename.This can be run either directly from the command line or from within a script with no change in format. This means that that filenames with spaces in them will be processed correctly. The for d in / will find all directories (the / ensures only directories and no files are found) the echo 'd' will print the directory's name the svnadmin verify 'd' will check the directory. This command will search through the current directory and all of its subdirectories for files that have the word file in their name.

Directories will not be listed because we’re specifically telling it to look for files only, with -type f. The print0 argument tells find to not treat whitespace as the end of a filename. For example, if you want to find all of the files that have the word file in their name, you can run the following command: find. name “*.page” -type f -print0: The find action will start in the current directory, searching by name for files that match the “*.page” search string. 2 Use the wildcard character to search for anything that matches the part of the query. If you know the exact name and directory of the file, you'd use this command to find it.

The command is made up of different elements. Finding by Name or Partial Name 1 Use find /path -iname filename to search for a file by exact name. name "*.page" -type f -print0 | xargs -0 tar -cvzf page_ Find command and other options in Linux find / -name file.txt -size +4M find /dev/ -type b -name sda find / -type d -name a. We’ll run this command in a directory that has many help system PAGE files in it. This is a long-winded way to go about it, but we could feed the files found by find into xargs, which then pipes them into tar to create an archive file of those files. We can use find with xargs to some action performed on the files that are found. That’s “almost the same” thing, and not “exactly the same” thing because there can be unexpected differences with shell expansions and file name globbing. This achieves almost the same thing as straightforward piping. To address this shortcoming the xargs command can be used to parcel up piped input and to feed it into other commands as though they were command-line parameters to that command.
