Connect with us

Fifteen Terminal tricks that every Mac user should know

Apple News

Fifteen Terminal tricks that every Mac user should know

Customize your computer and master the Terminal with these tips, tricks, and Terminal phrases.

Welcome back to Coding Corner! Last week, we introduced OS X’s Terminal, and now we’re going to go over some great interface and user tweaks you can execute to customize your Mac. These tricks are often simple and can help you spruce up your Mac far beyond what the System Preferences window allows.

So, without further ado, 15 great tricks you can execute in Terminal.

Tweak the Finder

Want to see hidden files, or copy Quick Look text? There are quite a few “defaults” commands that let you alter how the Finder looks or acts.

1. Show hidden files and folders

Want to see all the hidden files and folders OS X has to offer — or you simply can’t find a file you hid? Just use this command in Terminal:

defaults write com.apple.finder AppleShowAllFiles -bool TRUEkillall Finder

To re-hide all your files, just change the TRUE to FALSE.

2. View any file’s contents

If you’ve had a file g…

Customize your pc and grasp the Terminal with the following pointers, tricks, and Terminal words.

Welcome again to Coding Corner! Last week, we presented OS Y's Terminal, and now we are going to pass over a few nice interface and user tweaks you'll be able to execute to customise your Mac. These tricks are incessantly easy and help you spruce up your Mac a long way past what the System Preferences window lets in.

So, with out additional ado, 15 nice tricks you'll be able to execute in Terminal.

Tweak the Finder

Want to peer hidden information, or reproduction Quick Look textual content? There are rather a couple of "defaults" instructions that can help you regulate how the Finder appears or acts.

1. Show hidden information and folders

Want to peer all of the hidden information and folders OS Y has to provide — otherwise you merely can not discover a record you concealed? Just use this command in Terminal:

defaults write com.apple.finder AppleShowAllFiles -bool TRUE
killall Finder

To re-disguise your whole information, simply amendment the TRUE to FALSE.

2. View any document's contents

If you've got had a record get corrupted otherwise you suspect there is something hidden inside of its package deal, you'll be able to drive Terminal to open it. Just use the next command:

cat ~/input/document/trail

Fair caution: If you attempt to open a photograph or just about any non-textual content record, you'll be able to most probably simply see textual content gibberish.

3. Copy the contents of a folder from one position to some other

Sure, you'll be able to Option-drag any document to a brand new region to keep a copy of it, however if you wish to simplify the method and routinely reproduction all of the contents of 1 folder to some other, take a look at this easy Terminal trick.

ditto -S ~/unique/folder/ ~/new/folder/

4. Download information out of doors of your browser

Have the URL to a document however do not need to use Safari, Firefox, or Chrome to obtain it? You can undergo Terminal with the next instructions:

cd ~/Downloads/
curl -A http://www.thefilename.com/thefile/url.mp3

The first command movements your present Terminal region for your Downloads folder; the second one downloads it from the internet to that folder.

Modifying screenshots

Want to switch how your screenshots glance? Here are a few instructions that will help you do exactly that.

5. Change your screenshot's document layout

S discussed this trick in short remaining week, however it is one S'm very grateful for. This Terminal command allows you to amendment the record layout of your screenshots. By default, they are stored as PNGs, however you'll be able to additionally store them as PDFs, JPGs, and extra.

defaults write com.apple.screencapture sort jpg

6. Disable drop shadows on a screenshot

Here's some other just right one in case you have a tendency to take a large number of screenshots: This command will disable drop-shadow in your screenshots, handiest showing the window you will have snapped.

$ defaults write com.apple.screencapture disable-shadow -bool TRUE
killall SystemUIServer

7. Create a brand new default identify scheme for screenshots

Don't just like the word Apple makes use of to save lots of your screenshots? Traditionally, it is "Screen Shot - [date] - [time]", however you'll be able to amendment "Screen Shot" to any phrase you please.

defaults write com.apple.screencapture identify "New Screen Shot Name"
killall SystemUIServer`

Get bored of your new identify scheme? Go again to the default through typing as follows:

defaults write com.apple.screencapture identify ""
killall SystemUIServer

8. Change the site of your screenshots

Your screenshots, via default, keep to the Desktop. But in case you'd want they keep in different places, it is a very easy Terminal trick to make it so.

defaults write com.apple.screencapture region ~/your/region/right here
killall SystemUIServer

You too can drag the folder of your selection on most sensible of the Terminal window after typing "region" if you do not want to manually sort out the record trail.

System adjustments

If you are on the lookout for broader OS Y-degree adjustments, those instructions would possibly let you get began.

9. Create a customized login message

Whether you wish to have to troll your mates or upload helpful "in case of loss" touch knowledge, you'll be able to upload a customized message for your login display with this Terminal command.

sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText "In case of loss, name 555-555-5555."

10. How lengthy has my Mac been operating?

Is your Mac appearing sluggishly? It may well be short of a just right restart. You can test to peer simply how lengthy your Mac's been lively by way of checking its uptime with this Terminal command:

uptime

11. Keep your Mac wakeful

If you wish to have to stop your Mac from going to sleep — say, you are operating an in depth activity, or recording your display — there is an all-too-a laugh command for that:

caffeinate

Once you input this command, your Mac's virtual eyes can be pried open and avoided from going to sleep till you finish it by way of urgent Control-H.

If you do not want to depend on being the only to finish your negative Mac's struggling, you'll be able to additionally create a suite quite a lot of seconds prior to your Mac sleeps:

caffeinate -u -t 5400

The above command will stay your Mac wide awake for an hour and a part.

12. Make your Mac routinely restart after a crash

We've all had our Mac freeze up or crash once or more in its lifetime. If you wish to have to skip the crying and the yelling on the display and get again to paintings, you'll be able to input this Terminal command, with a view to make OS Y reboot as quickly because it senses a whole device freeze.

sudo systemsetup -setrestartfreeze on

Modify your Dock

Want to make your Dock glance other? Check out those Terminal tweaks.

13. Add spacers for your Dock

You can arrange your Dock's many icons by way of including in clean areas with this handy terminal command:

defaults write com.apple.dock chronic-apps -array-upload '"tile-sort"="spacer-tile";'
killall Dock

Repeat this command for each and every spacer you need on your Dock. To take away a spacer, you'll be able to drag it out to the appropriate till you spot the poof icon.

14. Dull hidden apps within the Dock

Not positive which apps are visual in your monitor? You could make this knowledge additional pertinent via the use of this Terminal command, which lowers the opacity on icons for hidden apps within the Dock. It's a good way to peer what you have not used in recent years, in addition to what is cluttering up your display.

defaults write com.apple.Dock showhidden -bool TRUE
killall Dock

15. Hide non-lively apps for your Dock

If reducing the opacity of hidden apps appeals to you, you could like this Terminal command even better: It hides any closed app out of your Dock always.

defaults write com.apple.dock static-most effective -bool TRUE
killall Dock

Your favorites?

Have a Terminal command you're keen on that we did not point out? Drop it under within the feedback.

Comments

More in Apple News

Popular

Featured

Advertisement
To Top