How to use the find command in Linux

Intro

Find utility searches for files in a directory. Basically, files can be found under Linux in many different ways. Using the find utility is one of the best ways to find files. The find utility has a huge number of parameters that can be set so that Linux finds exactly those files that you were searching for.

Syntax
find  where_to_look  criteria  which_file_want_to_search

Example
$ find / -name report 2>/dev/null

/Start searching from the root directory
-nameGiven search text is the filename rather than any other attribute of a file
reportFile name for which we are looking
 
Note
2> /dev/null is not related to find utility. Here, 2 indicates the error stream in Linux, and /dev/null is the device where anything you send simply disappears i.e. Above example discard all error messages.
You may want to see
How to sort contents of a file

The sort command is used to sort the contents of a file. You can sort the data in a text Read more

How to use sed command in Linux

sed, short for "stream editor", allows you to filter and transform text. A stream editor is used to perform basic Read more

How to use crontab in Linux

Cron is the system process that will automatically perform tasks for you according to a set schedule. The schedule is Read more

How to extract archive file in Linux

To extract archive file in Linux, you can use the tar command, used for extracting content from the archive files. "tar" Read more

Leave a Reply

Your email address will not be published. Required fields are marked *