The 44 Most Useful Commands to Use on Mac Terminal

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

To use it, just search for “Terminal” in Spotlight search. Very simple, isn't 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 directory name (without the quotes) in question next to the command before hitting Enter.

3. cd ..

This command helps you go one level higher than the directory you are currently using.

4. cd

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

5. pwd

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

6. mkdir “directory name”

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

7. rmdir “directory name”

Use this command to delete an empty directory. Just put the directory name (without quotes) in question next to the command before hitting Enter.

8. cp

This simple command helps you copy one or more files quickly. Just put the filename next to the command before hitting 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 two previously selected files.

11. more “filename”

This command displays one text file on one page at a time. In this 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 file in place.

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 to have the current date and time displayed directly in Terminal.

17. echo

The "echo" command is for anything after it to be repeated once more.

18. help

When you type "help" in Terminal, a short list of useful commands will appear on the screen.

19. history

The "history" command can be very useful as it displays the last commands that were typed in Terminal.

20. peak

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

21. ps

This simple command is for displaying all currently active processes and operations.

22. sudo

This command is to allow you to perform certain tasks that your account does not have permission for. Still, you will need to enter the administrator password.

23. defaults write AppleShowAllFiles TRUE

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

24. defaults write type extension-file

In general, Mac prints are saved in PNG format, but you can change this with the command above. Just replace the "file extension" with the extension of the file type you want the photos to be saved to. Enter 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 as it only serves to make the Mac speak a few words.

26. defaults write devmode YES

This command is for placing the widescreen widgets directly on your computer desktop. To reverse this, simply replace YES with a NO at the end of the command.

27. alloc

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

28. caffeinate

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

29. lime

This simple command shows the Mac calendar automatically.

30. crontab

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

31. clear

This command is simply to clear the Terminal screen. Very useful if you have been using the software for a while.

32. dc

Use this command to quickly display and use a calculator.

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 to display free hard disk storage on the screen.

36. said

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 the 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 Spotlight search quickly and do a search there.

42. open

This command is simply for opening a file, folder, URL, or application on your Mac. Just specify the name of what you want to open next to the command before hitting 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 quickly check your internet connection. It can be very useful if you notice a slow network.

Did you like these tips about Mac Terminal?

Can you take advantage of this full list of tips on useful Mac Terminal commands? Don't forget to leave your comment telling us what you think and it all worked out.

Interesting Articles