What is the command to hide a file in Unix?

I wanted to add classpath to my JDK. While searching a way to do it I noticed everyone open .profile file using terminal. But when I want to open and edit it with a text editor I couldn't see that file in Home folder.

Can someone tell me why is this. And also if possible how can I access .profile in home folder the GUI way.

2

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]

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]

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.

  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.

  • Bellevue Linux Users Group: Hidden files in Unix-like operating systems at the Wayback Machine (archived October 17, 2007)
  • Computer Hope: Microsoft DOS attrib command
  • .NOMEDIA file

Retrieved from "https://en.wikipedia.org/w/index.php?title=Hidden_file_and_hidden_directory&oldid=1095690921"

Use the mkdir command to create a new folder. To make that folder hidden, add a dot (.) at the beginning of the name, just like you would when renaming an existing folder to hide it. The touch command creates a new blank file in the current folder.

You can also mark a file as hidden using a graphical interface.

  1. Right-click the file you want to hide.
  2. Then, select Rename.
  3. Make the file hidden by placing a period at the beginning of the filename.

12 июн. 2020 г.

To create a hidden folder, follow the steps:

  1. Open File Manager app on your smartphone.
  2. Look for the option to create a new folder.
  3. Type desired name for the folder.
  4. Add a dot (.) …
  5. Now, transfer all the data to this folder you want to hide.
  6. Open the file manager app on your smartphone.
  7. Navigate to the folder you want to hide.

28 апр. 2020 г.

Psssst:  How do I log into my help desk administrator?

What is the command to hide a file in Linux?

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. Using GUI method, the same idea applies here, just rename the file by adding a .

Which command will list the hidden files in UNIX?

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.

On Linux, hidden files are files that are not directly displayed when performing a standard ls directory listing. Hidden files, also called dot files on Unix operating systems, are files used in order to execute some scripts or to store configuration about some services on your host.

How do you hide a folder?

How to make a hidden file or folder on a Windows 10 computer

  1. Find the file or folder you want to hide.
  2. Right-click it, and select “Properties.”
  3. In the menu that appears, check the box that’s labeled “Hidden.” …
  4. Click “OK” at the bottom of the window.
  5. Your file or folder is now hidden.

1 окт. 2019 г.

From the interface, tap on the Menu at the top left corner of the screen. There, scroll down and check “Show hidden files”. Once checked, you should be able to see all the hidden folders and files. You can hide the files again by unchecking this option.

How do I make a file name invisible?

Here’s how:

  1. Open File Explorer, go to location where you want to put invisible folder to.
  2. Press Ctrl+Shift+N to create a new folder.
  3. Give an invisible name. Press and hold Alt key while typing in the number 0160. Then hit the Enter key, you will see a folder with no name will be created.

How do I find hidden apps on Android?

If you want to know how to find hidden apps on Android, we’re here to guide you through everything.…

How to Discover Hidden Apps on Android

  1. Tap Settings.
  2. Tap Apps.
  3. Select All.
  4. Scroll through the list of apps to see what’s installed.
  5. If anything looks funny, Google it to discover more.

20 дек. 2020 г.

How do I show all directories in Linux?

The ls command is used to list files or directories in Linux and other Unix-based operating systems. Just like you navigate in your File explorer or Finder with a GUI, the ls command allows you to list all files or directories in the current directory by default, and further interact with them via the command line.

How do I list files in Linux?

15 Basic ‘ls’ Command Examples in Linux

  1. List Files using ls with no option. …
  2. 2 List Files With option –l. …
  3. View Hidden Files. …
  4. List Files with Human Readable Format with option -lh. …
  5. List Files and Directories with ‘/’ Character at the end. …
  6. List Files in Reverse Order. …
  7. Recursively list Sub-Directories. …
  8. Reverse Output Order.

How do you create a file in Linux?

  1. Creating New Linux Files from Command Line. Create a File with Touch Command. Create a New File With the Redirect Operator. Create File with cat Command. Create File with echo Command. Create File with printf Command.
  2. Using Text Editors to Create a Linux File. Vi Text Editor. Vim Text Editor. Nano Text Editor.

Psssst:  Can you replace Chrome OS with Windows?

27 июн. 2019 г.

What is a Dotfile?

Dotfiles are plain text configuration files on Unix-y systems for things like our shell, ~/. … They are called “dotfiles” as they typically are named with a leading . making them hidden files on your system, although this is not a strict requirement.

Bash list only hidden files. As you see output includes all the files including hidden dot files. To just display dot files use any one of the following command: $ ls -a | egrep ‘^.

Files that exist on a computer, but don’t appear when listing or exploring, are called hidden files. A hidden file is primarily used to help prevent important data from being accidentally deleted. Hidden files should not be used to hide confidential information as any user may view them.