This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Linux / UNIX and the fly likes Linux command to long list files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Linux command to long list files" Watch "Linux command to long list files" New topic
Author

Linux command to long list files

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9351
    
    2

Guys,

Is there a way where in I can long list the files in a directory along with the information that tells me from the resultant list that those individual files are a directory or a file or a symbolic link. Effectively I'm asking if there is a way to combile ls-l and ls-p with the result being shown in the ls -l way?


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14114
    
  16

I don't understand exactly what you're asking. But how about ls -lp?


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9351
    
    2

Jesper Young wrote:I don't understand exactly what you're asking. But how about ls -lp?


The first character in the ls -l result explains it... good learning, found it out by myself.



The d says that the file compile is a directory and exactly which is what I wanted to know when I give ls -l and this is what I get when I give ls -p
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16019
    
  20

Jothi Shankar Kumar wrote:
Jesper Young wrote:I don't understand exactly what you're asking. But how about ls -lp?


The first character in the ls -l result explains it... good learning, found it out by myself.



The d says that the file compile is a directory and exactly which is what I wanted to know when I give ls -l and this is what I get when I give ls -p


One of my favorites is "ls -lrthZ".

This does a detail list, using human-readable (MB, GB) filesizes in reverse size order, including SElinux attributes.


Customer surveys are for companies who didn't pay proper attention to begin with.
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9351
    
    2

I tried that on my Red Hat machine and gave me the error saying that "Sorry this option can be used only in a Linux SEKernel"
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16019
    
  20

Jothi Shankar Kumar wrote:I tried that on my Red Hat machine and gave me the error saying that "Sorry this option can be used only in a Linux SEKernel"


Which is true. But if you don't care about SELinux, just leave off the "Z" option.
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9351
    
    2

Does the SE stands for Special Edition? I"m sorry that I'm dumb here.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

Google to the rescue: selinux


JBoss In Action
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Linux command to long list files