How to list all files in directories

Here's what I'd like to do, and I know there's a genius on this forum that knows the answer:
Let's say I burn a disc with lots of folders and files. How could I see a list of all those folders with their included files in one easy to read place? Like, could I go to Terminal and list the contents of the disc in kind of a directory tree sorta layout that could be copied to a text document?
I have several dozen discs of data I've burned over the years, and when I want to find a certain file, I have to open the disc and manually click thru all the folders to see their contents until I find what I'm looking for. I'd like to make an "index" of each disc so I can find things faster, or better, list the folders/files in a text file I could save, 1 per burned disc. Does this make sense. Is this do-able?

That works pretty sweet, too. As with other techniques, a lot of output to filter thru, hard on the eyes, might kill a printer, I dunno. As far as the output itself... what is this command asking for, in English, like, "Ms. Terminal application: please list ..." What? (the " -lR part)
And the results:
/Users/rob/Desktop/Websites/ARP-new content,May 2008/arp new ens/new vert en:
total 752
-rw-r--r-- 1 rob rob 48593 Jun 3 16:28 608v1_en.jpg
What's the "total 752" mean?
What's the "1" in front of the "rob rob" part?
Apparently the date only shows the year if it's other than this year?
I noticed Terminal doesn't like spaces in path names, like "/Users/rob/Desktop/My Best Folder Ever",
should I rename everything like "MyBest_FolderEver", or is there a workaround for name spaces? Just some curiosity. Do you know of a concise, easy to digest guide to commands in the Terminal? It's something I'd like to learn more about. And thanks for the DIRECT answer to my original post.

Similar Messages

  • How to list all files and directories in another directory

    I need to be able to list all the directories and files in a directory. I need to write a servlet that allows me to create an html page that has a list of files in that directory and also list all the directories. That list of files will be put into an applet tag as a parameter for an applet that I have already written. I am assuming that reading directories/files recursively on a web server will be the same as reading directories/files on a local system, but I don't know how to do that either.

    Hi,
    Here is a method to rotate through a directory and put all the files into a Vector (files).
          * Iterates throught the files in the root file / directory that is passed
          * as a parameter. The files are loaded into a <code>Vector</code> for
          * processing later.
          * @param file the root directory or the file
          *         that you wish to have inspected.
         public void loadFiles(File file) {
              if (file.isDirectory()) {
                   File[] entry= file.listFiles();
                   for (int i= 0; i < entry.length; i++) {
                        if (entry.isFile()) {
                             //Add the file to the list
                             files.add(entry[i]);
                        } else {
                             if (entry[i].isDirectory()) {
                                  //Iterate over the entries again
                                  loadFiles(entry[i]);
              } else {
                   if (file.isFile()) {
                        //Add the file
                        files.add(file);
    See ya
    Michael

  • How to bundle all files and directories in a package?

    how to bundle all files and directories in a package?
    i plan to put all image files, .class files and some other files together.and then double click the package to execute the program.
    should i use jar?is there a link for tutorial or example?
    thanks in advance

    http://java.sun.com/docs/books/tutorial/jar/

  • How to list all files in my system

    Hi there,
    I want to list all files in my system. My system is Windows XP, can anybody help me please? Any can you recommend me if java is suit for such processing?
    Thx in advance.

    public void showFilesIn(File dir) {
        File[] files = dir.listFiles();
        for (int i = 0 ; i < files.length ; i++)
            if (files.isDirectory())
    showFilesIn(files[i]);
    else
    System.out.println(files[i]);
    showFilesIn(new File("C:\\"));
    notice that it won't show directories, but only files

  • How to list all files in a given directory?

    How to list all the files in a given directory?

    A possible recursive algorithm for printing all the files in a directory and its subdirectories is:
    Print the name of the directory
    for each file in the directory:
    if the file is a directory:
    Print its contents recursively
    else
    Print the name of the file.
    Directory "games"
    blackbox
    Directory "CardGames"
    cribbage
    euchre
    tetris
    The Solution
    This program lists the contents of a directory specified by
    the user. The contents of subdirectories are also listed,
    up to any level of nesting. Indentation is used to show
    the level of nesting.
    The user is asked to type in a directory name.
    If the name entered by the user is not a directory, a
    message is printed and the program ends.
    import java.io.*;
    public class RecursiveDirectoryList {
    public static void main(String[] args) {
    String directoryName; // Directory name entered by the user.
    File directory; // File object referring to the directory.
    TextIO.put("Enter a directory name: ");
    directoryName = TextIO.getln().trim();
    directory = new File(directoryName);
    if (directory.isDirectory() == false) {
    // Program needs a directory name. Print an error message.
    if (directory.exists() == false)
    TextIO.putln("There is no such directory!");
    else
    TextIO.putln("That file is not a directory.");
    else {
    // List the contents of directory, with no indentation
    // at the top level.
    listContents( directory, "" );
    } // end main()
    static void listContents(File dir, String indent) {
    // A recursive subroutine that lists the contents of
    // the directory dir, including the contents of its
    // subdirectories to any level of nesting. It is assumed
    // that dir is in fact a directory. The indent parameter
    // is a string of blanks that is prepended to each item in
    // the listing. It grows in length with each increase in
    // the level of directory nesting.
    String[] files; // List of names of files in the directory.
    TextIO.putln(indent + "Directory \"" + dir.getName() + "\":");
    indent += " "; // Increase the indentation for listing the contents.
    files = dir.list();
    for (int i = 0; i < files.length; i++) {
    // If the file is a directory, list its contents
    // recursively. Otherwise, just print its name.
    File f = new File(dir, files);
    if (f.isDirectory())
    listContents(f, indent);
    else
    TextIO.putln(indent + files[i]);
    } // end listContents()
    } // end class RecursiveDirectoryList
    Cheers,
    Kosh!

  • How to list all files of an ibook in the OPF manifest?

    I have this message error when i DELIVERED my iBooks with I Tunes Producer.
    ERROR ITMS-9000: "A5809-7_Math_Venture_3rd_Operations.ibooks: The book asset contains file(s) not listed in the OPF manifest: A5809-7_Math_Venture_3rd_Operations.ibooks:/OPS/assets/widgets/Activite? 1 english-1.kpf/images-1/s1.a.jpeg.  All files must be listed in the OPF manifest, or there is no way to confirm that they are intended for distribution. For more information refer to http://idpf.org/epub" at Book (MZItmspBookPackage)
    Like it is written, All files must be listed in the OPF manifest, or there is no way to confirm that they are intended for distribution.
    What that means?
    Need help please, for the last step before publishing my first book on iBookStore :-(
    Tx

    Hi, I've got the same issue here, there was something to do to get it fixed?
    I've read that my file (i suppouse the .ibooks file) should be named as the cover file (i suppouse the .jpg that shows the cover)
    Well, i renamed almost all files: the .iba file, the .ibooks and the .jpg cover file with the same name: Jalisco Auge de México (right, with accents)
    Then, in the list of issues i got this issues above the ones as listed by you:
    1: Apple's web service operation was not successful
    2: Unable to authenticate the package: (package number.itmsp)

  • List all files in a directory, not including the sub directories if any

    Hi,
    I have been looking around php.net for a bit and can not work
    out how i list the files that are in a directory i.e.
    www.site.com/directory/
    I would like the names of each file to be placed in an array,
    but not to have the sub directories in this list should there be
    any.
    I was given some code a while ago that done this but it
    listed the sub directories and i would like them not in this list.
    I do not have this code anymore and do not know where i got
    it, so i can not get it amended to what i need.
    please can someone tell me what line of code i should be
    using.
    thank you in advance for your help.

    (_seb_) wrote:
    > not very clever wrote:
    >> Hi,
    >>
    >> I have been looking around php.net for a bit and can
    not work out how
    >> i list the files that are in a directory i.e.
    >>
    >> www.site.com/directory/
    >>
    >> I would like the names of each file to be placed in
    an array, but not
    >> to have the sub directories in this list should
    there be any.
    >>
    >> I was given some code a while ago that done this but
    it listed the
    >> sub directories and i would like them not in this
    list.
    >>
    >> I do not have this code anymore and do not know
    where i got it, so i
    >> can not get it amended to what i need.
    >>
    >> please can someone tell me what line of code i
    should be using.
    >>
    >> thank you in advance for your help.
    >>
    >>
    >>
    >
    > The follwoing PHP code will do just that. Just replace
    "pathToFolder"
    > with the path to your folder.
    > I made the list of files also link to each file. Just
    remove the link
    > echo if you don't them to be links.
    >
    > <?php
    > // FUNCTION TO LIST FILES:
    > function listFiles($path){
    > if($handle = opendir($path)){
    > while(false !== ($file = readdir($handle))){
    > if (is_file($path.'/'.$file) &&
    !preg_match('/^\./',$file)){
    > $files_array[]=$file;
    > }
    > }
    > }
    > return($files_array);
    > }
    > $path = 'pathToFolder';
    >
    > // CALL THE FUNCTION:
    > $files_array = listFiles($path);
    > foreach($files_array as $file){
    > echo '<p><a
    href="'.$path.'/'.$file.'">'.$file,'</a></p>';
    > }
    >
    > ?>
    >
    I spotted one error:
    foreach($files_array as $file){
    echo '<p><a
    href="'.$path.'/'.$file.'">'.$file,'</a></p>';
    should be:
    foreach($files_array as $file){
    echo '<p><a
    href="'.$path.'/'.$file.'">'.$file.'</a></p>';
    (a dot after $file, not a coma)
    seb ( [email protected])
    http://webtrans1.com | high-end web
    design
    Downloads: Slide Show, Directory Browser, Mailing List

  • How to list all filename in excuteable jar file?

    Hi there,
    i've been googling around for hours, but found no good answer :(
    i want listing all file name in my excuteable jar file
    Firstly, i use
    File f = new File("/sounds");
    String[] filenames = f.list();
    and use these filenames to load some resouces from url
    //ex
    URL url = getClass().getResource("/sounds/"+filenames);
    No problem occurs when i run it normally
    but when I put it in excuteable jar file, NullPointerException appears
    i think it's because : "File f = new File("/sounds");" doesn't work in jar file (somehow, i don't know why too)
    is there any alternative way to listing all filename in this situation?
    thanks in advance

    There are jar handling classes in the standard library under java.util.jar. I think JarFile is the one you want.
    Hower it's not good practice to list jar contents in order to read resources. It's better to have some kind of resource file in the jar which lists your sounds or whatever. A simple text file with one file name per line suffices.

  • How to select all files in a stack? Control-click doesn't work

    how to select all files in a stack? Control-click doesn't work

    Switch to list or column view. If you must use icon view, instead of Shift-clicking items, click on an empty space near one of them and drag to enclose them.
    (119467)

  • Database query in MaxL DBS-Name list all file information failed

    When I tried list all file information command in MaxL it gave me an error saying the user doesn't exist. When I check the user through display user; command in MaxL I get the information as listed below.
    Is there something wrong with the way the user was created ?
    How can I (Admin) get the index and data file information?
    MAXL> query database Application.Database list all file information;
       ERROR - 1051012 - User ADMIN@Native Directory does not exist.
    MAXL> display user;
    user                description         logged in           password_reset_days enabled             change_password     type                protocol
       conn param          application_access_
    +-------------------+-------------------+-------------------+-------------------+-------------------+-------------------+-------------------+-----------------
    --+-------------------+-------------------
    ADMIN@Nati                                    TRUE                   0                TRUE               FALSE                   3 CSS
       native://DN=cn=911,                   1

    Has anyone resolved the problems with using TNSFormat?
    As is, I want to move to a shared server setup and to do that I want to use TNSFormat and point to a tns entry which is setup for IPC+Shared connection.
    But the Oracle Home that has the Oracle HTTP Server (from the companion CD) does not have SQL*net installed and does not seem to understand TNS.
    I have TNS_ADMIN setup, I have ORACLE_HOME_LISTENER poiting to the DB Home.
    for the OHS home, using "sqlplus login/pw@ipcshared" works, but "tnsping ipcshared" does not, since tnsping does not exist in the OHS home.
    I cannot install SQL*Net from the CD1, since it requires a dedicated/new home and does not want to install in the OHS Home.
    The only format that works in a dedicated OHS Home setup is ServiceNameFormat.
    Any help or input would be very helpful.
    Regards
    ps. This is a redhat linux setup.
    Message was edited by:
    Oli_t

  • Urgent: How to list all alias for a server throw DNS query?

    Hi
    Is there anyone know how to list all alias for a server by asking the network DNS. Is that possible?
    It doesn't work with InetAddress it return a single result.
    Best regard

    InetAddress will not get you the aliases, but you can certainly find all the different IP addresses for a specific host name using the getAllByName() method.
    You won't be able to get the aliases since those IP addresses (assuming there are more than 1) will all be cached as mapping to the name you passed to the getAllByName() method and you can't clear the map cache until the JVM exits.
    So your best hope is to get a list of IP's and either exit your app and restart with a new mode, or save them to a file for another app to read.

  • How to move all files but X to Y

    It doesn't really matter if it's in the terminal or if it's a applescript but I need to know how to:
    Move all files in a dictionary but a few named.

    Could you pleas explain more?
    If you do not understand the shell while loop, it is possible that using shell commands is a bit more dangerous than you might want to try.
    The explanation:
    ls -a | grep -v "X" | while read file
    do
        mv "$file" "Y/"
    done
    ls -a will list all the files in the current working directory (including the invisible files that start with a leading period.  Thinking about this, maybe you do not want to include -a.  You could cd /path/to/the/desired/directory as a way to set your current working directory as the directory you wish to move things from
    cd "/path/of/the/from/directory"
    ls | grep -v "X" | while read file
    do
        mv "$file" "Y/"
    done
    The ls command's output is piped (the vertical bar | ) into the grep command (general regular expression parser).  The -v option tells grep to throw away any lines (filenames) that match the regular expression "X".  So if the regular expression X matches all the files you do not want to move, the filenames send to the next pipe will be the files you wish to move.
    The while loop will read the filenames grep has selected and invoke the mv (move) command for each file selected by grep and move them to the destination directory Y
    The bigest risk is that you will execute this in the wrong directory and move the files that you need somewhere else.  OR WORSE, if "Y" is NOT a directory, and you DO NOT put a trailing / the mv could move easy file to the destination file, deleting the previous file for each file moved, so effectively deleting every file in the directory except the last one.
    This is why I said if you do not understand what is going on with the shell commands, you could do damage to your system.
    ls could have the /path/of/the/from/directory instead of using the cd command.  The grep command could be replaced with egrep that allows using alternate matching strings:
    ls /path/of/the/from/directory | egrep -v "abc.txt|def.jpg|xyz.mp3|etc..." | while read file
    do
        mv "$file" "/path/to/the/destination/directory/"  # notice the trailing slash for safety
    done
    Good luck.  I hope you do not destroy your system

  • List all file namess under a dba_directory.

    Guys,
    It there any way that I can get all the file names in a dba_directory..
    ie.
    SQL> select * from dba_directories;
    OWNER DIRECTORY_NAME DIRECTORY_PATH
    SYS ATTACH_FILES C:\PLSQL
    Now I'm looking for a SQL query\PL-SQL block to list all file names under C:\PLSQL.
    Guidance plz.
    Thanks,
    Bhagat

    There's an Ask Tom thread here:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:439619916584
    shows how to do this with a Java stored procedure.
    HTH
    Regards Nigel

  • How to get all files in one directory

    Hi there,
    is there any way to get all the files in one directory?
    e.g. a method
    File[] getAllFiles(String directory){
    Thank you

    Just out of interest, which part of the File API was confusing?
    http://java.sun.com/j2se/1.5.0/docs/api/index.html
    If you look down the left-hand side, you'll see a frame listing "All File". If you select "File" from that list, it opens up the API in the right-hand frame. Quite near the top you'll find "listFiles".
    I only ask as this (and other questions easily answered by looking at the API) are frequently asked. Did you overlook it when you read the API or did you just not read it?
    I really want to know. I think there is scope to cater for that behaviour within this site. A nice API finder would be good; something more intelligent than the search function (which people use less frequently even than the API docs).

  • How to list all properties in the default Toolkit

    I would like to know what kinds of properties are stored in the default Toolkit (Toolkit.getDefaultToolkit()). I don't know how to list all of them. Toolkit class has a method getProperty(String key, String defaultValue), but without knowing a list of valid keys, this method is useless.
    Any idea would be appreciated.

    Here is a little utility that I wrote to display all the UIDefaults that are returned from UIManager.getDefaults(). Perhaps this is what you are looking for?
    import javax.swing.*;
    import java.util.*;
    public class DefaultsTable extends JTable {
        public static void main(String args[]) {
            JTable t = new DefaultsTable();
        public DefaultsTable() {
            super();
            setModel(new MyTableModel());
            JFrame jf = new JFrame("UI Defaults");
            jf.addWindowListener(new WindowCloser());
            jf.getContentPane().add(new JScrollPane(this));
            jf.pack();
            jf.show();
        class MyTableModel extends javax.swing.table.AbstractTableModel {
            UIDefaults uid;
            Vector keys;
            public MyTableModel() {
                uid = UIManager.getDefaults();
                keys = new Vector();
                for (Enumeration e=uid.keys() ; e.hasMoreElements(); ) {
                    Object o = e.nextElement();
                    if (o instanceof String) {
                        keys.add(o);
                Collections.sort(keys);
            public int getRowCount() {
                return keys.size();
            public int getColumnCount() {
                return 2;
            public String getColumnName(int column) {
                if (column == 0) {
                    return "KEY";
                } else {
                    return "VALUE";
            public Object getValueAt(int row, int column) {
                Object key = keys.get(row);
                if (column == 0) {
                    return key;
                } else {
                    return uid.get(key);
        class WindowCloser extends java.awt.event.WindowAdapter {
            public void windowClosing(java.awt.event.WindowEvent we) {
                System.exit(0);
    }

Maybe you are looking for

  • Ipad 2 - can no longer connect to facetime

    We had to restore my daughters Ipad 2 completely as the battery was running down completely within a couple of hours. She no longer can access facetime. I see in Settings, restrictions the facetime "app" but it won't let me swipe it to turn it on. Ca

  • XML Parsing with Tags increasing in no's

    I have an XML that I am recieving it from other system like below : <ResultSet>   <ERROR_CODE_ID>0</ERROR_CODE_ID>   <ERROR_DESCRIPTION>Success</ERROR_DESCRIPTION> <Rows> <Row1>   <RATE_EFFECTIVE_DT>2013-08-24 00:00:00.0</RATE_EFFECTIVE_DT> <INDEX_NA

  • Fixing display when connecting HP monitor to Macbook pro

    Hi There, I'm trying to connect a HP Monitor to my macbook pro but the display on the HP monitor is all weird, any advice on how to fix? I'm using the screen adaptor that the apple store sold me, so not sure if another adopter is needed.

  • Requirements Gathering for a P2V project

    Does anyone have an example of the kinds of requirements that need to be gathered from a client in preparation for a large scale P2V migration during the requirements gathering phase?  For example, R101:  The customer would like to virtualize all phy

  • Optimum photo size for a slideshow

    what is the best size of photo (500kb, 1mb ect) for creating a slideshow that will have good resolution when put on a DVD?