File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Murach's Java Servlets and JSP this week in the Servlets 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: 9344
    
    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: 14074
    
  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: 9344
    
    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: 15950
    
  19

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: 9344
    
    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: 15950
    
  19

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: 9344
    
    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: 5811
    
    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
 
Similar Threads
search in unix for files without extension
Recycle Folder names
exec() method is limited in function
how toremove files or directory in unix with name of special characters
how to set upTomcat in Unix enviroment