Show hidden files in mac os x. How to hide files on Mac

Home / Breakdowns

Security is the main reason why certain files and folders are hidden in macOS. Some data must remain invisible to avoid third-party interference. By default, service and system files, caches, logs and settings installed applications hidden.

It goes without saying that deleting or changing system files can put the operating system at risk, so why is it necessary to show hidden files? Accessing these files allows you to delete the remaining data of already deleted applications. You can create browser bookmarks and troubleshoot applications.

There are several ways to view hidden files on your Mac device. This guide will help you access hidden Mojave or Sierra files and folders.

Use Finder

This is the simplest and quick way viewing hidden files and folders.

Open the application Finder and navigate to the desired directory. While in a specific folder, press on your keyboard Shift + Command + > to make hidden files and folders visible. If you want to hide them again, just press this key combination again and they will disappear.

Display via Terminal

You can use commands in to directly control the system, avoiding navigating through Finder menus and tabs.

Click cmd + Space, enter "" and open it. After that, enter the following script command line:

defaults write com.apple.Finder AppleShowAllFiles TRUE

Click Return and enter the following command " killall finder".

To hide files back, use the command:

defaults write com.apple.Finder AppleShowAllFiles FALSE ; killall finder

Like this, without a third party software, you can show hidden files and folders on macOS. Be very careful to avoid tampering with operating system files. And after completing the actions, do not forget to hide them back.

After working with MacOS X for some time, you may at some point discover that the system is hiding something from you. You can notice this either by specifically executing the `ls -la` command in the terminal, or by connecting some removable storage medium (flash, hdd) that you worked with from MacOS X to another system (for example, MS Windows) - you probably You will be surprised that there are many more files and folders than you expected to see.

If you've been working with computers for a long time, you know that operating systems often hide from the user's eyes service information that they need to work, but is useless to the person working with the system. In the case of MacOS X, this applies to directory and application configuration files, files deleted to the Recycle Bin, Spotlight indexing data, and a number of other files. The rule also applies that any file whose name has a dot (.) as the first character is hidden.

But what if you still need to see hidden files? For example, in text editor do you need to change the instructions in the .htaccess file (this file may contain some behavioral settings for the Apache web server)? I can offer 3 ways to solve this issue.

Option 1 - Terminal.app
, then copy the command there

defaults write com.apple.Finder AppleShowAllFiles 1 && killall Finder

You will now be able to see hidden files in both Finder and dialog boxes opening files in various applications.
To hide the files again, paste the line into the terminal

defaults write com.apple.Finder AppleShowAllFiles 0 && killall Finder

Option 2 - write a small utility
Open the Script Editor (Script Editor.app) and place the following AppleScript statements in its window

set vis to do shell script "defaults read com.apple.Finder AppleShowAllFiles"
if vis = "0" then
do shell script "defaults write com.apple.Finder AppleShowAllFiles 1"
else
do shell script "defaults write com.apple.Finder AppleShowAllFiles 0"
end if
tell application "Finder" to quit
delay 1
tell application "Finder" to activate

After this, save the file as a Program (first come up with a name) in some directory (you must leave all program parameters unselected). Now find your new program in Finder and run it: it will automatically change the file display mode to the opposite. Those. if you have disabled the display of hidden files, the program will enable it; and vice versa.

Option 3 - download a ready-made solution
I have already completed the steps from the second method I proposed, and here you can download the resulting utility reVisible.app

Save this file anywhere convenient for you and run it whenever necessary.

In the future, I will try to post all such utilities immediately in compiled form.

Everything secret will become clear.

macOS, like any other operating system has hidden files and folders. Typically, these are system files that are hidden for security reasons. However, experienced users often resort to methods that allow them to display hidden files - for example, for complete removal applications, to configure some system parameters or for other operations.

In this article we will talk about three ways, which will allow you to display all hidden files and folders in macOS in no time.

Method one - through the Terminal application

Command line lovers can resort to an old but proven method.

  • Launch the Terminal application in any convenient way.

  • In the command line window, enter and confirm the following command:

defaults write com.apple.Finder AppleShowAllFiles YES

  • The file manager will restart. After this, all hidden files will be shown. To hide the files again, just use another command:

defaults write com.apple.Finder AppleShowAllFiles NO

Method two - through a special script

For those who prefer to automate any work, it makes sense to take a closer look at another option - enabling the display of hidden files through a special macro. To create it, we will resort to the help of the “Script Editor”.

  • We launch the application for creating scripts.
  • IN context menu select “File” -> “New”.

  • In the next window we will need to paste the script code. It looks like this:

set dialogResult to display dialog “Show hidden files…” buttons (“YES”, “NO”)
copy the dialogResult as list to (buttonpressed)
if buttonpressed = “YES” then
do shell script “defaults write com.apple.finder AppleShowAllFiles -bool true”
else
do shell script “defaults write com.apple.finder AppleShowAllFiles -bool false”
end if
do shell script “killall Finder”

  • We save the created macro as an application by going to the “File” -> “Save” menu.

Now, when we launch our created program, we can turn on or off the display of hidden files in one click. For convenience, the script can be placed directly in the dock panel.

Method three - using hot keys

If you are looking for the simplest method, then this option is definitely for you. This method appeared only in macOS High Sierra - therefore it will not work on earlier versions of the OS.

  • In the desired directory, press the key combination Shift + Command + .(dot).

Immediately after this, all hidden files and folders will be displayed on the screen. To turn off their display, just use the above key combination again.

Option 1

Using the program Terminal You can enable or disable the display of system and hidden files and folders in MAC OS X

Launch the Terminal program (located in Applications/Utilities/ or search for it using spotlight)

enter the command into the terminal window (the defaults write command makes changes to the settings files):

Defaults write com.apple.finder AppleShowAllFiles -bool true

press "enter". This command will change Finder settings. For them to take effect, you need to restart the Finder process with the command:

Killall Finder

press enter.
Hidden files will now show up in Finder.
If after work you need to hide them, this is done with the same command, but with the false parameter

Defaults write com.apple.finder AppleShowAllFiles -bool false

And restart Finder again

Killall Finder

Option 2

If you have to work quite regularly with hidden files, then you can use AppleScript to avoid launching the terminal. For this it is necessary to Open the AppleScript program and input the code in the editor window:

Set dialogResult to display dialog "Show hidden files..." buttons ("YES", "NO") copy the dialogResult as list to (buttonpressed) if buttonpressed = "YES" then do shell script "defaults write com.apple.finder AppleShowAllFiles -bool true" else do shell script "defaults write com.apple.finder AppleShowAllFiles -bool false" end if do shell script "killall Finder"

Then click the "Compile" button. And then save as application app or as a script, the app can be inserted into the dock or desktop.
If in the “save” mode it is not possible to choose in what form to save this script for displaying hidden files, you can use the “export” command in the file menu.

Option 3

Changing the visibility flag of an individual file. Particularly convenient for management separate files, for example.htaccess (does not always work, I will write about this file separately).
In the terminal, go to the folder with the file and execute the command

Chflags nohiddenFileName

Instead of the file name, the folder name can be used, for example the command:

Chflags nohidden ~/Library

Will make the hidden library folder visible, respectively the command

How to make a file or folder invisible (hidden) in OS X

This action is done by the same command chflags, but is used as a flag (sign) hidden , For example:

Chflags hidden ~/Library

Sets the hidden folder flag in Mac OS X. in this case this is the Library located in the user's folder

© 2024 ermake.ru -- About PC repair - Information portal