In this post I’m going to discuss the strategy used by our team to manage the changes taking place in the database. Most of the time we as developers mainly focus on implementing the feature and put less effort on manage the database changes. For instance individual might not straight away see the importance in […]
The getopts command simplifies the task of validating and parsing command line options and arguments for your shell scripts.
getopts <optstring name> [arg...]
Step1: First I define all my option holding variables.
Step2: While loop.
The following while statement loops through all the options and sets them to the corresponding variable. getopts returns true while there are options to be processed. The argument string, here "lme:h", specifies which options the script accepts. If the user specifies an option which is not in this string, it will go into * section which will display a help to use this script with examples. If the option is succeeded by a colon, the value immediately following the option is …
We all know du command to get the size of a directory. But the
problem is when you use "du <directory name>" it will give
you the list of all subdirectory including the directory you want
Bt what if i only want the size of directory which i have passed as an argument and not all the subdirectory?
In that senario we can use:
du -sh <directory name>
du -h /home/mysql/admin/