Subscribe:

Ads 468x60px

Friday, August 31, 2012

Useful Linux Commands

Here I am documenting few useful linux terminal command:


  1. Command to report system disk space usage:
    [osao@slc01nga ~]df
    Filesystem           1K-blocks      Used Available Use% Mounted on
    /dev/xvda2           195592588 177362320   8294652  96% /
    tmpfs                  3931448       368   3931080   1% /dev/shm
    /dev/xvda1             1007896    124588    832108  14% /boot
    slcnas411:/export/home1/osao
                         16106127360 8378327360 7727800000  53% /home/osao
    10.246.4.40:/vol/ade_infra/prod/LINUX.X64
                         100663296   5784768  94878528   6% /usr/dev_infra/platform
    10.246.4.37:/vol/ade_infra/prod/GENERIC
                         100663296   5784768  94878528   6% /usr/dev_infra/generic
    slc1001nap:/vol/local/x86_64/redhat/60_prod/packages
                         1132462080 1087278784  45183296  97% /usr/local/remote/packages
    slc1001nap:/vol/local/linux/redhat/packages
                         1132462080 1087278784  45183296  97% /usr/local/redhat/packages
    Command to see these in summarised short form
    [osao@slc01nga ~]df -lhk
  2. Command for knowing all services running on a machine
    [osao@slc01nga ~] nmap localhost     (in place of localhost you can give other live machine also in your intranet)

  3. Command for knowing a port number for service running and Process ID (pid)
    [osao@slc01nga ~]netstat -anp | grep 9000  (it will search a service running on port no. 9000)
    The following two command will also do the same:
    [osao@slc01nga ~] lsof -w -n -i tcp:8080
    [osao@slc01nga ~]  fuser -n tcp 8080
  4. Command for knowing Directory/File size
    [osao@slc01nga ~]du -hs
  5. Command for searching particular string in particular files in regular expression form
    For ex. here we are searching in all files whose name end contains .jspx or .jsff and file contains text "encoding"
    [osao@slc01nga ~]grep -H -r -n -i --color "encoding" . --include='*.[j][s][fp][xf]'
  6. Perl Command to replace all occurences of string to other string
    the format is
    [osao@slc01nga ~]/usr/bin/perl -p -i -e "s/string1/string2/g"  
    For Ex. for converting all occurences of "ReSult" to "" We will invoke the command
      [osao@slc01nga ~] /usr/bin/perl -p -i -e "s/ReSuLt/$Result_Count<\\/font>/g"






17 comments:

  1. Very nice post. І just stumbled upоn youг weblοg
    аnd wanteԁ to say that ӏ havе
    truly enjoyеd browsing youг blog poѕts.
    Afteг all I will bе ѕubѕcribіng to youг rss feed
    and I hope you wгіte again sоon!

    Mу wеbsite: payday loans no credit check

    ReplyDelete
  2. Link exchаnge is nothіng else however it is simply plaсing the other peгson's webpage link on your page at suitable place and other person will also do similar in support of you.

    Look into my site - short term loans

    ReplyDelete
  3. Hello, its good pаragraph аbout media print,
    we аll bе familiar wіth media is a
    fantastic sοurce of data.

    Feel freе tо suгf to mу webρage - payday loans

    ReplyDelete
  4. Hi theге еvery οne, here
    everу person is sharing ѕuch
    expeгienсe, so іt's nice to read this webpage, and I used to pay a visit this webpage every day.

    Here is my site: New Bingo Sites

    ReplyDelete
  5. Your meanѕ of ԁescribіng аll in
    this рiece of writing is reallу good, every οne bе capable of simply be аwarе of
    it, Thanks a lot.

    Also vіsit my web site :: New Bingo Sites

    ReplyDelete
  6. thats another informative post for a beginner like me..thankx for the post

    ReplyDelete
  7. (Coach Outlet Store Online) literally on the lookout for a overseer, Service to utilize VP of (Yeezy Boost 350 Cheap) to steer the whole process of (Cheap Jordan Shoes Websites) interpreting, (Jordan Shoes For Sale Online) Promoting so enacting state of the art property finance loan rrnsurance coverage elements. Unique develops this business approval for item innovations and gives strategies for addition to successfully older person (Ray Ban Outlet Store) administration. Performs survey and moreover outreach to available people inner income staff members to be able to advanced supplements attributes associated with house purposes inside your customer bank (Ray Ban Outlet) loan policy firm.

    ReplyDelete
  8. Actor Jim Parrack ( Blood is 37. Musician Joey Ray Ban Outlet Ryan of Ray Ban Glasses Milk Carton Kids is 36. Actress Cecily Strong ( Night Live is 34. And Akhtar, S. And Jackson, C. And Ainsworth, H. Valentina Paloma Pinault Salma Hayek Yeezy Boost 350 and Francois Henri Pinault young one is seen wearing Gucci just Coach Outlet Store like Yeezy Discount her mother more often than not. Whether a coat from the brand that costs $500 or a hat worth New Jordan Shoes 2020 $200. As for accessories, jewellery from Neil Lane it is.

    AbstractConsumption of soft drinks is declining in many countries, yet energy drink sales continue to increase, particularly amongst young consumers. Little is currently known about the drivers behind these trends. Energy drinks are high in sugar and caffeine, and evidence indicates Coach Outlet that regular or Coach Handbags Clearance heavy use by under 18s is likely to be detrimental to health.

    ReplyDelete