A Collection Of Useful BASH Scripts For Heavy Commandline Users

Today, I have stumbled upon a collection of useful BASH scripts for heavy commandline users. These scripts, known as Bash-Snippets, might be quite helpful for those who live in Terminal all day. Want to check the weather of a place where you live? This script will do that for you. Wondering what is the Stock price? You can run the script that displays the current details of a stock. Feel bored? You can watch some youtube videos. All from commandline. You don’t need to install any heavy memory consumable GUI applications.

As of writing this, Bash-Snippets provides the following 19 useful tools:

Cheat – Linux Commands cheat sheet.

Cloudup – A tool to backup your GitHub repositories to bitbucket.

Crypt – Encrypt and decrypt files.

Cryptocurrency – Converts Cryptocurrency based on realtime exchange rates of the top 10 cryptos.

Currency – Currency converter.

Geo – Provides the details of wan, lan, router, dns, mac, and ip.

Lyrics – Grab lyrics for a given song quickly from the command line.

Meme – Command line meme creator.

Movies – Search and display a movie details.

Newton – Performs numerical calculations all the way up to symbolic math parsing.

Qrify – Turns the given string into a qr code.

Short – URL Shortner

Siteciphers – Check which ciphers are enabled / disabled for a given https site.

Stocks – Provides certain Stock details.

Taste – Recommendation engine that provides three similar items like the supplied item (The items can be books, music, artists, movies, and games etc).

Todo – Command line todo manager.

Transfer – Quickly transfer files from the command line.

Weather – Displays weather details of your place.

Youtube-Viewer – Watch YouTube from Terminal.

The author might add more utilities and/or features in future, so I recommend you to keep an eye on the project’s website or GitHub page for future updates.

As you see in the above screenshot, it provides the 3 day weather forecast. Without any arguments, it will display the weather details based on your IP address. You can also bring the weather details of a particular city or country like below.

$ weather Chennai

Also, you can view the moon phase by entering the following command:

$ weather moon

Sample output would be:

4. Crypt – Encrypt and Decrypt files

This script is a wrapper for openssl that allows you to encrypt and decrypt files quickly and easily.

To encrypt a file, use the following command:

$ crypt -e [original file] [encrypted file]

For example, the following command will encrypt a file called ostechnix.txt, and save it as encrypt_ostechnix.txt in the current working directory.

To use this script, you need to get the API key here. No worries, it is completely FREE! Once the you got the API, add the following line to your ~/.bash_profile: export TASTE_API_KEY=”yourAPIKeyGoesHere”

Now, you can view the similar item like the supplied item as shown below:

$ taste -i Red Hot Chilli Peppers

7. Short – Shorten URLs

This script shortens the given URL.

$ short <URL>

8. Geo – Display the details of your network

This script helps you to find out the details of your network, such as wan, lan, router, dns, mac, and ip geolocation.

The file will be uploaded to transfer.sh site. Transfer.sh allows you to upload files up to 10 GB in one go. All shared files automatically expire after 14 days. As you can see, anyone can download the file either by visiting the second URL via a web browser or using the transfer command (it is installed in his/her system, of course).

Now remove the file from your system.

$ rm -fr test.txt

Now, you can download the file from transfer.sh site at any time (within 14 days) like below.

Getting help

If you don’t know how to use a particular script, just type that script’s name and press ENTER. You will see the usage details. The following example displays the help section of Qrify script.

$ qrify
Qrify
Usage: qrify [stringtoturnintoqrcode]
Description: Converts strings or urls into a qr code.
-u Update Bash-Snippet Tools
-m Enable multiline support (feature not working yet)
-h Show the help
-v Get the tool version
Examples:
qrify this is a test string
qrify -m two\\nlines
qrify github.com # notice no http:// or https:// this will fail

Updating scripts

You can update the installed tools at any time suing -u option. The following command updates “weather” tool.

And, that’s all for now folks. I must admit that I’m very impressed when testing this scripts. I really liked the idea of combing all useful scripts into a single package. Kudos to the developer. Give it a try, you won’t be disappointed.

3 Responses

Hi, thank you for the useful scripts, I’m currently using the ytview one. Just a little suggestion from me, it would be better if you could show the channel name & duration of the video too when searching for one, so the search result would look like this: [ChannelName] – [VideoTitle] – [VideoDuration]

These are awesome scripts! Thanks! I have no problem running them anywhere on my Ubuntu machine, (I wanna say I didn’t even have to edit my $PATH, just started typing the commands and they worked), but when I downloaded them onto my mac via my bash terminal, for example I can only get the commands to run if I go into that script’s directory in this case geo and use the ./geo command.