Hidden file and hidden directory

Last updated

In computing, a hidden folder (sometimes hidden directory) or hidden file is a folder or file which filesystem utilities do not display by default when showing a directory listing. They are commonly used for storing user preferences or preserving the state of a utility and are frequently created implicitly by using various utilities. They are not a security mechanism because access is not restricted – usually the intent is simply to not "clutter" the display of the contents of a directory listing with files the user did not directly create. [1] [2] [3] [4]

Contents

Unix and Unix-like environments

In Unix-like operating systems, any file or folder that starts with a dot character (for example, /home/user/.config), commonly called a dot file or dotfile, is to be treated as hidden – that is, the ls command does not display them unless the -a or -A flags (ls -a or ls -A) are used. [5] In most command-line shells, wildcards will not match files whose names start with . unless the wildcard itself starts with an explicit . .

A convention arose of using dotfiles in the user's home directory to store per-user configuration or informational text. Early uses of this were the well-known dotfiles .profile , .login , and .cshrc , which are configuration files for the Bourne shell and C shell and shells compatible with them, and .plan and .project , both used by the finger and name commands. [6]

Many applications, from bash to desktop environments such as GNOME, now store their per-user configuration this way, but the Unix/Linux freedesktop.org XDG Base Directory Specification aims to migrate user config files from individual dotfiles in $HOME to non-hidden files in the hidden directory $HOME/.config. [7]

Android

The Android operating system uses empty .nomedia files to tell smartphone apps not to display or include the contents of the folder. This prevents digital photos and digital music files from being shown in picture galleries or played in MP3 player apps. This is useful to prevent downloaded voicemail files from playing between the songs in a playlist, and to keep personal photos private while still allowing those in other folders to be shared in person with friends, family, and colleagues. The .nomedia file has no effect on the filesystem or even the operating system, but instead depends entirely on each individual app to respect the presence of the different files.

GNOME

In the GNOME desktop environment (as well as all programs written using GLib [8] ), filenames listed in a file named .hidden in each directory are also excluded from display. In GNOME's file manager, the keyboard shortcut Ctrl+H enables the display of both kinds of hidden files.

macOS

In addition to the "dotfile" behaviour, files with the "Invisible" attribute are hidden in Finder, although not in ls . The "Invisible" attribute can be set or cleared using the SetFile command; for example, invoking SetFile -a V jimbo will hide the file jimbo. [9] Starting in Mac OS X Snow Leopard, the chflags command can also be used; for example, chflags hidden jimbo will hide the file jimbo. [10]

DOS and MS Windows

In DOS systems, file directory entries include a Hidden file attribute which is manipulated using the attrib command. Using the command line command dir /ah displays the files with the Hidden attribute. In addition, there is a System file attribute that can be set on a file, which also causes the file to be hidden in directory listings. Use the command line command dir /as to display the files with the System attribute.

Under Windows Explorer, Hidden files and directories are, by default, not displayed - though they are still accessible by entering the full path into the explorer address bar. System files are displayed, unless they are also hidden. There are two options that enable the display of hidden files. The main "Hidden files and folders" option can be used to turn on the display of hidden files but this won't, on its own, display hidden system files. A second option, "Hide protected operating system files" additionally needs to be turned off in order for hidden system files to be shown. Hidden files are displayed with a slight transparency, so even when they are visible they are visually delineated from non-hidden files.

Under Windows Explorer, the content of a directory can also be hidden just by appending a pre-defined CLSID [11] to the end of the folder name. The directory is still visible, but its content becomes one of the Windows Special Folders. [12] However, the real content of this directory can still be seen using the CLI command dir.

Related Research Articles

A file manager or file browser is a computer program that provides a user interface to manage files and folders. The most common operations performed on files or groups of files include creating, opening, renaming, copying, moving, deleting and searching for files, as well as modifying file attributes, properties and file permissions. Folders and files may be displayed in a hierarchical tree based on their directory structure.

In Unix and Unix-like operating systems, chmod is the command and system call used to change the access permissions and the special mode flags of file system objects. Collectively these were originally called its modes, and the name chmod was chosen as an abbreviation of change mode.

ls Command to list files and directories in Unix and Unix-like operating systems

In computing, ls is a command to list computer files and directories in Unix and Unix-like operating systems. It is specified by POSIX and the Single UNIX Specification.

cd (command) Computer command in various operating systems

The cd command, also known as chdir, is a command-line shell command used to change the current working directory in various operating systems. It can be used in shell scripts and batch files.

In computing, a symbolic link is a file whose purpose is to point to a file or directory by specifying a path thereto.

A home directory is a file system directory on a multi-user operating system containing files for a given user of the system. The specifics of the home directory are defined by the operating system involved; for example, Linux / BSD (FHS) systems use /home/⟨username⟩ or /usr/home/⟨username⟩ and Windows systems since Windows Vista use \Users\⟨username⟩.

An environment variable is a user-definable value that can affect the way running processes will behave on a computer. Environment variables are part of the environment in which a process runs. For example, a running process can query the value of the TEMP environment variable to discover a suitable location to store temporary files, or the HOME or USERPROFILE variable to find the directory structure owned by the user running the process.

A path is a string of characters used to uniquely identify a location in a directory structure. It is composed by following the directory tree hierarchy in which components, separated by a delimiting character, represent each directory. The delimiting character is most commonly the slash ("/"), the backslash character ("\"), or colon (":"), though some operating systems may use a different delimiter. Paths are used extensively in computer science to represent the directory/file relationships common in modern operating systems and are essential in the construction of Uniform Resource Locators (URLs). Resources can be represented by either absolute or relative paths.

freedesktop.org (fd.o), formerly X Desktop Group (XDG), is a project to work on interoperability and shared base technology for free-software desktop environments for the X Window System (X11) and Wayland on Linux and other Unix-like operating systems. Although freedesktop.org produces specifications for interoperability, it is not a formal standards body.

<span class="mw-page-title-main">LiteStep</span>

LiteStep is a Windows Shell replacement for Windows 9x and up, licensed under the terms of the GNU General Public License (GPL).

<span class="mw-page-title-main">Windows Registry</span> Database for Microsoft Windows

The Windows Registry is a hierarchical database that stores low-level settings for the Microsoft Windows operating system and for applications that opt to use the registry. The kernel, device drivers, services, Security Accounts Manager, and user interfaces can all use the registry. The registry also allows access to counters for profiling system performance.

File attributes are a type of meta-data that describe and may modify how files and/or directories in a filesystem behave. Typical file attributes may, for example, indicate or specify whether a file is visible, modifiable, compressed, or encrypted. The availability of most file attributes depends on support by the underlying filesystem where attribute data must be stored along with other control structures. Each attribute can have one of two states: set and cleared. Attributes are considered distinct from other metadata, such as dates and times, filename extensions or file system permissions. In addition to files, folders, volumes and other file system objects may have attributes.

In computing, a file shortcut is a handle in a user interface that allows the user to find a file or resource located in a different directory or folder from the place where the shortcut is located. Similarly, an Internet shortcut allows the user to open a page, file or resource located at a remote Internet location or Web site.

alias (command) Command in various command line interpreters

In computing, alias is a command in various command-line interpreters (shells), which enables a replacement of a word by another string. It is mainly used for abbreviating a system command, or for adding default arguments to a regularly used command. alias is available in Unix shells, AmigaDOS, 4DOS/4NT, KolibriOS, Windows PowerShell, ReactOS, and the EFI shell. Aliasing functionality in the MS-DOS and Microsoft Windows operating systems is provided by the DOSKey command-line utility.

<span class="mw-page-title-main">Directory (computing)</span> File system structure for locating files

In computing, a directory is a file system cataloging structure which contains references to other computer files, and possibly other directories. On many computers, directories are known as folders, or drawers, analogous to a workbench or the traditional office filing cabinet. The name derives from books like a telephone directory that lists the phone numbers of all the people living in a certain area.

The NTFS file system defines various ways to redirect files and folders, e.g., to make a file point to another file or its contents without making a copy of it. The object being pointed to is called the target. Such file is called a hard or symbolic link depending on a way it's stored on the filesystem.

<span class="mw-page-title-main">ATTRIB</span>

In computing, ATTRIB is a command in Intel ISIS-II, DOS, IBM OS/2, Microsoft Windows and ReactOS that allows the user to change various characteristics, or "attributes" of a computer file or directory. The command is also available in the EFI shell.

chattr is the command in Linux that allows a user to set certain attributes of a file. lsattr is the command that displays the attributes of a file.

GVfs is GNOME's userspace virtual filesystem designed to work with the I/O abstraction of GIO, a library available in GLib since version 2.15.1. It installs several modules that are automatically used by applications using the APIs of libgio. There is also FUSE support that allows applications not using GIO to access the GVfs filesystems.

ranger (file manager) Text-based file manager

ranger is a free and open-source file manager with text-based user interface for Unix-like systems. It is developed by Roman Zimbelmann and licensed under the terms of the GNU General Public License. The program can accomplish file management tasks with a few keystrokes, and mouse input is optional. In conjunction with extensions including the rifle file opener and scope.sh, ranger can be scripted to open files with pre-defined programs, and to display a preview of the selected file by calling external programs.

References

  1. "What is a hidden file?". Microsoft.com. Archived from the original on 2015-04-03.
  2. "Configuring X: What are all those dotfiles for anyway?". Linux Focus. March 1998. Retrieved 2013-09-08.
  3. "Sample .bashrc and .bash_profile Files". Linux Documentation Project.
  4. Subodh Soni (2001-12-01). "Understanding Linux configuration files". IBM Developer. Retrieved 2019-04-26.
  5. "ls(1) - Linux man page". linux.die.net. Retrieved 2020-08-23.
  6. One user could lookup another by using the command along with the username (and hostname if not on the local host), and the finger service would respond with the other user's current status, and the contents of the .plan and .project files in that user's $HOME folder.
  7. Bastian, Waldo; Lortie, Ryan; Poettering, Lennart (November 24, 2010). "XDG Base Directory Specification" . Retrieved June 4, 2014.
  8. "GLib commit: Support for .hidden files" . Retrieved 2013-08-07.
  9. SetFile(1)    Darwin and macOS General Commands Manual
  10. chflags(1)    Darwin and macOS General Commands Manual
  11. "Canonical Names of Control Panel Items - Win32 apps". Microsoft.
  12. "The Secret BEHIND the Windows 7 GodMode". The Windows Club. 5 January 2010.