1 Reply Latest reply on Jun 3, 2013 2:52 PM by Dude!

    usage of cut and stay command!!!

    446
      Hi-
      i would like to know the cut command to be used in delimited file..also the purpose of following commands..
      cut -d"." (cut -d"." -f1|grep log) and stat -c
      regards,
      446
        • 1. Re: usage of cut and stay command!!!
          Dude!
          You could check the man page: man cut

          A simple example:
          $ cat sample
          the.cat.jumps.over.the.lazy dog
          the.fly.falls.off.the.purple cow
          To extract the 2nd field using dot (.) as delimiter:
          $ cut -d "." -f2 sample
          cat
          fly
          To extract the 3d field from the file "sample" where the line contains "purple cow"
          $ grep "purple cow" sample | cut -d "." -f3
          falls
          For information about "stat" see "man stat". For example:
          # stat -c %a install.log
          644
          # stat -c %A install.log
          -rw-r--r--
          1 person found this helpful