Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to use ls --full-time -lnG but do not wish to list the user names at all. Is there any way to do this?

I would consider -n and -G optional if it is conflicting with getting this done.

share|improve this question
2  
You mean don't list user id-s, right? As your original command won't list usernames too. –  falconer Jan 15 at 19:13

2 Answers 2

up vote 3 down vote accepted

From the man page of ls:

-g like -l, but do not list owner

This would prevent the owner name from being listed. So what you intend to do is probably this:

ls --full-time -Gg

Also if you would like to see only a few desired columns, do ls -l and choose the columns using this:

ls -l | awk {'print $column_no'}

For example, if you only want the filename and size, do this:

ls -l | awk {'print $5" "$9'}

Source:

share|improve this answer
    
Thanks guys, you got it. :) –  j0h Jan 16 at 3:36

Easy way: from man ls

-g     like -l, but do not list owner

So

ls --full-time -gnG 

should work.

Geeky++ way: (need formatting but it's just to give the idea... and it's really adaptable):

ls --full-time -lnG | awk '{ for (i=1; i<=NR; i++) if (i!=3) printf("%s%s", $i, (i==NR) ? "\n" : OFS)}'
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.