bash

mv command with progress

2018/03/19

When moving large files/directories, I would like to see the progress. Idea for this is to use rsync with progress and remove source files. But that option does not remove the empty directories left …

Highest disk usage of directory in subdirectories

2018/03/12

I find myself doing this lot of times so thought will share this with you all. Basically, once I want to clear out the directory, I first want to find out the sub-directory using the maximum disk …

Linux Best Practices and Tips

2017/03/06

Linux is powerful, flexible, and can be adapted to a broad range of uses. While best practices for administrating Linux servers are not hard to find due the popularity of the operating system, there …

Trello – backup to your linux machine

2017/01/02

Just in case, you are looking for backing up your trello account boards, you can use the following bash script to do so:  #!/bin/bash - …

change the output format for time command

2016/08/16

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 …

Generate random string for various use case

2016/08/08

Some times I need random string, for example to use as email seperator or to use in some API. One way is to use tools like /dev/[u]random or od and other such. But they seem cubersome after I figured …

Get your local IP address like pro

2016/07/10

In shell scripts if you need to get you local IP address corresponding to your hostname then you can use this command

image ordering by Original Date Time using bash script

2016/01/05

Here is the script: #!/bin/bash - #=============================================================================== # # FILE: imgOrg.sh # # USAGE: ./imgOrg.sh # # DESCRIPTION: # # OPTIONS: --- # …

Disk usage by file type

2015/11/30

Trying to find the total usage for each of the file types by extension, then here is a quick bash function for you : disk_usage_type () { find . -name '*'$1 -ls | awk ' BEGIN{ a[0]="Bytes"; a[1]="KB"; …

How to verify sha256sum for multiple file or one file.

2015/10/30

So, lets say you have downloaded the SHA256SUMS files. This file contains the sha256sum for multiple files and you want to compare the values for only one or some of them, then the simplest thing you …

Get count of lines in scripts (shell)

2015/10/15

If you have tried to get the count of lines in file, the you would know about “nl” or “wc -l”. But as you are aware these give you number of lines with other details as well and you need to post …

bash – expand shell variables ( bash bug resolved )

2015/08/17

As you would have noticed in the recent versions of bash, expansion does not work properly when expanding directory names. So, for something like this cd $varname if you press tab, then variable name …


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