Hello, everyone! As we all are aware of the terminal is the heart of UNIX and LINUX, other than that it gives you more control over your system. If you are looking forward to becoming terminal savvy than these simple piece of commands are good to start with. So, without further ado, let’s get started.
1. Encryption and decryption of any files.
In this virtual world, privacy is the most important thing. Considering this in mind when you want to send some important files to your friend there might be some prying eyes in between who will look at those files. To prevent those eyes following command comes very handy.
Encryption command for Person 1(sender)
$ openssl enc -aes-256-cbc -e -in path 1 -out path 2
After pressing enter it will ask for a password. Set your own password. e.g: csebyte
Decryption command for Person 2(receiver)
$ openssl enc -aes-256-cbc -d -in path 2 -out path 3
It will ask for a decrypted password. Enter the password. e.g: csebyte
For more info: Click here
2. Prevent Mac from sleeping
Let’s say you are trying to download a big size file and you come to know that your Mac went to sleep. So, here is the hack without changing anything in your system preference. This command helps to prevent Mac from sleeping.
$ caffeinate -u -t 7200
Note: 7200 is the time in seconds
You can end it by pressing CTRL+C
3. Display A Custom Message At The Login Window
Suppose your Mac has been misplaced and someone else has found it. This command may bring back your Mac in your hand. Are you lucky enough?
$ sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText "your message here"
4. Change the File Format for Screenshots
It may sound different to you that why one need to change the screenshots file extension? Well, the default screenshots format is png which takes huge space. FYI, some image file goes up to 16MB, soon you might be running out of memory. So, why not change file extension that will save you a lot of space.
$ defaults write com.apple.screencapture type file-extension; killall SystemUIServer
Replace the file-extension with JPG, GIF, PDF, TIFF, PNG.
5. Talking to your mac!
This is fun and intuitive when your computer speaks what you type on the terminal.
$ say hello world!
But what if you are looking for an entire document? In this case, then say command can read from an input text file using the -f option. Just add -f to your say command followed by the path of a file.
$ say -f /Users/csebyte/Desktop/hello.txt
Therefore, you can also use one of a different voice type.There are dozens of female and male voices from which to choose. You can find complete list in System Preferences > Accessibility > Speech > System Voice
Please feel free to share your own favorites command in the comment section for the benefit of all readers!