Thread: ls unix command

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2010
    Posts
    7
    Rep Power
    0

    Question ls unix command


    hello,

    i am using

    Code:
    ls -1 -s
    but,
    i would like

    to view in the first column the file name and in the second the size in bytes .


    Thank you very much .
  2. #2
  3. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,417
    Rep Power
    1871
    Code:
    $ ls -1 -s
    total 84
     4 bin
     4 Desktop
     4 Documents
     4 Downloads
    $ ls -1 -s | awk '{ print $2, $1 }'
    84 total
    bin 4
    Desktop 4
    Documents 4
    Downloads 4
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper

IMN logo majestic logo threadwatch logo seochat tools logo