Hide hidden files linux

An Easy Way to Hide Files and Directories in Linux

Do you occasionally share your Linux desktop machine with family members, friends or perhaps with colleagues at your workplace, then you have a reason to hide certain private files as well as folders or directories. The question is how can you do this?

In this tutorial, we will explain an easy and effective way to hide files and directories and view hidden files/directories in Linux from the terminal and GUI.

As we’ll see below, hiding files and directories in Linux is so simple.

How to Hide Files and Directories in Linux

To hide a file or directory from the terminal, simply append a dot . at the start of its name as follows using the mv command.

Hide File in Linux Terminal

Using GUI method, the same idea applies here, just rename the file by adding a . at the start of its name as shown below.

Hide File in Linux Using File Manager

Once you have renamed it, the file will still be seen, move out of the directory and open it again, it will be hidden thereafter.

How to View Hide Files and Directories in Linux

To view hidden files, run the ls command with the -a flag which enables viewing of all files in a directory or -al flag for long listing.

View Hidden Files in Linux Terminal

From a GUI file manager, go to View and check the option Show Hidden Files to view hidden files or directories.

View Hidden File Using File Manager

How to Compress Files and Directories with a Password

In order to add a little security to your hidden files, you can compress them with a password and then hide them from a GUI file manager as follows.

Select the file or directory and right click on it, then choose Compress from the menu list, after seeing the compression preferences interface, click on “Other options” to get the password option as shown in the screenshot below.

Once you have set the password, click on Create.

Compress Files with Password in Linux

From now on, each time anyone wants to open the file, they’ll be asked to provide the password created above.

Enter Password to View Files

Now you can hide the file by renaming it with a . as we explained before.

That’s it for now! In this tutorial, we described how to easily and effectively hide files and directories and view hidden files/directories in Linux from the terminal and GUI file manager. Make use of the feedback form below to share any thoughts with us.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

Читайте также:  Развертывание с помощью служб развертывания windows

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

We are thankful for your never ending support.

Источник

How to Easily Hide Files and Folders in Linux

Have you ever wanted to hide a file or folder on your Linux file system but have no idea how to do it? Don’t worry, this is not as complicated as it sounds and can be done rather quickly and efficiently. In this guide we’ll go over the simple ways you can effectively hide files and folders in Linux.

Along with hiding things, we’ll go over how to reveal these hidden items in both the terminal as well as file managers in general.

Hiding a file/directory

Hiding a file in the Linux file system is the result of a longstanding bug in Unix-like operating systems. After a while, many people adopted this and considered it a feature. The method for hiding files or a directory is much simpler than on something like Windows. To hide an entire file from view in Linux all that is required is to rename the file and put some text in front of it.

Find a file or directory you wish to hide with the file manager, and select it. Press F2 (or right-click and select “rename”). Next, place a . directly in front of the file name. Since most file managers hide hidden files by default, the renamed file or directory is now invisible. Do note that files placed in a hidden directory will also be hidden by default.

Viewing hidden files and folders in the terminal

The quickest way to view hidden files and folders in any part of the Linux file system is to use the terminal. Yes, it is true that all file managers currently on the Linux platform have an option to “view hidden files,” but this way is for those who prefer to use the terminal to get around. To view these files, start off by using cd to enter the particular directory where you have hidden your files/folders. Next, use the following command to display all the files, be it visible or hidden.

The ls command is used to display all items in a current directory, but it doesn’t show hidden items. To view hidden items, the -a switch is needed.

Viewing hidden files and folders in the file manager

File managers on Linux are not created equal. Settings in one manager will differ in another. Regardless of this fact, they all manage to have roughly equivalent features, especially when it comes to showing hidden files. The ability to view hidden files in file managers on Linux is usually tucked away under “View.” To enable this quickly, without digging for settings, try the keyboard shortcut “Ctrl + H” first.

Secure ways to hide files

Using . to hide files and folders is simple and straightforward, but it is also extremely insecure. It is useful if you just want to keep an unimportant files or folders away from plain sight. For security, here are some other ways to hide files/folders:

1. Compressing the files/folders with a password

If you have folders and files that need to be hidden for security’s sake, consider this method instead. First, find the file or folder in the file manager you wish to hide and right-click to compress it. Select “compress.” This brings up the compression tool. By default, “.tar.gz” is selected. Select “.zip” in the drop-down menu.

Читайте также:  Как сменить значки mac os

Under filename, place a . in front to hide it, then enter the filename of the archive.

Then, select the location you wish the hidden archive to be saved to by clicking “location” and browsing for the correct directory. After that, click “other options” and enter a secure password. With all the information filled out, click the “Create” button. Soon after, your hidden passworded archive will be created!

2. Create an encrypted directory

There are plenty of tools that you can use to create an encrypted directory in Linux, but the easiest I found is to use Gnome Encfs Manager. Similarly, you can create your encrypted directory with a . in front of the file name, and your files and folders will be secure and hidden at the same time.

3. Hide file in images

If you feel that using the . method is too insecure, another way is to hide your files in an image using a method called Steganography. Here are three ways you can hide confidential data inside images.

Conclusion

Hiding files and folders on Linux is useful for many reasons. Developers use this feature to tuck away configuration files so that they stay out of the way of normal users. You can hide files and folders just to keep them out of plain sight or to secure and hide your confidential data.

Do you hide files and folders on Linux? Tell us why or why not below!

Derrik Diener is a freelance technology blogger.

Источник

This post and this website contains affiliate links. See my disclosure about affiliate links.

how to show or display hidden files in linux

In Linux, as you should already know, there is the concept of hidden files and hidden folders. It is not exactly hidden in the literal sense, but all that means is that the file managers and file system utilities will not display these types of files (or folders) by default.

The hidden file concept is not a security feature and it does not provide any extra protection compared to other files. However, there are a couple of reasons (or benefits) for these kind of files.

  • These files are usually a mechanism to store user preference or system files that are not modified by user regularly.
  • They are also used by different utilities to store configuration and state of the programs. As these files are not actively used by user on a normal day-to-day basis, it makes sense to hide them in most cases.
  • It also allows the file manager utilities to prevent cluttering up the user interface and provide a soft division between user files and user specific configuration files.

Any file or folder whose name start with a dot (.) is a hidden file, also known as dot file. These files will not be displayed by default when listing the contents of a folder. These files can be referenced just as any file, by using the name of the file (including the dot).

We will see how you can view these files using the most popular directory listing commands and file managers.

ls command

The ls command is probably the most used command line utility and it lists the contents of the specified directory. In order to display all files, including the hidden files in the folder, use the -a or –all option with ls.

This will display all the files, including the two implied folders: . (current directory) and .. (parent folder). If you want to omit the display of these two folders, then use the -A or –almost-all option.

Читайте также:  Сочетания клавиш windows 10 excel

This is quite useful, if you are using the output of the command as input to some other script. You probably do not the script to loop in the current folder (depending on the script).

If you want to display only the hidden files, then you will need to specify a regular expression with the ls command., the following will display just the hidden file and folders.

The -d option is to ensure that the directory contents are not printed out for each directory in the list.

dir command

Another popular command used to display directory contents is dir. Almost all options for dir is the same as ls, which means everything that was shown for ls in the previous section will work for dir as well.

will display all files, hidden files and the implied folders (. and ..).

will display all files, folders including the hidden folders but excluding both . and ..

will display just the hidden files and hidden folders.

KDE File Manager (dolphin)

The default file manager in KDE is Dolphin. The default setting in Dolphin is not to display hidden or dot files. There are couple of different ways you can enable the option here.

The easiest is probably the keyboard shortcut Alt+. (Alt and dot). You can easily enable the display and disable it again using the same shortcut.

The other option is using the menu option. Click on the Hamburger icon on the menu bar (for Settings/Configuration). In the drop down menu, you will see the option named Show Hidden Files. Click and select it on it to enable the display of hidden files.

You can leave that option selected, if you want to always display the hidden files. The other commonly used file manager is Konqueror, which uses embedded dolphin to display the file system, as well.

Gnome File Manager (files or nautilus)

The default file manager in Gnome on most distros is Gnome Files. It was formerly known as Nautilus. The keyboard shortcut to display hidden files in Nautilus is Ctrl+H. This shortcut can be used to toggle the display of dot files.

The other option is to change it in the configuration. Open Edit -> Preferences and navigate to the Views tab. Select the option Shown hidden and backup files. In modern or latest versions, this option is in Files -> Preferences menu.

Xfce File Manager (thunar)

Xfce is a popular light weight desktop environment, and the default file manager is thunar. The keyboard shortcut is display hidden files is again Ctrl+H just as with Gnome File Manager.

You can find the option with in the menu as well, as with other file managers. Click on View in the menu bar, and select Show Hidden Files option.

Midnight Commander

Midnight Commander is a command line based file manager which has a loyal following. The keyboard shortcut to display dot files here is Alt + . (Alt-Period).

There is also a configuration setting with in Panel Options. Open Options from the menu and then Panel Options. Select the option Show Hidden Files.

No matter which file manager you are using, there should be an option to display hidden files. Most times, it is disabled by default and as it should be. You can try first by right clicking and checking the context menu. The next place to check is either the Settings or Preferences dialog which is often in the Edit or View menu.

Источник

Оцените статью