Mac Terminal Hacks Tricks

The Mac Tricks and Tips has this great article on some of the awesome hacks on OS X. There are a list of 22 hacks, some of which are really handy. I am going to list a few of the handy tricks that ought to be set to default on your OS X. You can copy and paste the commands here using ⌘ + C for copy and ⌘ + V for paste. View Hidden Files on. Dec 12, 2017  6 Mac Terminal Tricks and Hacks for Mac Power Users. One can't but agree that Mac OS has a stunning graphical user interface (GUI), which is also quite functional. With its help, Mac users don't have to bother running the command-line interface environment in most cases. Aug 19, 2019  In case you have been dreading to use it, you can always get comfortable by using simpler tricks. Here are the top 11 terminal command tricks to try on your Mac. Also on Guiding Tech.

  1. Mac Terminal Hacks Tricks 2
  2. Mac Terminal Hacks Tricks Free
  3. Best Mac Terminal Hacks
  4. Mac Terminal Hacks Tricks Without

Trick

Terminal is Mac OS X way into the command line world. It is designed for you to typing in specific commands that you would not be able to do otherwise. This is great for customizing your Mac and unveiling hidden features. It is also a good way to destroy you system because you screwed something up. 30 Terminal tips, tricks and projects for Mac In this tutorial, we'll cover in detail some of the best uses for the macOS command line tool. Including: how to watch an ASCII version of Star Wars. How To: 13 Terminal Commands Every Mac User Should Know By Andrew Godinez; Mac Tips; When you think of Terminal, you probably imagine some hacker sitting in front of their computer in a dimly lit room trying to break into an FBI database. In reality, it's just a simple tool that can make using your Mac. Jul 17, 2019  Would love to have a terminal hack that puts Mac mail window on the right instead of the bottom. This gives about 9 more visable email lines. If you use your email list as your to-do list like I.

Hey,

We all enjoying tweaking out Mac, changing the settings to get it just how we want. Today’s post is going to show you many hacks, tricks, and tips to alter your Mac, with specific focus on the way Finder operates and runs. These tricks use Terminal and a short command to change the preference settings. You can chop and change which commands you want to run. Not all commands work with Lion, however many do. If you don’t like the way a setting looks or works you can always revert them using the supplied reverse command. If you don’t want to change the settings manually I recommend you purchase an app such as MacPilot.

Using Terminal

All of these commands use Terminal. To use any of these commands open up Terminal in your Applications > Utilities folder. Then copy and paste any command you want to run and hit enter. Many need you to restart Finder so follow the command you want to run with the killall Finder command. This will restart Finder and show you the change you have made. Most of these commands are boolean, meaning a YES can be reversed with NO to turn the command on or off.

Hidden Files

One of the most popular commands you can run. If you want to view all the hidden files and folders on your Mac you can run this command. There are many files and folders that are hidden. This command works on Mountain Lion and older versions of Mac OS X.

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

If you want to reverse this command type the following:

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

Disable Finder Preferences

If you have set the preferences of Finder and you don’t want them to be changed you can disable the menu option. This command will disable the Finder preferences.

defaults write com.apple.finder ProhibitFinderPreferences -boolean YES;
killall Finder

To re-enable them

defaults write com.apple.finder ProhibitFinderPreferences -boolean NO;
killall Finder

Play Media In Get Info Panes

One of my favourite commands that should be enabled by default. This command will enable movies, word documents, music and other files to run in a similar method to that of Quicklook. When you open up the Get Info window, there will be a small playable window that will allow you to play a movie, or flick through a word document.

defaults write com.apple.finder AnimateInfoPanes -boolean YES;
killall Finder

To reverse this command;

defaults write com.apple.finder AnimateInfoPanes -boolean NO;
killall Finder

The preview window will now animate the media you are looking at.

Disable Emptying Trash

One of the commands I would probably advise against using. This command will stop you from emptying the Trash.

defaults write com.apple.finder ProhibitEmptyTrash -boolean YES;
killall Finder

And to allow you to empty the trash;

defaults write com.apple.finder ProhibitEmptyTrash -boolean NO;
killall Finder

Disable The Warning When Emptying The Trash

When you press the empty Trash button, Finder will give you a warning saying do you want to do this action. If you want to disable this option use the following command.

defaults write com.apple.finder WarnOnEmptyTrash -boolean false;
killall Finder

If you want the warning to re-appear the following is used;

defaults write com.apple.finder WarnOnEmptyTrash -boolean true;
killall Finder

Disable Warning When Changing File Extension

One of the more interesting, or annoying, options you encounter when changing files extensions is the warning dialogue box asking if you want to change the extension. If you want to disable this option you can use the following command, this will automatically change the extension without giving you the warning.

defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false;
killall Finder

If you want to warning back again the following is used.

defaults write com.apple.finder FXEnableExtensionChangeWarning -bool true;
killall Finder

Disable Connect To Server Menu Bar Option

In the menu bar, Go option there is a variety of options which allow you to quickly jump to various folders on your Mac. One of these options is the connect to server option, this allows you to connect to a remote server and allow the Finder window to act as the interface to that server. If you want to disable this option use the following command.

defaults write com.apple.finder ProhibitConnectTo -boolean YES;
killall Finder

To re-enable the option use the following command;

defaults write com.apple.finder ProhibitConnectTo -boolean NO;
killall Finder

Just like that the Connect To Folder is gone.

Mac Terminal Hacks Tricks

Disable Go To Folder

If you want to remove the Go To Folder option, in a similar way to the previous command of removing the Connect To Server option you can use the following command.

defaults write com.apple.finder ProhibitGoToFolder -bool true;
killall Finder

Like all the previous commands you can use the following to reverse the command and get the option back.

defaults write com.apple.finder ProhibitGoToFolder -bool false;
killall Finder;

Disable DVD Media Burning

If you have a school or work computer and you want to disable media burning, such as that of DVD’s you can use the following command to prohibit media burning. If you want a permanant solution you can remove the DVD drive like I have.

defaults write com.apple.finder ProhibitBurn true;
killall Finder

To re-enable the ability to burn DVD’s and CD’s use the following.

defaults write com.apple.finder ProhibitBurn false;
killall Finder

Add A Quit Finder Menu Option

One of the more interesting commands, you can add a quit Finder option, where you can quite Finder. I don’t really see the point in this menu option other than for debugging and testing purposes.

defaults write com.apple.finder QuitMenuItem true;
killall Finder

To disable the option, which is usually a good option;

Mac Terminal Hacks Tricks 2

defaults write com.apple.finder QuitMenuItem false
killall Finder

Disable Disk Eject

If you want to disable the ability to eject disks such as disk images or physical disk you can use the following command.

defaults write com.apple.finder ProhibitEject true;
killall Finder

To re-enable this command use the following;

defaults write com.apple.finder ProhibitEject false;
killall Finder

Disable Icons On The Desktop

If you want to remove the icons on the desktop you can use this command. Every icon on you desktop will disappear. It will not be deleted, just hidden. This is useful if you are making a presentation and you don’t want people to see the icons you use.

defaults write com.apple.finder CreateDesktop false;
killall Finder

If you want to see all of the icons again;

Mac Terminal Hacks Tricks Free

defaults write com.apple.finder CreateDesktop true;
killall Finder

Show Remote Disks

With the advent of MacBooks without disk drives there is a problem of being able to access CD drives. You can do this over the network. Simply allow remote disk on your Mac and you can access any DVD drive on another Mac. This option allows you to always see remote drives within Finder.

defaults write com.apple.finder EnableODiskBrowsing -boolean YES;
killall Finder

To disable this option

defaults write com.apple.finder EnableODiskBrowsing -boolean NO;
killall Finder

You can enable remote disk within Finder’s sidebar

New Window When Opening A Removable Disk

One of the more useful commands in my opinion. This command will open a new Finder window when a removable disk is accessed or opened.

defaults write com.apple.finder OpenWindowForNewRemovableDisk -boolean YES;
killall Finder

To disable this option simply type the following:

defaults write com.apple.finder OpenWindowForNewRemovableDisk -boolean NO;
killall Finder

Custom Icons For Removable Volumes

Another useful command is this, it allows you to have a custom icon for a removable volume. Normally a removable drive has that small white block, what ever it represents. With this command you can give it a custom icon.

defaults write com.apple.finder ShowCustomIconsForRemovableVolumes -boolean YES;
killall Finder

To disable this option, simply type;

defaults write com.apple.finder ShowCustomIconsForRemovableVolumes -boolean NO;
killall Finder

Enable Text Selection Within Quicklook

This little tip makes Quicklook a bit more useful. When you hit space bar to enable Quicklook, this command will allow you to select text within the Quicklook window. I like this command as it enables you to copy text out of a file without having to open it.

defaults write com.apple.finder QLEnableTextSelection -boolean YES;
killall Finder

To disable this option

defaults write com.apple.finder QLEnableTextSelection -boolean NO;
killall Finder

With this command you can select text within Quicklook

Enable Quicklook On Application Switch

Another great command which should be enabled by default. When you normally open quicklook and select a different application the quicklook window will disappear. Using this command, the Quicklook window will stay open. So you can view the contents while having a second application selected.

defaults write com.apple.finder QLHidePanelOnDeactivate false;
killall Finder

To disable this command so the Quicklook window disappears when a different application is selected.

defaults write com.apple.finder QLHidePanelOnDeactivate true;
killall Finder

Show The Path Bar

The path bar shows the current location of the Finder window. To enable it use the following:

defaults write com.apple.finder ShowPathBar -boolean true;
killall Finder

To disable this command;

defaults write com.apple.finder ShowPathBar -boolean false;
killall Finder

Show The Finder Pathbar In The Title

If you want to show the current path bar in the title of any Finder window, simply use the following command.

defaults write com.apple.finder _FXShowPosixPathInTitle -bool true;
killall Finder

To disable this command use the following;

defaults write com.apple.finder _FXShowPosixPathInTitle -bool false;
killall Finder

You can view the path of the folder you are in in the title bar

Show Stripes In Finder

Another cool little visual command. With this command every other line will be coloured blue. This makes looking down a list a lot easier as there will be a clear distinction between each line.

defaults write com.apple.finder FXListViewStripes -boolean true;
killall Finder

To disable this command and remove the stripes;

defaults write com.apple.finder FXListViewStripes -boolean false;
killall Finder

Slow Animations When Holding Shift

One of the slightly less useful commands for Finder. If you enable this command when you hold shift and minimise any window, or play the animation it will slow to a halt. A bit pointless but something you can enable all the same.

defaults write com.apple.finder FXEnableSlowAnimation -boolean true;
killall Finder

To get animations back to full speed.

defaults write com.apple.finder FXEnableSlowAnimation -boolean false;
killall Finder

Disable Snap To Grid Animation

I am not sure if this command works in the later version of Mac OS X, however it will disable the the snap to grid animation.

defaults write com.apple.Finder AnimateSnapToGrid -bool true;
killall Finder

To re-enable the command;

defaults write com.apple.Finder AnimateSnapToGrid -bool false;
killall Finder

Using An App

There are many commands which you can choose from in this list. If you want to do this within an app and remove the need to do a lot of copying and pasting you can use something like MacPilot. It has many of these commands and more.

Conclusion

There are plenty of commands within this list. I have checked that most of these work within Mountain Lion. However, if many do not work you want do any harm to your Mac. If you have any more that you want to add, please leave a comment below.


If you want to keep up with the latests post from Mac Tricks And Tips I recommend you subscribe to the RSS Feed.

Related posts:

Where To Next?

Apple's macOS platform includes Terminal, which is equivalent to Command Prompt in Windows OS. Since the macOS is based on UNIX, Terminal might give you a vibe of a dangerous tool where one wrong command can wreck your system. Sure, it is valid only to an extent. There are a bunch of harmless commands that are usable in customizing the interface and other settings of macOS.

Mac Terminal Hacks Tricks

Best Mac Terminal Hacks

The Terminal on macOS can be extremely useful in tweaking the performance of your Mac. Now it entirely depends on what you want to achieve. In case you have been dreading to use it, you can always get comfortable by using simpler tricks. Here are the top 11 terminal command tricks to try on your Mac.

Also on Guiding Tech
How To Speed Up a Slow Mac
Read MoreNote: While selecting/copying a command, make sure you scroll all the way towards right to select the complete command in the gray box. Otherwise partial commands will not work as intended.

1. Open Folders

One of the coolest ways to get familiar with the Terminal is to use it to open files and folders. I know that clicking on Finder will do the same. However, using Terminal, you can open a specific folder or a file without exposing your file structure to anyone.

Let's say you want to open your Documents folder. Then you can type the following command and then hit Enter.


And that opens my Documents folder. There's a DOCX file in there. I can use Terminal to open that too. For that, you need to type out the command with some requirements — the path of the respective file:

Open -a 'Application Name' /Path/to/File

So for opening the DOCX file in the Documents folder of my Mac, I typed in the command below and then hit Enter:


That opens up the specific file using the predefined program. You can also use the wildcard character (*.extension) instead of the full filename. However, if you have more than one file in carrying the same extension, then it might freeze your Mac for a bit.

2. Change Default Save Screenshot Location

By default, the macOS Mojave stores the screenshots on the Mac's desktop. Now if you have iCloud sync enabled, which I am sure you do, then it keeps uploading to your account. Thankfully, you can change the save location for the screenshots instead of crowding your desktop.

Here's the command you need to type before hitting Enter:


In the above command, you can provide any specific file location instead of ~/Downloads as shown.

After hitting Enter, I need to reset the SystemUIServer for the changes to take effect immediately. So feed in the following command.


Though it is not required, I would recommend restarting your Mac.

3. Change Screenshot Image Type

The macOS saves the screenshots in JPG format by default. You can change that to save them in PNG or PDF formats too. Here's how to do that quickly with this specific command:


After that, you need to kill the SystemUIServer again.
Most commands which require some system changes shall mandate shutting down the SystemUIServer. So do that quickly.


Now, your new screenshots will save in the PNG format. Do note that PNG files are generally larger than JPG files. So keep an eye on how much storage space they consume.

4. Show Hidden Files

Have you tried looking for the option to let the Finder show hidden files? Well, it is tougher than picking the show hidden files on Windows. I always forget how to enable that. Thankfully there is a helpful command that makes it happen in a few seconds.


After that, you need to force shut the Finder.


Now you should see a lot of hidden files in the Finder. They would be greyed out but still visible. If you roll back this change, then you need to change TRUE to FALSE in the command.

5. Switch Off the Dashboard

Apple promoted the Dashboard view to access calculator and sticky notes quickly. I bet you rarely use that one for you can launch the Calculator app or Sticky Notes app using Mission Control of Spotlight. So you can switch it off and don't have to worry about opening it by mistake.

Here's the command to turn off the Dashboard.


Next, you must kill the Dock so that the changes are correctly applied.


Now I don't have to worry about accidentally opening the Dashboard. If you want to switch it on again, then change TRUE to FALSE in the command.

Also on Guiding Tech
How to Install New Fonts in Mac OS X
Read More

6. Download Files

Did you know that you can download files using the Terminal? Yes, you don't need to keep the browser running just for that file. The only requirement here is that you must have the file's download link. So the command syntax is:

curl -0 downloadlink

First, navigate to the folder where you want to download the file. For that, you need to switch to the Downloads directory.

After that, you can feed the command to download the VLC for macOS from the official site. It would appear something like this:

Note: There is a letter O in the command and not the 0 (zero).

7. Ditto for Backups

Copying files and taking backups on macOS is quite swift — thanks to the SSDs and the flash storage. However, it does take a while to copy a large amount of data. Thankfully, Terminal offers a useful command to copy files. Here's how you can do it while watching the name of files that the command copies.

ditto -V /currentpath/ /new/path/

So I want to copy the DMG downloaded in the previous section to the desktop.

That should do the needful. If you want to copy the files to an external drive, then you need to provide the destination path correctly.

8. Always Show File Path in the Finder

If you have switched from Windows recently, you would have noticed that the Finder on macOS doesn't show file path like the Explorer in Windows. However, you can force Finder to show you the file path with this command:

Mac Terminal Hacks Tricks Without

After hitting enter, you need to stop the Finder.

After you hit Enter, the Finder will relaunch. Then you should see the file paths at the top of the Finder window.

9. Power Chime on Connecting the Charger

Has it ever happened that you've connected the MagSafe charger to your Mac but forgot to flip on the power switch? I have lost the count. Thankfully, I stumbled upon this useful command that provides an audio feedback chime whenever I connect the MagSafe charger.

Feed this command in the Terminal and hit Enter.

10. Stop Your Mac from Sleeping

Often you are downloading a massive file, and you don't want your Mac go to sleep. If it is a temporary requirement, then a simple command can make it happen. Just type the following command, hit Enter and walk away from your Mac.

In this command, the number 600 signifies seconds. So with this command, the Mac won't sleep until 10 minutes (600 seconds). You can enter a relevant number of seconds or just the word 'caffeinate' to prevent your Mac from sleeping.

However, if you close that Terminal window, then the command will stop executing and the Mac will go to sleep on a predefined time.

11. Check Your Mac's Uptime

Wondering how long it has been since you've restarted your Mac? A simple restart can sort a lot of things in order and boost your Mac's performance. Here's a command to check your how long your Mac has been running without a Restart or a Shutdown

That should give you all the details with a timestamp.

Also on Guiding Tech
#productivity
Click here to see our productivity articles page

Using Terminal Is Fun

The Terminal is an absolute delight to use and tinker around in the macOS. However, we would strictly advise against using random commands provided by unverified sources or strangers. Other than that, these commands should run on latest macOS Mojave update till last few versions.

You should always double-check the Terminal commands that involve removing, deleting or disabling any service. If you stick to our list, then you would be confident of using Terminal like a pro.

Next up: Are you bored of the same old Lock Screen on your Mac? Here is a nifty guide that will show how to customize the lock screen on your macOS Mojave running Mac.


The above article may contain affiliate links which help support Guiding Tech. However, it does not affect our editorial integrity. The content remains unbiased and authentic.Read NextHow to Customize the Lock Screen on macOS 10.14 MojaveAlso See#terminal #macos

Did You Know

Apple Watch can be used to unlock your Mac.

More in Mac

Top 5 iCloud Drive Alternatives for iPhone and Mac