Tech

The most convenient terminal commands that every Mac user should know

The most useful terminal command article title image that every Mac user should know

screenshot: Planay Parab

Your Mac’s terminal can do amazing things like check your internet speed, change the type of apps displayed on the dock, and shut down your Mac at a scheduled time.There is also Some features you can do that’s all You can access it using the terminal, so if you don’t mind I’ve been using it all the timethis is It’s a good opportunity to change that.

Start internet speed test

If you have macOS Monterey You can do it Check internet speed directly from the terminal.. To run the upload and download speed tests at the same time, type the following command and press Enter.

networkQuality

If you want to run the upload and download speed tests one at a time, Use the following command.

networkQuality -s

Hide inactive apps from the dock

Mac can be docked from time to time It’s too crowded.One way to fix it Hide all inactive apps from the dock.. This can be done with a simple terminal command.

defaults write com.apple.dock static-only -bool true; killall Dock

To restore the dock to its original state, use the following command:

defaults write com.apple.dock static-only -bool false; killall Dock

Alternatively, you can reset your Mac’s dock to factory defaults. The same is true when using the following command:

defaults delete com.apple.dock; killall Dock

Restart Finder

The finder is like an invincible boss from It A game that everyone keeps talking about.. You can quit or force-Close all apps on your Mac except the Finder.However, this little cheat code Helps to restart FinderUseful when the app gets stuck.

killall Finder

You can also add an option to exit the app (restart in the Finder) from the menu bar. Use the following command to complete the task.

defaults write com.apple.Finder QuitMenuItem 1; killall Finder

This will automatically restart the Finder. Click finder The menu at the top of the screen offers new options such as: Exit Finder..

To hide this option this Instructions:

defaults write com.apple.Finder QuitMenuItem 0; killall Finder

Awaken your Mac display

You can put your Mac’s display to sleep with a simple terminal command. To prevent your Mac display from going to sleep indefinitely, open a terminal and use the following command:

caffeinate

When you’re ready to put your Mac screen to sleep normally, press. Control + C On the keyboard.

You can also put the display to sleep for an hour using the following command:

caffeinate -u -t 3600

Feel free to change the period at the end of this command. The value must be in seconds, so if you don’t want the display to sleep for 10 minutes, you can replace the number with 600.

Shutdown schedule

You can use this command to shut down your Mac at a scheduled time.

sudo shutdown -h +30

Here +30 means that you are scheduling a shutdown within 30 minutes. You can change the number as you like.Similarly, you can schedule a reboot With this command:

sudo shutdown -r +30

Create an ASCII art banner

For those who feel creative but lack the skills to become an artist, the terminal on Mac can create beautiful ASCII art.

banner -w 50 Lifehacker

In this command, the number after -w is the width of the ASCII art measured in pixels, and Lifehacker is the text. You can replace these values ​​to create your own version of this artwork.

Change the default screenshot format

macOS has a fairly robust screenshot tool that saves screen photos in PNG format by default. If you want to change this to JPG, paste it into your terminal.

defaults write com.apple.screencapture type JPG

You can use these formats for screenshots by replacing JPG with PDF or TIFF with the same command.

Download the file without opening a browser

If you have copied the download link directly to the clipboard, or remember it, you can use the terminal to download the file without using a browser at all. This is the command you need to do that.

curl -O URL

Note that -O is an uppercase o, not zero. The URL must be replaced with a download link for this command to work.

Copy and paste the file

You can use the ditto command to copy and paste files from one folder to another, directly from the terminal.

ditto -V [old folder] [new folder]

Here [old folder] Must be replaced with the path of the original folder, [new folder] You need to point to the folder where you want to paste those files.

View the history of terminal commands

If you want to see all the terminal commands you have used so far, try the following:

history

The most convenient terminal commands that every Mac user should know

Source link The most convenient terminal commands that every Mac user should know

Related Articles

Back to top button