Depending on what you're after, terminal can do this for you quite nicely. Open terminal, and then change to the folder you'd like to have the list of files created in. Next, type a simple ls -1 and you'll get a list of all files in that folder. If you want it to show hidden files as well, then add a -a to the command line.
Note, the -1 makes each file name on a separate line.
If you'd like normal ls information (name, sice, date, permissions, then leave off the -1 and you'll get all information shown. If you'd like to find specific files (I.E. those with .zip extensions), then simply do something like:
ls *.zip
and ls will show only the zip files.
Now, if you'd like something showing all files under the current folder as well, then things get more complicated. You can do an ls -R to show all files and their subfolders, but if you're looking for a particular file, it might be easier to pipe the ls output to the grep command, or use find instead to locate the file in question.
find ./|grep zip
will show all files at and below the current file level, including all subfolders, and any and all matches for what comes after the grep command. The benefit of find over ls is twofold. First, find shows entire paths (I.E. /Users/tsiegel/downloads/file1.zip, instead of just file1.zip as the ls command would do, and two, it will (by default) search each and every file at or below the current folder, matching the zip wildcard, regardless of where it is in the filename. So, if you had a file named zipper1.txt and zipper2.jpg, the find command would locate both of these files, whereas the ls *.zip command would only find those with a zip extension. Of ourse, you could adjust your ls command accordingly, but sometimes it's difficult to get satisfactory results from the ls command if your search criteria are complex. For instance, I can pipe find through multiple grep commands if needed to get very specific results. Let's say I have files that are named by date, but I only want the zip files with such a date.
I could do something like this:
find ./ |grep zip|grep 02012014
and the files output would only be the one one matching files with 02012014 in their name, and also having a .zip extension. This would show me all 02012014 files with zip extensions, regardless of what the file name actually was. For instance, hijack audio has a name function that tacks on dates to recordings, in addition to their names. Using this search command, I'd see all of those such as 02012014-first_file.zip and firstfile-01022014.zip without having to specify where in the filename the 02012014 might be located, which is a bit more difficult using just a plain ls command. This of course, only displays the results, it won't do anything else with them, but if you need to see them in a list and be able to edit them (like to remove files you want not to show up in your text listing) then you can simply put a >out.txt after the rest of the command, and your output (all of it) will be dumped into a file called out.txt which you can open with text edit with the command
open -e out.txt
whereupon osx will open text edit, and load the out.txt file into the editor ready for your modifications or viewing pleasure. It's very easy to build up a series of these linked commands to manipulate output, so you get only the results you want to see and work with, but just be aware that each time you add another vertical bar and another command to the command line, you're extending the time it takes to run the commands, especially since find works on each and every file, regardless of whether it's one you wanted to see or not, it's only the grep commands that shrink the output so you don't get thousands of files wizzing across your screen. You can of course accomplish the same thing with any number of strung together commands, it all depends on exactly what it is you'd like to see as the final output.

<--- Mac Access At Mac Access Dot Net --->

To reply to this post, please address your message to [email protected]

You can find an archive of all messages posted    to the Mac-Access forum at 
the list's public Mail Archive:
<http://www.mail-archive.com/[email protected]/>.
Subscribe to the list's RSS feed from:
<http://www.mail-archive.com/[email protected]/maillist.xml>

As the Mac Access Dot Net administrators, we always strive to ensure that the 
Mac-Access E-Mal list remains malware, spyware, Trojan, virus and worm-free.  
However, this should in no way replace your own security strategy.  We assume 
neither liability nor responsibility should something unpredictable happen.

Please remember to update your membership preferences periodically by visiting 
the list website at:
<http://mail.tft-bbs.co.uk/mailman/listinfo/mac-access/options/>

Reply via email to