How to view hidden files and folders on Linux

Different computer operating systems try to provide various means to protect their important files from any intentional or unintentional modification or deletion, through a number of procedures, one of which is to hide these files and keep them away from the eyes of users or intruders. But sometimes modifications may be required, so operating systems have made it possible to show it through specific steps.

The Linux operating system consists of hundreds of files and folders that are hidden by default. These files are known as hidden files or bitmaps because they always begin with a period (.). Let’s explore how you can view these hidden files on your Linux system. Check how to view hidden files on Mac.

Why do we have hidden files?

The concept of hidden files is simple but very important in Linux. They are mainly used to store configuration files or user settings. These files are usually used by system services, scripts, or other applications. For example, the .bash_logout script is executed whenever you log out of your Bash sessions. Another great example is the .gitignore file that Git uses to exclude certain files from being pushed to your remote repository.

Sometimes the concept of hidden files can be used to hide certain files from prying eyes from mostly non-advanced users.

View hidden files using the ls . command

command ls It is a widely used Linux command. In its simplest form, the command lists files and folders within a directory. However, the ls command does not list hidden files by default.

To unhide hidden files, you must use the flag -a which order ls Lists “all” files and folders (including hidden ones).

Navigate to your home directory with the command cd Make a list of all the files with the ls command.

ls -a


How to view hidden files and folders on Linux - Linux

As you can see, there are many files that start with a period (.). If you just run the command ls without the tag -a the output will not include hidden files.

If you don’t have any hidden files in your home directory, you can create one using the . command touch As follows:

touch .sample_hidden_file.txt

You can also create hidden folders with the command mkdir. You just have to make sure you use the dot at the beginning of the folder name.

You can tell ls Not to include a specific file or folder. For example, since you are in the home folder, you can run the following command to not list the desktop directory in the command output:

ls — hide=Desktop

Find hidden files using Find

In addition to ls you can use the command find As an alternative way to list hidden files and folders on Linux. The find command searches for files within a folder hierarchy.

To list or find all hidden files, you have to tell the command find Explicitly to list all files whose names begin with a period (.).

find . -name “.*” -maxdepth 1 2> /dev/null

Run the following command to find and only list hidden folders or directories:

find . -name “.*” -maxdepth 1 -type d 2> /dev/null

Show hidden files using GUI

You can also view hidden files from the GUI using your default file manager. Files from GNOME is the default file manager on Ubuntu Desktop. Previously, the Files app was known as Nautilus.

You can launch the application by pressing the key Super Then type “Files” in the search entry that appears. Click on the Files app and it will display the files in your home folder by default.

By default, your file manager does not display all hidden files. Click the menu icon in the upper-right corner and select Show hidden files. Hidden files and folders will now be visible.

How to view hidden files and folders on Linux - Linux

Alternatively, you can use the keyboard shortcut Ctrl + H To view hidden files on Linux as well.

Although you can’t view hidden files and folders by default, you can still interact with them just like other normal files. In fact, at some point, you may have to make configuration changes to a hidden file. Check how to hide files in hidden folder with no name and no icon.

Find files and folders on Linux

Knowing how to list and display all files including hidden files and folders is useful if you are thinking of Linux as your everyday operating system. Bitmaps play an important role in Linux as they are usually used to store configuration settings for installed applications.

In addition to the Files app, the . command can find Also locate directories efficiently on Linux. But there are some signs and options that you must learn to do so. Now you can check out the most important and must-have applications for Linux users.

#view #hidden #files #folders #Linux

امين المحمدي

رئيس الموقع و كاتب اخباري و كل ما هو جديد في العالم العربي و مدون بخبرة 7 سنوات في الكتابة على المواقع و المدونات و متابعة للشان العربي و العالمي من اخبار عربية و عالمية و رياضية.

اترك تعليقاً

لن يتم نشر عنوان بريدك الإلكتروني. الحقول الإلزامية مشار إليها بـ *

زر الذهاب إلى الأعلى