9/23/2023 0 Comments Find a file by name linuxThe second command searches the home directory of the user named john and returns the files that end with characters “png” which is modified in the last 4 days. The first command searches all the files in the files system and returns files that end with characters “png” which is modified in the last 5 days. $ find / -type d -iname "apk" Finding Files by Modification Timeįind command can also be used to search a file based on its last modification time.Įxample $ find / -name "*png" -mtime -5 $ find /home/john/ -name "png" -mtime -4 To ignore case sensitive search use the -iname option as shown below. $ find / -type d -name "apk" -ls How to Perform Case Insensitive Search?īy default, the search is case sensitive. If you want to search only the directories and skip the file names use the -type d option as shown below. Use the -ls option to list the present file in the ls output format. How to get a Detailed List of Files and Directories? To search for Projects directory present in the $HOME directory, use the following command. If the output shows the permission denied message, add 2>/dev/null at the end of the command.Įxample $ find / -type d -name "apk" 2>/dev/null How to Find Directory in Linux Named Projects in the Home Directory? $ find / -type d -name "apk" $ sudo find / -type d -name "apk" Suppose you want to find a directory named apk in the root file system, use the following command.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |