LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-02-2011, 07:09 AM   #1
pstein
LQ Newbie
 
Registered: Jan 2009
Posts: 13

Rep: Reputation: 0
How to cut/hide the first 4 columns of a "ls -l" output?


How can I cut/hide the first 4 columns of an "ls -l" output?

Ok, owner and group can be hidden by -g and -G but the others?

Maybe as additional questions:
How to hide the 5th (=file size) column as well?

The solution should work WITHOUT awk (if possible).

Peter
 
Old 10-02-2011, 07:15 AM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,246

Rep: Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684
What is your actual question? ie. what data do you want and what do you want to do with it?
 
Old 10-02-2011, 07:35 AM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529
grail's asking because 0) 'ls' output isn't stable (8th field will either be year or time), 1) it's not advisable to use 'ls' output anyway and 2) 'stat -c' and 'find -printf' provide more fine-grained control over what output should contain.
 
Old 10-03-2011, 03:05 AM   #4
pstein
LQ Newbie
 
Registered: Jan 2009
Posts: 13

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by unSpawn View Post
grail's asking because 0) 'ls' output isn't stable (8th field will either be year or time), 1) it's not advisable to use 'ls' output anyway and 2) 'stat -c' and 'find -printf' provide more fine-grained control over what output should contain.
ad 0) Exactly this is the problem!

ad 1) This was not the question

ad 2) This sounds good. Will try it. As fas as I can see yet it is NOT possible with printf to print out just 2 digits for the "Seconds" part without the fraction part. Or do you know one?

Thank you
Peter
 
Old 10-03-2011, 03:07 AM   #5
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,246

Rep: Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684
And yet still have not explained what it is you are trying to get / do?
 
Old 10-06-2011, 08:18 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529
Quote:
Originally Posted by pstein View Post
ad 1) This was not the question
That's nice but it's the wrong response. Some here know more about scripting pitfalls and best practices. So instead of dismissing it it should have made you think.


Quote:
Originally Posted by pstein View Post
As fas as I can see yet it is NOT possible with printf to print out just 2 digits for the "Seconds" part without the fraction part.
'man find': "%A", 'man ls': "--time-style=".
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
square brackets in output of "ps aux" not matching output of "ps -ejH" alirezan1 Linux - Newbie 14 07-14-2010 05:17 AM
printing hh in hh:mm using "awk '{FS=":";print $1}'" misses first line of output!! mayankmehta83 Linux - Newbie 2 12-03-2009 03:55 AM
"failed to execute child process" "Input/output error" fl.bratu Fedora 4 12-15-2008 05:03 AM
bash: "cut" and "case" help please tredegar Linux - Newbie 14 06-26-2008 05:31 PM
Feeding the output of "diff" or "cat" command to dpkg --purge kushalkoolwal Debian 9 06-19-2008 08:27 AM


All times are GMT -5. The time now is 04:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration