GREP_COLORS – change the colors in the GREP output.

2019-04-22 4 min read bash Linux
Today we will look at the variable GREP_COLORS. This variable determines the colour that is used with the grep command. You can look at the man page of the grep command to see what the various options mean. Here is the excerpt from the man command: GREP_COLORS Specifies the colors and other attributes used to highlight various parts of the output. Its value is a colon-separated list of capabilities that defaults to ms=01;31:mc=01;31:sl=:cx=:fn=35:ln=32:bn=32:se=36 with the rv and ne boolean capabilities omitted (i. Continue reading

findmnt – find all the mounts and their source

2013-09-16 1 min read Linux
If you are looking for the source of a mount and the various options used in the mount, then the quickest way to get that is :: findmnt By default, with no parameters, it lists all the mounts in a tree like view and all the options used to mount the path. It also lists the source of the mount. By default again, it uses some capabilities of the terminal to show the tree which you can disable with the option “-a”. Continue reading

Print all environment variables, including hidden ones

2010-11-09 2 min read bash Fedora Linux
Print all environment variables, including hidden ones 1 <td> <div class="text codecolorer"> for _a in {A..Z} {a..z};do _z=${!${_a}*};for _i in `eval echo "${_z}"`;do echo -e "$_i: ${!_i}";done;done|cat -Tsv </div> </td> </tr> This uses some tricks I found while reading the bash man page to enumerate and display all the current environment variables, including those not listed by the ‘env‘ command which according to the bash docs are more for internal use by BASH. Continue reading

The power of find command in Linux – advanced.

2010-05-24 2 min read Linux
Generally whoever uses Linux, would know about the find command. Find the man page <a href="http://amit.themafia.info/phpMan.php?parameter=find&mode=man" target="_blank">here. There are also lots of blogs, tutorials and other articles on find command on the web, so why write another one. Because it&#8217;s worth every word spent on it 🙂 find is a very powerful command, let&#8217;s see how (options for find command from man page and usage): –depth — Process each directory&#8217;s contents before the directory itself. Continue reading

top - looks better and is more useful with a rc file...

2010-05-07 1 min read Fedora Learning Linux
top is a very useful command to find out who is eating up the <a class="zem_slink freebase/en/central_processing_unit" title="Central processing unit" rel="wikipedia" href="http://en.wikipedia.org/wiki/Central_processing_unit">CPU or the memory. But sometimes the plain and simple look simply would be boring so how about some fun. Copy the below code to file : ~/.toprc RCfile for &#8221;top&#8221; Id:a, Mode_altscr=1, Mode_irixps=0, Delay_time=5.000, Curwin=0 Def fieldscur=mfcAbdEgHIursOpQTvyzWjKNLX winflags=32184, sortindx=10, maxtasks=0 summclr=4, msgsclr=5, headclr=5, taskclr=4 Job fieldscur=ABcefgjlrstuvyzMKNHIWOPQDX winflags=62777, sortindx=0, maxtasks=0 Continue reading