
Refer to the output screen below: grep -v flag command In this case the second and the fifth line contain the string printed it’s not printed to the output screen.

This option lists all lines that do not contain the particular string or pattern you search for. What if we want to do the opposite that’s, print all lines that do not match the search pattern. If you’re running CentOS, see below the command for installing locate on your system. I am running an Ubuntu distro from the Debian family.
Find corrupted files unix install#
Install locate command on Ubuntu and Debian $ sudo apt update $ sudo apt install locate Installing locateįrom my screenshot above, the system is reporting that my locate package was automatically installed and it’s no longer required. If locate command is not installed, you can easily install it using the package manager of your distro. Otherwise, it will return something like locate command not found. If it is installed, the system will display locate: no pattern to search for specified.

To check whether the locate utility is installed, open up your terminal, type locate and press Enter.

Installing locate commandĭepending on the Linux distribution and how the system is configured, the locate package may or may not be pre-installed on your Linux system. When using the locate search command for the first time that is, if you have just done setting up your Linux OS such as Ubuntu, you need to install the command before it can be found to return results for any search you want to do. The locate command is the quickest and simplest way to search for files and directories by their names. The first command on our list is the locate command.
