{"id":13139,"date":"2021-12-20T13:10:38","date_gmt":"2021-12-20T13:10:38","guid":{"rendered":"https:\/\/linuxways.net\/?p=13139"},"modified":"2021-12-20T13:10:38","modified_gmt":"2021-12-20T13:10:38","slug":"how-to-find-files-and-directories-in-linux-mint-20","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/mint\/how-to-find-files-and-directories-in-linux-mint-20\/","title":{"rendered":"How to Find Files and Directories in Linux Mint 20"},"content":{"rendered":"<p>You have been trying so hard to locate a file on your new Linux system but after hours of rambling on the terminal, it is still missing. Now you are just sitting there wondering what a nut job Linux is. Trust me, I cannot agree with you more! Linux, at times, does feel like a puzzle where new users easily and often get lost. But do not worry, we are here to help you. Together, we will locate that mischievous little file of yours that is so good at hiding.<\/p>\n<p>Let\u2019s begin our hunt!<\/p>\n<p>We have used <a href=\"https:\/\/linuxmint.com\/edition.php?id=288\">Linux Mint 20.2 Cinnamon<\/a> to show <a href=\"https:\/\/linuxways.net\/de\/ubuntu\/3-ways-for-finding-files-and-directories-in-linux\/\">how files and directories can be located<\/a> using different methods and commands.<\/p>\n<h2>How To Locate a File in Linux using File Manager<\/h2>\n<p>The file manager of Cinnamon desktop environment is known as Nemo.<\/p>\n<p>The developer of the project \u201cnemo\u201d Gwendal Le Bihan named it after Jules Verne&#8217;s famous character Captain Nemo, who is the captain of the Nautilus. As the about section of Nemo says, it allows you to organize files and directories both on your local machine and online.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"483\" height=\"364\" class=\"wp-image-13140\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-376.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-376.png 483w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-376-300x226.png 300w\" sizes=\"auto, (max-width: 483px) 100vw, 483px\" \/><\/p>\n<p>This interface is pretty much the same as of Window\u2019s file system. You can dive into any of the folders to access your files.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"574\" class=\"wp-image-13141\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-377.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-377.png 800w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-377-300x215.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-377-768x551.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/p>\n<p>Here we have the file system of Linux that looks pretty scary at first glance, but no need to worry, as you won\u2019t have to deal with most of it. These are just folders with files which in case of need, can be easily located.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"574\" class=\"wp-image-13142\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-378.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-378.png 800w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-378-300x215.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-378-768x551.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/p>\n<h2>How To Find a File in Linux using Terminal Window<\/h2>\n<p>I know you are not a fan of Linux command line. Well, nobody is. And I am sorry to break it to you that you can never escape that black little window as long as you are going to work with Linux, no matter how much it spooks you. But no need to worry. It may seem tricky in the beginning but after learning a few commands you will be able to explore the whole file system easily.<\/p>\n<p>Let\u2019s start exploring!<\/p>\n<h3>Locate<\/h3>\n<p>The quickest and simplest way to search for files and directories by their names is with the help of locate command.<\/p>\n<p>This is the syntax of the command:<\/p>\n<pre><strong>locate {filename}<\/strong><\/pre>\n<p>Here is an example in which we tried to locate a file with the name resolv.conf in a specific directory. As you can see, the command returns all the files that have resolv.conf in their names in that directory.<\/p>\n<pre><strong>Locate resolv.conf<\/strong><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"508\" height=\"105\" class=\"wp-image-13143\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-379.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-379.png 508w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-379-300x62.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-379-501x105.png 501w\" sizes=\"auto, (max-width: 508px) 100vw, 508px\" \/><\/p>\n<p>To explore this command more and see all options that are available for locate, type man locate in your terminal.<\/p>\n<h3>Find<\/h3>\n<p>Find is a very important tool in Linux. It allows you to search files and directories and perform operations on them. It also lets you search by file, folder, name, creation date, modification date, owner and permissions.<\/p>\n<p><strong>Looking for a specific file?<\/strong><\/p>\n<p>If you want to find a particular file, the following command will look for it in current and sub-directories.<\/p>\n<p>This is the syntax of the command:<\/p>\n<pre><strong>find . -name {filename}<\/strong><\/pre>\n<p>In the example, we have searched for a file with the name resolv.conf.<\/p>\n<pre><strong>find . -name resolv.conf<\/strong><\/pre>\n<p>The command returns with the file in the current directory.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"421\" height=\"33\" class=\"wp-image-13144\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-380.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-380.png 421w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-380-300x24.png 300w\" sizes=\"auto, (max-width: 421px) 100vw, 421px\" \/><\/p>\n<h4>Looking for files with a specific format?<\/h4>\n<p>If you want to see all files with a specific format in a particular directory, the following command will be used.<\/p>\n<p>This is the syntax of the command:<\/p>\n<pre><strong> find \/home -name *.jpg<\/strong><\/pre>\n<p>In this example, the command returns all the files that have the .PNG format in the specified directory.<\/p>\n<pre><strong>find \/home\/azifa\/Pictures -name *.png<\/strong><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"503\" height=\"240\" class=\"wp-image-13145\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-381.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-381.png 503w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-381-300x143.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-381-501x240.png 501w\" sizes=\"auto, (max-width: 503px) 100vw, 503px\" \/><\/p>\n<h4>Looking for empty files?<\/h4>\n<p>The following command returns all the files that are empty within the specified directory.<\/p>\n<p>This is the syntax of the command:<\/p>\n<pre><strong>find . -type f -empty<\/strong><\/pre>\n<p>In the example, the command returns an empty file present in the specified directory.<\/p>\n<pre><strong>find . -type f -empty<\/strong><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"425\" height=\"35\" class=\"wp-image-13146\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-382.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-382.png 425w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-382-300x25.png 300w\" sizes=\"auto, (max-width: 425px) 100vw, 425px\" \/><\/p>\n<h4>Use wildcards to look for files<\/h4>\n<p>This is the syntax of the command:<\/p>\n<pre><strong>find . -name '*re'<\/strong><\/pre>\n<p>In this example, the command returns with all the files with names ending with re.<\/p>\n<pre><strong>Find . Name \u2018*re\u2019<\/strong><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"447\" height=\"103\" class=\"wp-image-13147\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-383.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-383.png 447w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-383-300x69.png 300w\" sizes=\"auto, (max-width: 447px) 100vw, 447px\" \/><\/p>\n<h3>Whereis<\/h3>\n<p>The <a href=\"https:\/\/linuxways.net\/de\/centos\/linux-whereis-command\/\">whereis<\/a> command is not everyday use command. It is used to locate the binary, source, and manual page files for a command. It is mostly used to find executables of an application, its manual pages, and configuration files.<\/p>\n<p>This is the syntax of the command:<\/p>\n<pre><strong>Whereis {applicationnname}<\/strong><\/pre>\n<p>In this example, we have used flameshot application.<\/p>\n<pre><strong>whereis flameshot<\/strong><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"691\" height=\"35\" class=\"wp-image-13148\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-384.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-384.png 691w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-384-300x15.png 300w\" sizes=\"auto, (max-width: 691px) 100vw, 691px\" \/><\/p>\n<h3>Grep<\/h3>\n<p><a href=\"https:\/\/linuxways.net\/de\/centos\/15-examples-of-using-grep-command-in-linux\/\">Grep<\/a> is a Linux command-line utility that is used to find a string of characters in a specific line. When the match is found, it prints the line in the terminal window.<\/p>\n<p>This is the syntax of the command:<\/p>\n<pre><strong>grep {string} {file name}<\/strong><\/pre>\n<p>In this example, the string you has been used and the filename is file.txt.<\/p>\n<pre>grep you file.txt.<\/pre>\n<pre><strong>Grep you file.txt<\/strong><\/pre>\n<p>As visible, Whereis command returns all the lines that have the word you in them.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"801\" height=\"48\" class=\"wp-image-13149\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-385.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-385.png 801w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-385-300x18.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-385-768x46.png 768w\" sizes=\"auto, (max-width: 801px) 100vw, 801px\" \/><\/p>\n<p>In this document, we explored four commands (find, locate, whereis, grep) with the help of different examples to help you easily find files and directories in your linux mint system.<\/p>","protected":false},"excerpt":{"rendered":"<p>You have been trying so hard to locate a file on your new Linux system but after hours of rambling on the terminal, it is still missing. Now&hellip;<\/p>","protected":false},"author":1,"featured_media":13217,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[47,135,129],"class_list":["post-13139","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mint","tag-directories","tag-files-2","tag-linux-mint-20"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/13139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=13139"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/13139\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/13217"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=13139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=13139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=13139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}