In both Windows and macOS, there is an application called terminal, which to the rest of us seems like an esoteric thing that only technology flows and programmers can handle. In fact, today’s future series has compiled some simple commands to enable the hidden features of macOS with ease.

Show hidden folders

Hiding files is simple enough on Windows, but on macOS you need to use the command line to do it.

chflags hidden ~/Documents/Hidden
Copy the code

Note: “/Desktop/Hidden” is where your folder is located. If you don’t know, just drag the file onto your terminal to see the original path.

Return code

chflags nohidden ~/Documents/Hidden
Copy the code

If you want to see all the hidden files, you can use the shortcut “Shift + Command +.” Look at it.

In addition to hiding files above, if you want to hide all your desktop files, you can use the following command

defaults write com.apple.finder CreateDesktop -bool false; killall Finder
Copy the code

If you want to see the desktop icon again, change false to true and enter the terminal.

Keep the screen lit up longer

The Mac often goes to sleep when it’s not in use. If you don’t want it to go to sleep so fast, we often need third-party software to solve the problem. There is no need to download software to take up our limited storage space.

caffeinate -t 3600
Copy the code

Modifying screenshot Properties

Mac with screenshots are also very useful, can be area, window, delay screenshots. The default position of the screenshots are on the desktop, a long time on the desktop file screenshots are messy, looking very uncomfortable. To do that, we can create a new folder and put it where you want.

defaults write com.apple.screencapture location ~/Documents/screenshots
Copy the code

Note: after ~ fill in your corresponding folder path, if you do not know, you can directly drag the file to the terminal to see the original path.

Clean up the memory

If your computer has not been shut down for a long time, you can use the following code to clear the cache of memory and hard disk, and the effect is similar to if you restart the Mac.

sudo purge
Copy the code