Thursday, July 17, 2014

My Most Used Linux Commands


Here are a few LINUX commands that i very often refer to:

  • Find files modified in last 7 days:  
    find . -type f -mtime -7
  • Count number of files in a directory:
    ls -f | wc -l
  • Create a soft link:  (ln -s [TARGET DIRECTORY OR FILE] ./[SHORTCUT])
    ln -s /mnt/san/mywebsite /var/www/mywebsite
  • Organize folders by size:
    du -h --max-depth=1 /home | sort -n -r | grep M | more
    grep M to show only MBs.
  • Check MISS ot HIT state in Squid access.log file:
    cat /var/log/squid/access.log.* | grep HIT | wc -l
  • Stream Editor to find and replace a string:
    find . -type f -exec sed -i 's/oldstring/newstring/g' {} \;
  • To print a selected column from a text file on screen:
    awk '{print $1}' file.txtawk '{print $1}' file.txt > output.txt
  • Sort a text file basing on a particular column:
    sort -t, -n -K4 FileToBeSorted.txt > SortedFile.txt
  • Change default editor in RHEL to nano:
    export EDITOR=/usr/bin/nano
  • To be continued .....

Wednesday, February 5, 2014

An interesting illustration guide to PhD

Whatever be the level of your research, it is always important to know that you are not going to invent the WHEEL (unless you are lucky) since it has already been. The only thing one does is to suggest certain minor modifications to the WHEEL.

Here is an interesting link to the Illustrated Guide to PhD.

Happy reading.

Sunday, February 2, 2014

Booting up !

Hi All, i have setup this blog for RANDOM ideas and thoughts that come to mind.

hope to make it work ;)