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

Delete all but some directories

2013-08-16 1 min read bash Fedora Linux
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 containing lots of files/directories and I want to delete most of them except some 5/10 of them, how to I do it. I finally wrote a small script to do that. First save list of files that you do not want to delete in file called “listnames” and then execute the below script. Continue reading

cksum – compare for multiple files.

2013-04-30 1 min read Fedora Learning Linux
If you have to compare cksum for couple of files, the you know how cumbersome it is. So, I wrote a simple script, wherein you can create a file called cksums in the current directory and copy paste the result of “**cksums ***” into this file, and then run this script. Cool 🙂 #!/bin/bash - #=============================================================================== # # FILE: checkcksums.sh # # USAGE: ./checkcksums.sh # # DESCRIPTION: Compare cksums of multiple files. Continue reading

vim mappings for multiple files.

2012-08-06 1 min read Vim Tips
If you open multiple files in vim with command line option. Then the only way to move between the files is “:n” and “:N”. There is a easier way to do this. Just add mappings for this in vimrc. Here is what you can use. map :N map :n And if you want to make sure that you move to the prev or next file after saving the file, then you modifyt the mapping like this: Continue reading

symlinks -delete all invalid soft links in Linux/Fedora

2012-06-12 1 min read bash Fedora Linux
First of all, install symlinks if it is not installed : sudo yum install symlinks and here is the description: Description : The symlinks utility performs maintenance on symbolic links. Symlinks checks for symlink problems, including dangling symlinks which point to nonexistent files. Symlinks can also automatically convert absolute symlinks to relative symlinks. Install the symlinks package if you need a program for maintaining symlinks on your system. and the help for the same: Continue reading

pigz -parallel gzip

2012-03-26 1 min read Fedora Linux
Here is a short description of pigz: pigz, which stands for parallel implementation of gzip, is a fully functional replacement for gzip that exploits multiple processors and multiple cores to the hilt when compressing data. And for the installation: sudo yum install pigz With pigz, if you don’t have many things running on your multi processor machine then you will see a significant improvement when you are gzipping the files. Continue reading

conky script used to monitor server status remotely.

2012-01-12 2 min read bash Fedora
[][1]Image via Wikipedia I was looking for something to monitor few details on the server. I thought about quite a lot of applications, some open source and some scripts developed in house. But my requirements were quite petty and the scripts and applications were quite heavy. So, I thought why not conky :). So, with some quick work on conky script, I was able to get what I wanted and here it is for all of you. Continue reading
Older posts