We use cookies to create a better browsing experience. By using this website you consent to our cookies policy.

Accept

MAC TERMINAL COMMANDS ONE SHOULD TRY

By ADMIN| November 22, 2018

CATEGORY : BLOG | DEV

TAGS :

Mac Terminal is almost like Windows Command Prompt. It allows users to modify various characteristics of their Mac systems, fonts, files and functions. It is a program that takes in commands for your computer to run. Using Mac terminal, just enter the command and hit ‘Return’ to execute.

How to Open Terminal On Mac?

Terminal allows you to access the UNIX part of mac OS. So you can run scripts, manage files and edit settings using text commands. To launch the Terminal application, we can use Launchpad, Spotlight or Finder.

Launchpad

Click on the silver rocket Launchpad icon > Click on ‘Other’ folder > Click on ‘Terminal’ app to launch the command prompt of Mac.

Spotlight

Open the magnifying glass Spotlight icon in the dock or you can use shortcut cmd + space bar. Type ‘Terminal’ into the search box > Terminal will appear in the search results, click it & proceed with the command prompt. 

Finder

Finder organizes your files, folder, apps, documents and helps you to locate when you misplace them. Once it’s opened, locate ‘Applications’ folder in the left panel. Now, click on ‘Utilities’ & scroll down to find ‘Terminal app > Double-click to launch it. 

Basic Utilities You Will Use On A Regular Basis

How To Use Terminal On Mac?

A command consists of three elements:
  • The command itself which calls a particular tool.
  • An option which modifies the output.
  • An argument which calls the resource on which the command will operate.
So, for an instance if you want to move a file from one place to another, you would use the command move “mv” followed by the file and location where you want to move. You need to enter the command.mv ~/Desktop/MyFolder /Volumes/Backup

Here are 10 Mac Terminal Commands:

Want to See Hidden Files/Folders

Enter the following command to see hidden stuffs:defaults write com.apple.finder AppleShowAllFiles -bool TRUEkillall Finder 

Download Files Without Using Browser

Terminal can help in downloading files when you don’t want to use web browsers. If you have the URL of the file you wish to download, just enter the following commands.

First Command: Set the Location

cd ~/Downloads/

Second Command: Download File

curl -O (Enter the URL of the file you want to download)

Keep your Mac Awake

Just use the command and specify an elapsed period of time you want your system to be active!Run: caffeinate – u – t 5400 (5400 are the number of seconds) 

Ditto

The most popular command used in OS X is Ditto.  It’s helps in copying huge amount of data from one folder to another.Ditto – v / Old Folder / New FolderAt the place of ‘old folder’ and ‘new folder’ you have to add the paths of the source and destination of the files. You can see each file in the terminal window as they’re copied from one place to another. 

Change Location for Screenshots

If you don’t want your system to save screenshots on your Desktop, you can change its location using terminal application. To do so, run the following commands:
  • Type: defaults write com.apple.screencapture location (path of the  folder where you want screenshots to be saved)
  • Click Return
  • Type: killall SystemUIServer

Change Screenshot File Format

Using this Mac command line, you can change the default PNG format into PDF, JPEG and more. In the following example we’re changing the default format to PDF.Execute the following command: defaults write com.apple.screencapture type PDFTo revert the changes, run the same command again and type PNG in place of PDF. 

Make your Mac to Automatically Restart After a Crash

The following command can help you to reboot your system automatically.Type: sudo systemsetup – setrestartfreeze on

Securely Erase Data

Whenever you delete data from your system, it leaves fragments of files all over your hard disk drive. In case you want to safely remove all the remaining fragments, then you can execute the coming command.diskutil secureErase freespace 3 / volumes / name-of-driveAt place of ‘name-of-drive’ you have to type the name of the drive you want to erase data from. terminal

Have a
question?

Our team is here to help

CONTACT US

OPERATIONS OFFICE:

2F-CS, 46 Ansal Plaza, Sector-1
Vaishali, Ghaziabad-201010 (UP), India

CORPORATE OFFICE:

1002,1004 Antriksh Bhawan
22, KG Marg, New Delhi – 110001

MESSAGE US

info@kreatetechnologies.com

+91 11 66666999