Shell script

send mail using telnet from script


If you have no other option but to use telnet with authentication to send mail 🙂

change the output format for time command


If you are doing some scripting and using ‘time’ command, then you know sometimes it becomes difficult to capture the output as the output would be something like this: : amit ; time ls real 0m0.002s …

bash refer parameters from the current command


In bash you can use !# to refer to any parameter from the current command, example:

Home grown mail scheduler with bash script and cron


If you are using Linux (Fedora/Ubuntu or anything else) then you do get a lot of tools and one of them is cron. Very very useful. Just write some script that can do the task for you, put it in cron …

Delete all but some directories


I think, like me, you would have faced a lot of situations, where you wanted to delete all the files or directories in a location, leaving only the required files/directories. So, I have a directory …

convert tabs to spaces, the easy way


Lots of times you want to convert tabs to spaces and sometimes from a shell script, if that is the case, then simple solution is “tidy“. First you need to install tidy as follows: sudo yum install …

quick bash script for datewise backup of directory


I was working on something and the data was very critical and needed backup. I wrote a bash script to back up the data every 5 hours with cron and bash script. Thought I will share that with you. Here …


15 Linux Bash History Expansion Examples You Should Know


Here is a nice link on BASH History Expansion. There are lot of examples in this page and some of them might be quite useful. But here are my list of favourites: !! This is probably the most used one …

Unix shell script for removing duplicate files


The following shell script finds duplicate (2 or more identical) files and outputs a new shell script containing commented-out rm statements for deleting them (copy-paste from here): ::: updated on 02 …

Shell Scripting


Here are some links for bash programming that you may find useful. …

mussh - Multihost SSH wrapper


Description: […] Mussh is a <a class="zem_slink freebase/en/shell_script" title="Shell script" rel="wikipedia" …

Awk Introduction Tutorial – 7 Awk Print Examples


awk examples Awk Introduction Tutorial – 7 Awk Print Examples This is the first article on the new awk tutorial series. We’ll be posting several articles on awk in the upcoming weeks that will cover …

This website uses cookies to ensure you get the best experience on our website. Learn more Got it