LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to cut/hide the first 4 columns of a "ls -l" output? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-cut-hide-the-first-4-columns-of-a-ls-l-output-906036/)

pstein 10-02-2011 06:09 AM

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

grail 10-02-2011 06:15 AM

What is your actual question? ie. what data do you want and what do you want to do with it?

unSpawn 10-02-2011 06:35 AM

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.

pstein 10-03-2011 02:05 AM

Quote:

Originally Posted by unSpawn (Post 4487976)
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

grail 10-03-2011 02:07 AM

And yet still have not explained what it is you are trying to get / do?

unSpawn 10-06-2011 07:18 AM

Quote:

Originally Posted by pstein (Post 4488635)
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 (Post 4488635)
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=".


All times are GMT -5. The time now is 04:50 PM.