The complete command should look like the following. To search a file with the locate command in your current directory, execute the following on your terminal.
Find files by date created update#
It is updated once a day but if you want to update it manually, run the following command on your terminal with root privileges. Locate is a quicker command and it relies on the database of the file system. Press Y from your keyboard when you are asked for confirmation. Login with root and execute the following command on your terminal.
Find files by date created install#
Second is the locate command you can use to search files and directories in your system.įirst of all, you have to install the locate utility in your Debian 11 machine. user vitux Finding Files Using a Locate Command Suppose you want to search a file in your current directory owned by vitux. The syntax of the command should be as follows. If you want to search for a file owned by a specific user, you can use the -user option. Suppose you want to find all files in your current directory that are more than 50 bytes or less than 50 bytes respectively, you have to execute one of the following commands. You have to execute the following command. Suppose you want to find all files in your current directory that are exactly 50 bytes. You can use the following suffix with their exact size. If you want to find files with a specific size, you can use the -size parameter. Suppose you want to find all the empty directories in your current directory, use the -d and -empty options in a find command as follows. Let’s say you want to find all the regular empty files in your current directory. If you want to search files with multiple extensions, use the c characters separated by commas. If you want to search for regular files in your current directory. Suppose you want to search regular files at Documents/Karim, execute the following command.