{"id":9483,"date":"2021-08-23T14:36:08","date_gmt":"2021-08-23T14:36:08","guid":{"rendered":"https:\/\/linuxways.net\/?p=9483"},"modified":"2021-08-23T14:36:08","modified_gmt":"2021-08-23T14:36:08","slug":"how-to-view-and-create-hidden-files-and-directories-in-linux","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/ubuntu\/how-to-view-and-create-hidden-files-and-directories-in-linux\/","title":{"rendered":"How to View and Create Hidden Files and Directories in Linux"},"content":{"rendered":"<p>In the Linux system, there are a lot of hidden files which include mostly the user configuration file and the application files. You can also hide your files in your system if you are sharing them with some other person or due to any reason. However, remember that hiding the files does not protect your privacy, as anyone can see hidden files. Hiding files just makes the file invisible for the regular user exploring or listing the files. Also, it prevents the directory from being cluttered.<\/p>\n<p>In this post, we will cover how to view and create hidden files and directories in Linux OS.<\/p>\n<p><strong>Note<\/strong>: The command line and GUI procedure described here have been tested on <strong>Ubuntu 20.04 LTS.<\/strong><\/p>\n<h2>Create Hidden Files and directories in Linux<\/h2>\n<p>You can create hidden files and directories in Linux:<\/p>\n<ul>\n<li>Via Command Line<\/li>\n<li>Via GUI<\/li>\n<\/ul>\n<h3>Via Command Line<\/h3>\n<p>To hide a file or a directory in Linux, you simply need to add a dot (.) at the beginning of the filename. Let\u2019s say there is a file named <strong>testfile1.txt<\/strong>. To hide this file, we will have to rename the file to <strong>.testfile1.txt<\/strong>. You can use the command below to rename the file:<\/p>\n<pre>$ sudo mv testfile1.txt .testfile1.txt<\/pre>\n<p>After renaming the file, it will be hidden. Now, if you view this directory using the <em>ls<\/em> command, you will not be able to see the file.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"631\" height=\"121\" class=\"wp-image-9484\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-408.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-408.png 631w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-408-300x58.png 300w\" sizes=\"auto, (max-width: 631px) 100vw, 631px\" \/><\/p>\n<h3>Via GUI<\/h3>\n<p>If you prefer working graphically, you can hide your files via Linux File Manager. All you need is to just rename the file and insert a dot (.) at the beginning of the filename.<\/p>\n<p>For instance, to hide a file named <strong>testfile1.txt<\/strong>, right-click it and choose <strong>Rename<\/strong> option.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"764\" height=\"417\" class=\"wp-image-9485\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-409.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-409.png 764w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-409-300x164.png 300w\" sizes=\"auto, (max-width: 764px) 100vw, 764px\" \/><\/p>\n<p>Then add a dot (.) before a filename as can be seen in the below screenshot and then click <strong>Rename<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"760\" height=\"316\" class=\"wp-image-9486\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-410.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-410.png 760w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-410-300x125.png 300w\" sizes=\"auto, (max-width: 760px) 100vw, 760px\" \/><\/p>\n<p>The file will be hidden after renaming. Now, if you view this directory in the File Manager, you will not be able to see the file.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"669\" height=\"257\" class=\"wp-image-9487\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-411.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-411.png 669w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-411-300x115.png 300w\" sizes=\"auto, (max-width: 669px) 100vw, 669px\" \/><\/p>\n<h2>View Hidden Files and Directories in Linux<\/h2>\n<p>You can view hidden files and directories in Linux:<\/p>\n<ul>\n<li>Via command line<\/li>\n<li>Via File Manager toolbar (GUI)<\/li>\n<li>Via Keyboard shortcut (GUI)<\/li>\n<\/ul>\n<h3>Via Command Line<\/h3>\n<p>To view hidden files and directories in Linux, use this command in the Terminal:<\/p>\n<pre>$ ls -a<\/pre>\n<p>This command will display all the hidden files (whose names start with a . (dot) symbol) in your current Terminal directory.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1243\" height=\"97\" class=\"wp-image-9488\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-412.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-412.png 1243w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-412-300x23.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-412-1024x80.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-412-768x60.png 768w\" sizes=\"auto, (max-width: 1243px) 100vw, 1243px\" \/><\/p>\n<h3>Via File Manager Toolbar (GUI)<\/h3>\n<p>To view hidden files and directories in Linux File manager, click the three horizontal bars icon at the upper right corner of the File Manager. By doing so, a drop-down menu will show up. From there, check the <strong>Show Hidden Files<\/strong> check box.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"774\" height=\"403\" class=\"wp-image-9489\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-413.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-413.png 774w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-413-300x156.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-413-768x400.png 768w\" sizes=\"auto, (max-width: 774px) 100vw, 774px\" \/><\/p>\n<p>This will display all the hidden files (whose names start with a . (dot) symbol) in your current opened directory.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"782\" height=\"392\" class=\"wp-image-9490\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-414.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-414.png 782w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-414-300x150.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/08\/word-image-414-768x385.png 768w\" sizes=\"auto, (max-width: 782px) 100vw, 782px\" \/><\/p>\n<h3>Via Keyboard Shortcut<\/h3>\n<p>You can also view hidden files by using the keyboard shortcut.<\/p>\n<p>To view hidden files contained in a directory, open that directory in your File Manager. Then use the Ctrl+H keyboard shortcut to display the hidden files. To hide them again, use the same Ctrl+H keyboard shortcut.<\/p>\n<h2>Unhiding Files and Directories in Linux<\/h2>\n<p>You can unhide the files and directories in Linux:<\/p>\n<ul>\n<li>via Command Line<\/li>\n<li>via GUI<\/li>\n<\/ul>\n<h3>Via Command Line<\/h3>\n<p>To unhide a file or a directory, you only need to remove the leading dot (.) from its name.<\/p>\n<p>For instance, you have a hidden file named .<strong>testfile1.txt<\/strong>. To make this file unhidden, use the below command:<\/p>\n<pre>$ sudo mv .testfile1.txt testfile1.txt<\/pre>\n<p>This will rename the <strong>.testfile1.txt<\/strong> file to <strong>testfile1.txt<\/strong> and now the file will be unhidden.<\/p>\n<h3>Via GUI<\/h3>\n<p>To unhide a file graphically, open the File Manager in your Linux OS. Press Ctrl+H or check the <strong>Show Hidden Files<\/strong> box to view all the hidden files.<\/p>\n<p>Then select your desired hidden file and then using the right-click menu, remove the leading dot (.) from its name. For instance, if your hidden file is <strong>.testfile1.txt<\/strong>, it should be renamed to <strong>testfile1.txt<\/strong>.<\/p>\n<p>That is all there is to it! In this post, we covered how to create and view hidden files and directories in Linux via command line and GUI. We also covered how to unhide the files and directories in Linux through a keyboard shortcut, command line, and File Manager.<\/p>","protected":false},"excerpt":{"rendered":"<p>In the Linux system, there are a lot of hidden files which include mostly the user configuration file and the application files. You can also hide your files&hellip;<\/p>","protected":false},"author":1,"featured_media":9601,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[47,135],"class_list":["post-9483","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu","tag-directories","tag-files-2"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/9483","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=9483"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/9483\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/9601"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=9483"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=9483"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=9483"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}