The 44 most useful commands to use in Mac Terminal

Using the Windows terminal (popularly known as the Command Prompt) and Linux is a common task for users of these systems because the available commands are very useful on many occasions. The Mac and Macbook also have a command terminal, but most users of Apple computers have some fear and tend to be afraid of doing something wrong with the software. It turns out that the Mac Terminal is there to make it easier to use the device and can be used to your advantage in any situation.

To use it, simply search for “Terminal” in Spotlight search. Pretty simple, is not it ? If you want to make good use of this tool, you can still check out some of the most useful commands below!

1. Is

This command lists the file names of the directory you are currently using.

2. cd “directory name”

Use this command to change a directory. Just put the name of the directory (without the quotation marks) in question next to the command before pressing Enter.

3. cd.

This command helps you to go one level above the directory you are currently using.

4. cd

By placing this command with nothing written next, you will be taken to the directory you are currently using.

5. pwd

This command causes the path of the directory used to be displayed in the Terminal.

6. mkdir “directory name”

To create a new directory, use this command and place the directory name next (without using the quotation marks).

7. rmdir “directory name”

Use this command to delete an empty directory. Just put the name of the directory (without quotation marks) in question next to the command before pressing Enter.

8. cp

This simple command helps you to copy one or more files quickly. Just put the filename next to the command before pressing Enter.

9. chmod

If you want to change the access permissions of one of your files, just use this command.

10. diff

This command will compare the differences between the two previously selected files.

11. more “filename”

This command displays a text file on one page at a time. In case, you must press the space key to see the next page or the Q key to exit the display screen.

12. mv “filename”

This command helps you easily rename a file. You can also use it to move the place file.

14. rm “filename”

This command is very simple and only serves to delete the file you name.

15. Control + C

This command simply terminates most operations being performed.

16. date

Enter this command so that the current date and time is displayed directly in the Terminal.

17. echo

The “echo” command is used so that anything after it is repeated one more time.

18. help

When you type “help” in the Terminal, a small list of useful commands will appear on the screen.

19. history

The “history” command can be very useful since it displays the last commands that were typed in the Terminal.

20. peak

This command opens a simple text editor if you need one.

21. ps

This simple command is used to view all processes and operations that are currently active.

22. sudo

This command is to allow you to perform certain tasks that your account does not have permission to do. You will still need to enter the administrator password.

23. Defaults write com.apple.finder AppleShowAllFiles TRUE

This slightly larger command is used for all hidden files on your Mac to display normally. To disable this, just change TRUE to FALSE at the end of the command.

24. Defaults write com.apple.screencapture type extension-file

Overall, Mac prints are saved in PNG format, but you can change that with the above command. Simply change the “file-extension” to the extension of the file type that wants the photos to be saved. Put only the three letters of the extension, such as JPG or PDF, depending on what you want to use.

25. say Hello World!

This command is funnier than useful, since it only serves to make the Mac speak some words.

26. Defaults write com.apple.dashboard devmode YES

This command serves to place the Mac panel widgets directly on the desktop of the computer. To reverse this, simply change YES to NO at the end of the command.

27. alloc

This command can be extremely useful as it displays the used and free memory of your Mac.

28. caffeinate

This command is to prevent your Mac from going into hibernation or sleep mode when not in use for some time.

29. cal

This simple command shows the Mac calendar automatically.

30. crontab

With this command, you can program another command to activate specifically at another time or day.

31. clear

This command simply serves to clear the Terminal screen. Very useful if you have been using the software for some time.

32. dc

Use this command to display and use a calculator quickly.

33. curl

This command basically serves to transfer information from one server to another.

34. cut

Use this command to split a file into several parts.

35. df

Use this command so that free hard drive storage is displayed on the screen.

36. ditto

This command can be used to copy selected files and folders.

37. dsenableroot

This command is used to allow root access on the computer. Use it with caution.

38. last

This command indicates the last user to log in to the Mac in question.

39. locate “filename”

This command can be used to find miscellaneous files on your computer. Just put the file name next to the command.

40. lpr

Use this command to print a previously selected file.

41. mdfind

You can use this command to open the Spotlight search quickly and do a search there.

42. open

This command simply serves to open a file, folder, URL or application on your Mac. Just specify the name of what you want to open next to the command before pressing Enter.

43. passwd

This command can be used to modify the password of one of the Mac users in question.

44. ping

Use this command to do a quick check of your internet connection. It can be very useful if you notice a slowdown in the network.

If you need help, have doubts or concerns, do not hesitate to leave a comment in the comment box below and we will try to help you as soon as possible!

Sonu Sharma: Sonu Sharma is Founder of 'TechKhiladi'. An enthusiast entrepreneur and blogger. He has a very deep interest in learning things related to the digital world and love to sharing his knowledge with others through blogs.