Mac Format

Get tricksy with Terminal

Feeling brave? Try these tips and tricks to speed up the way you use your Mac

-

Many people baulk at the idea of using the Mac’s Terminal but, as long as you’re careful, it’s nothing to be afraid of. Open Terminal – it’s in Applicatio­ns > Utilities, or open App Launcher and find it in the Other folder. The Terminal window shows your username and a cursor. To use one of the Terminal commands in this section, type it in exactly as it is here, with no spaces at the end, and press Enter.

If you’ve used a Wi-Fi password before but can’t find it on your Mac, in Terminal, type

security find-generic-password -wa “Wifi”

changing ‘Wifi’ to the name of the Wi-Fi SSID in question.

You then have to type in your administra­tor’s name and password. You’re shown the password in question, provided it’s been used on your Mac before. To list actively running processes on your Mac, type

top

in Terminal. You’ll see the running processes listed. If you’ve typed in a lot of Terminal commands, and it’s all looking too cluttered, you can wipe the window clean by typing

clear

A good way to learn about Terminal is to type

man “command”

changing ‘command’ to the command you wish to learn about. A page from the Terminal manual is displayed for your perusal.

To change the default name for screenshot­s taken on your Mac, in Terminal, type

defaults write com.apple. screencapt­ure name “filename”

changing ‘filename’ to the screenshot title you want to use. To revert back to the default way of naming screenshot­s, type

defaults write com.apple. screencapt­ure name “Screenshot”.

If you want to capture screenshot­s without the date and time in the file name, type

defaults write com.apple. screencapt­ure “include-date” 0

and press Enter. If you change your mind, type the above code again, replacing the 0 (zero) at the end with a 1 (one), then press Enter. The date and time are restored.

You can force quit an app from Terminal using the killall command. To do this, type

killall app

replacing ‘app’ with the name of the applicatio­n you want to quit. For example,

killall Numbers

forces the Numbers app to quit. Make sure the name of the app is offered exactly as it is on the app, including capitalisa­tion.

If you want your Mac to stay awake, use the command

caffeinate

You can also specify the time for which this is active. Just type

caffeinate -t seconds,

replacing ‘seconds’ with the number of seconds for which you want your Mac to stay awake. For example,

[courier]caffeinate -t 3600[/

courier]

keeps your Mac awake for 3,600 seconds, that is, one hour. If you do this often, we recommend you install the free Caffeine app from the App Store.

If you’re using El Capitan or later, you can flush the Mac’s DNS cache from the Terminal. Type

sudo dscacheuti­l -flushcache; sudo killall -HUP mDNSRespon­der

and press Enter, then type your admin password and press Enter. Note; when entering your password, the cursor doesn’t move and nothing appears on the screen. Just type it in full and press Enter; it’s working even if you don’t see anything in the Terminal window.

 ?? ?? To learn about an instructio­n in Terminal, use the man
command.
To learn about an instructio­n in Terminal, use the man command.
 ?? ?? You can find the Mac’s Terminal applicatio­n in Applicatio­ns > Utilities, or in Launchpad > Other.
You can find the Mac’s Terminal applicatio­n in Applicatio­ns > Utilities, or in Launchpad > Other.
 ?? ?? To view all currently running processes on your Mac, type top in Terminal and resize the window.
To view all currently running processes on your Mac, type top in Terminal and resize the window.
 ?? ??

Newspapers in English

Newspapers from Australia