find command in linux 1

find command in linux

find /home/linuxize -type f -name document.pdfCopy

Here is what the above code is Doing:
1. The find command searches for files in the /home/linuxize directory.
2. The -type f option tells find to only look for files.
3. The -name option tells find to look for files with the name document.pdf.
4. The -exec option tells find to execute the command that follows.
5. The {} \; part tells find to replace the {} with the file name and execute the command.
6. The cp command copies the file to the /home/linuxize/backup directory.

Similar Posts