Find out the percentage of space:
df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }'
Output:
71% /dev/hdb1 98% /dev/hdb5
Find out the percentage of space:
df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }'
Output:
71% /dev/hdb1 98% /dev/hdb5
The following shell script splits an IP into separate Octets into its own variables. This method can be used for any script which needs to take each octet into account, such as generating firewall rules etc. Read More
Pure bash solution:
$ filename='Some_randoM data1-A'
$ f=${filename//[^[:alnum:]]/}
$ echo "$f"
SomerandoMdata1A
$ echo "${f,,}"
somerandomdata1a