Command + 2: View as List: Command + 3: View as Columns: Command + 4: View as Cover Flow (Mac OS X v10.5 or later) Command + Comma (,) Open Finder preferences: Command + Accent (`) (the Accent key. To see a list of all the commands available in Terminal, hold down the Escape key and then press y when you see a question asking if you want to see all the possibilities. To see more commands, press Return. Unix has its own built-in manual. So, to learn more about a command type man name of command, where 'command' is the name of the command.
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!
Terminal is one of the most powerful macOS apps, which allows you to perform actions with different commands. Although Terminal Commands are seemingly difficult to carry out, believe me, they aren't. Once you know the commands, you can quickly perform tasks like shutting down your Mac or copying contents from one place to another right from your terminal
As the terminal is a CLI (Command Line Interface), the language we type in which interacts with the Mac, is known as bash, and commands are called bash commands. This tool is often overlooked because it is completely different from the GUI (Graphical User Interface ), which provides a rich interface. But today I've come up with a useful list of macOS Terminal Commands that you can learn easily and will help you do things instantly. So let's start.
11 Cool Terminal Commands for macOS – Mac User Should Try
#1. Hide/Unhide and View Files/Folders in Finder
macOS Terminal provides you an easy way to Hide, Unhide or View hidden files in the Finder via Terminal.
Open up the terminal from /Applications/finder or alternatively launch it from Spotlight.
To Hide any File/Folder:
Type in the following command :
Now, drag the file which you want to hide in the terminal and click Enter.
To View Hidden File/Folder:
Type defaults write com.apple.finder AppleShowAllFiles -bool TRUE in the Terminal.
Once done you need to restart the Finder, it can be done by this command.
If you ever wish to hide the sensitive files again, repeat all the commands by replacing TRUE with FALSE.
To Unhide any File/Folder:
List Of Macbook Commands Copy
Unhiding the file/folder is fairly easy, just replace 'hidden' with 'nohidden'.
Now, drag the file/folder which you want to unhide.
#2. Download Files Using Terminal
If you've a direct link of the file which you want to download, you can use the following commands to download the file using the Terminal on Mac.
Note: If you want to download the contents to any other directory replace 'downloads' with the directory name.
#3. Keep your Mac Awake
To prevent the mac from sleep, or showing screensaver after some inactivity use
If you want this command to get auto-disabled after a certain period of time, put the -t flag and specify the time in seconds as shown below.
Here, after 150000 seconds the command will get disabled, and the settings will be restored. Meanwhile, you can also use Cmd + C to terminate the command.
#4. Change Default Screenshot Format Type
Mac Terminal Commands
By default, the screenshots are saved in .PNG format, but you can gain full control over the screenshots behavior.
To change default screenshot format type, use defaults write com.apple.screencapture type followed by type for e.g. : ( PNG, JPG, GIF, or PDF), then press Enter.
#5. Access iCloud Drive Using Terminal
To access the data from your iCloud Drive use the following command.
However, we already have a detailed guide on how you can access, copy, or move data to your iCloud Drive, which you can check out anytime.
#6. Shut Down or Restart Mac using Terminal
To shut down your mac with CLI (Command Line Interface) aka Terminal, use
Just as shut down, you can restart your Mac by
#7. View File Contents
To access the contents of any damaged or corrupted file, you can force the terminal to open it with this command.
Note: If you try to open an image file in the terminal, it will show some gibberish text.
#8. Speed Up Time Machine Backup
Whenever you're updating the Mac to the new version, backup's are assurity of your data and the easiest way to take a backup is to use Time Machine. But do you know? You can speed up time machine backup using the terminal by this command
#9. Add Spaces to your Dock
If you feel, your dock is crowded with a lot of apps. You can add up a little space between each app icon, here's how.
Type:
and hit Return.
Once done, type:
and press Return again
#10. Copy Contents from One Folder to Another
Copying contents from one place to another is fairly easy with Terminal, Type in the following command
Replace original with the current directory, and new with the name of the directory to which you want to copy the contents.
#11. Make your Mac Say Anything you want
This is the coolest command that macOS provides, you can make your Mac say anything you want, by using the say command followed by the words.
say 'hello, iGeeksblog'
Wrapping Up…
There are lots of bash commands available for macOS. However, these were some of them. Do give them a try, and make more out of your Mac.
You might also like to read:
3d effect software for windows 7. Which command did you like the most? Share your views in the comment section.
Nikhil runs iGB's official YouTube channel. He is the official lensman of iGB and GB's small studio is Nikhil's playground, where he does all wonders with his remarkable signature. When Nikhil is not in his studio, you may spot him in a gourmet restaurant, chomping his way through some delicious food. He is a great traveler, who can go for long drives in search of good food.
- https://www.igeeksblog.com/author/nikhil/How to Manage Website Settings in iOS 13 Safari on iPhone and iPad
- https://www.igeeksblog.com/author/nikhil/How to Fix 'iMessage Needs to Be Enabled to Send This Message' Issue
- https://www.igeeksblog.com/author/nikhil/
- https://www.igeeksblog.com/author/nikhil/How to Enable and Use Taptic Time on Apple Watch in watchOS 6