Macos Open App File From Terminal

Like Windows, macOS also has secret files that are hidden so that a user doesn’t meddle with it but sometimes you need to access the hidden files.

Opening Mac OS X Applications from the Command Line. The Terminal command to launch OS X gui apps is appropriately called ‘open’ and here is how it works at it’s most simple: open -a ApplicationName. That will open the defined app named “ApplicationName”. But open is much more powerful than that.

If you want to tweak a setting to perform a troubleshooting step (like finding a log or deleting a preference file), you need to make some changes in those hidden files. Some of you also want to get rid of the files from the hidden folder as they take way too much space.

So the question is “how to access the hidden files?”

Well, we have a solution for it. With the help of terminal and simple command, you can get your Mac’s hidden files and folders.

Must Read:How To Rename Multiple Files At Once On Mac

In this article, we have discussed how to view hidden files and folders on Mac with Terminal.

Launch Terminal

  1. You can launch Terminal via Spotlight.
  • Go to Finder bar and look for a magnifying glass like icon and click on it to open Spotlight.
  • Type Terminal, Spotlight will open a terminal for you.
  1. You can also locate Terminal:
  • On OS X, open your Applications folder.
  • Go to Utilities folder.
  • Open the Terminal application.

Must Read: Quitting Apps on Mac Just Got Handier!

View Hidden Files and Folders:

  • Now that you have accessed Terminal.
  • Type or copy/paste the following commands into the Terminal window:

“defaults write com.apple.finder AppleShowAllFiles TRUE” (This command tells the Finder to show all files, irrespective of the hidden flag setting )

“killall Finder” (This command will stop and restart Finder, so that the changes can take place)

  • Press the return or enter key after you enter each line of text.
  • These commands will allow you to use Finder to find all the hidden files on your Mac.

Note: It is normal to see the Desktop screen vanish and reappear while executing the commands.

Once these commands are executed, you will be able to see a file named.DS_Store. The .DS_Store file consists of information about the folder, you are currently in, including the icon, the location of the window and other bits of information the system requires. Moreover, you get the access to the important hidden folders such as the Library folder inside your Home folder. The Library folder contains many files and folders which is related to a particular apps and services that you use on your Mac.

Note: It is recommended to take a good look at your Library folder and target the issue that you are having, then make any changes.

Hide The Files:

Now that you have seen the hidden folders or you are done with the troubleshooting, you must hide the folders to keep them safe.

  • Open Terminal (Follow the steps to launch Terminal)
  • Type the below commands into the Terminal window:

“defaults write com.apple.finder AppleShowAllFiles FALSE?”

“killall Finder”

Press return key or enter key to execute the command and done, the hidden files are hidden once again.

In this way, you can hide and show the hidden folders of Mac with the help of Terminal. Try it and let us know what worked for you.

Macos Open App File From Terminal

Next Read: How To Use Mac’s General Preferences Pane

Watch this space for cool tech tips!

What Do You Think?
Responses

Terminal is one of the most powerful macOS apps, which allows you to perform actions with different commands. Although Terminal Commands are seemingly difficult to carry out, believe me, they aren’t. Once you know the commands, you can quickly perform tasks like shutting down your Mac or copying contents from one place to another right from your terminal

As the terminal is a CLI (Command Line Interface), the language we type in which interacts with the Mac, is known as bash, and commands are called bash commands. This tool is often overlooked because it is completely different from the GUI (Graphical User Interface ), which provides a rich interface. But today I’ve come up with a useful list of macOS Terminal Commands that you can learn easily and will help you do things instantly. So let’s start.

11 Cool Terminal Commands for macOS – Mac User Should Try

#1. Hide/Unhide and View Files/Folders in Finder

macOS Terminal provides you an easy way to Hide, Unhide or View hidden files in the Finder via Terminal.

Open up the terminal from /Applications/finder or alternatively launch it from Spotlight.

To Hide any File/Folder:

Type in the following command :

Now, drag the file which you want to hide in the terminal and click Enter.

To View Hidden File/Folder:

Type defaults write com.apple.finder AppleShowAllFiles -bool TRUE in the Terminal.

Once done you need to restart the Finder, it can be done by this command.

If you ever wish to hide the sensitive files again, repeat all the commands by replacing TRUE with FALSE.

To Unhide any File/Folder:

Unhiding the file/folder is fairly easy, just replace “hidden” with “nohidden”.

Now, drag the file/folder which you want to unhide.

#2. Download Files Using Terminal

If you’ve a direct link of the file which you want to download, you can use the following commands to download the file using the Terminal on Mac.

Note: If you want to download the contents to any other directory replace “downloads” with the directory name.

#3. Keep your Mac Awake

To prevent the mac from sleep, or showing screensaver after some inactivity use

If you want this command to get auto-disabled after a certain period of time, put the -t flag and specify the time in seconds as shown below.

Here, after 150000 seconds the command will get disabled, and the settings will be restored. Meanwhile, you can also use Cmd + C to terminate the command.

#4. Change Default Screenshot Format Type

By default, the screenshots are saved in .PNG format, but you can gain full control over the screenshots behavior.

To change default screenshot format type, use defaults write com.apple.screencapture type followed by type for e.g. : ( PNG, JPG, GIF, or PDF), then press Enter.

#5. Access iCloud Drive Using Terminal

To access the data from your iCloud Drive use the following command.

However, we already have a detailed guide on how you can access, copy, or move data to your iCloud Drive, which you can check out anytime.

#6. Shut Down or Restart Mac using Terminal

To shut down your mac with CLI (Command Line Interface) aka Terminal, use

Just as shut down, you can restart your Mac by

#7. View File Contents

To access the contents of any damaged or corrupted file, you can force the terminal to open it with this command.

Note: If you try to open an image file in the terminal, it will show some gibberish text.

#8. Speed Up Time Machine Backup

Whenever you’re updating the Mac to the new version, backup’s are assurity of your data and the easiest way to take a backup is to use Time Machine. But do you know? You can speed up time machine backup using the terminal by this command

Terminal

#9. Add Spaces to your Dock

Macos Open App File From Terminal

If you feel, your dock is crowded with a lot of apps. You can add up a little space between each app icon, here’s how.

Type:

and hit Return.

Once done, type:

Macos Open Terminal Shortcut

and press Return again

#10. Copy Contents from One Folder to Another

Copying contents from one place to another is fairly easy with Terminal, Type in the following command

Replace original with the current directory, and new with the name of the directory to which you want to copy the contents.

#11. Make your Mac Say Anything you want

This is the coolest command that macOS provides, you can make your Mac say anything you want, by using the say command followed by the words.

say “hello, iGeeksblog”

Wrapping Up…

There are lots of bash commands available for macOS. However, these were some of them. Do give them a try, and make more out of your Mac.

You might also like to read:

Macos Open App File From Terminal Space

Which command did you like the most? Share your views in the comment section.

Macos Open App File From Terminal Download

Nikhil runs iGB’s official YouTube channel. He is the official lensman of iGB and GB’s small studio is Nikhil’s playground, where he does all wonders with his remarkable signature. When Nikhil is not in his studio, you may spot him in a gourmet restaurant, chomping his way through some delicious food. He is a great traveler, who can go for long drives in search of good food.

  • https://www.igeeksblog.com/author/nikhil/
    How to Manage Website Settings in iOS 13 Safari on iPhone and iPad
  • https://www.igeeksblog.com/author/nikhil/
    How to Fix 'iMessage Needs to Be Enabled to Send This Message' Issue
  • https://www.igeeksblog.com/author/nikhil/
  • https://www.igeeksblog.com/author/nikhil/
    How to Enable and Use Taptic Time on Apple Watch in watchOS 6