![c shell solaris find files by date c shell solaris find files by date](https://developerpublish.com/wp-content/uploads/2020/11/image-5.png)
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. The complete command should look like the following. 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. c denotes the type of file and they are following.To search for a specific file type, use -type option. iname test.txt Find files by file type, e.g. The complete command should look as follows. If you want to search a file and want to ignore the case, use -iname switch. name test1.txt Ignore case when searching for files If you want to search a specific file in the current directory you are working on. Advertisement find Documents/Karim -name test1.txt Suppose, you want to search a file named test1.txt at Documents/Karim. find Documents/Karim/*.txt Find files by nameĪlternatively, you can use -name switch when you want to search a file by name. Suppose you want to search all text files at the path of Documents/Karim, the complete command should look like. Now if you want to find all text files in your current or specific directory, the respective commands should look as follows. find Documents/test.txt Find files by file extension Suppose you want to search a file named ‘test.txt’ in Documents, the complete command should be as follows. The complete command should look like, find Now, if you want to locate the file in a specific directory. This will search the file in the current directory you are working on. If you want to find a file using the find command, execute one of the following on your terminal. Searching for Files and Directories using the find Command Search file in the current directory If you want to search for files by their content instead of the file name, have a look at the grep command instead. But the commands should be the same on other Linux distributions. This means that the locate command is usually faster, but it assumes that the file being searched for is in its index database, and that database is usually created at night, so newer files are not found by the locate command. The difference between the two commands is that find performs a search in real-time and locate uses an indexed database for the search. The two commands are the find command and the locate command. In this article, I briefly describe two commands in detail with useful examples to search for files with the terminal. But before you are able to edit a file, you must be able to locate it in your system. Basically, everything in Linux is a file.