| OS X - Operating System General OS operation information and support |
| Post Reply | New Thread | Subscribe |
|
|
Thread Tools |
![]() Member Since: Jan 13, 2010
Posts: 17
![]() |
When I generate a directory listing w/ a PC, i use cmd: "dir /b/s" and this will generate a list of my files with each file's path in front of it (ex: rootfolder\subfolder\file.txt). I can easily manipulate this in excel to upload files to my database with a directory command.
How can I get the same results from Terminal? I have been using "ls -lR", and getting a list, however it only lists the parent folder once, then all file names beneath... then the next parent folder name, all file names, etc. I need to see the individual path in front of each file name that is generated. This has been stunting my progress for a while now, and any help is greatly appreciated!! Last edited by jlawn; 12-01-2011 at 04:11 PM. |
| QUOTE Thanks | |
![]() Member Since: Mar 17, 2008
Location: Tucson, AZ
Posts: 6,511
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Mac Specs: 2008 and 2011 15" mbps, late 11 iMac, iPhone 4s, and too many ipods and other stuff
|
du -ah will do this (with human readable file sizes)
example output: Code:
mikeMBP-2:Installs mike$ du -ah 16K ./.DS_Store 2.0G ./adobepe9.dmg 91M ./CEP-3.0-WacomEdition6-3.110.dmg 264M ./ColorMunkiDisplay101.zip 80M ./lensprofile_creator_p3_mac_042711.dmg 1.0M ./lensprofile_downloader_p3_102510.air 16K ./Lion installs/.DS_Store 3.5G ./Lion installs/InstallESD.dmg 3.5G ./Lion installs 1.5M ./LionTweaks.zip 7.0M ./LRMogrify2.lrplugin.zip 10.0M ./onOne_PerfectPresets_LR.dmg 69M ./PhotoTools_2.6.3_Free.pkg.zip 120K ./Resuminator.zip 61M ./sketch_pad_de_fr_en.dmg 2.9M ./SuperDuper!.dmg 8.0K ./Wacom_Brushes_3/.DS_Store 12K ./Wacom_Brushes_3/Wacom Brushes 3 Readme.rtf 312K ./Wacom_Brushes_3/Wacom Brushes 3.abr 332K ./Wacom_Brushes_3 6.1G . This also works well. Code:
mikeMBP-2:Installs mike$ find . -type d -exec ls -lR {} ';'
total 5414304
-rw-r--r--@ 1 mike staff 95862481 Feb 16 2011 CEP-3.0-WacomEdition6-3.110.dmg
-rw-r--r--@ 1 mike staff 277045436 Sep 26 09:37 ColorMunkiDisplay101.zip
-rw-------@ 1 mike staff 7306367 Aug 27 20:45 LRMogrify2.lrplugin.zip
drwxr-xr-x 4 mike staff 136 Dec 1 20:11 Lion installs
-rw-------@ 1 mike staff 1562599 Sep 26 20:38 LionTweaks.zip
-rw-------@ 1 mike staff 72755047 Aug 7 23:20 PhotoTools_2.6.3_Free.pkg.zip
-rw-------@ 1 mike staff 121243 Sep 26 19:21 Resuminator.zip
-rw-r--r--@ 1 mike staff 3036322 Aug 16 19:12 SuperDuper!.dmg
drwx------@ 5 mike staff 170 Aug 7 21:49 Wacom_Brushes_3
-rw-r--r--@ 1 mike staff 2154935181 Feb 16 2011 adobepe9.dmg
-rw-r--r--@ 1 mike staff 83972878 Aug 23 22:27 lensprofile_creator_p3_mac_042711.dmg
-rw-r--r--@ 1 mike staff 1048833 Aug 23 22:27 lensprofile_downloader_p3_102510.air
-rw-r--r--@ 1 mike staff 10485760 Aug 8 09:07 onOne_PerfectPresets_LR.dmg
-rw-r--r--@ 1 mike staff 63967232 Mar 20 2009 sketch_pad_de_fr_en.dmg
./Lion installs:
total 7310568
-rw-r--r--@ 1 mike staff 3743009943 Jul 20 06:37 InstallESD.dmg
./Wacom_Brushes_3:
total 648
-rwxr-xr-x 1 mike staff 8453 Jun 8 2007 Wacom Brushes 3 Readme.rtf
-rwxr-xr-x@ 1 mike staff 317083 Jun 12 2007 Wacom Brushes 3.abr
total 7310568
-rw-r--r--@ 1 mike staff 3743009943 Jul 20 06:37 InstallESD.dmg
total 648
-rwxr-xr-x 1 mike staff 8453 Jun 8 2007 Wacom Brushes 3 Readme.rtf
-rwxr-xr-x@ 1 mike staff 317083 Jun 12 2007 Wacom Brushes 3.abr
mike This machine kills fascists Got # ? phear the command line! Last edited by Dysfunction; 12-01-2011 at 10:42 PM. |
| QUOTE Thanks | |
![]() Member Since: Sep 13, 2011
Location: Kentucky, USA
Posts: 100
![]() Mac Specs: Mac Pro 2 x 2.66 Xeon 6gb DDR2 1TB OSX Server
|
find can do the job in real simple without having to pipe outputs through awk if you are just need filepaths.
Code:
$ find . . ./.gitignore ./app ./app/assets ./app/assets/images ./app/assets/images/rails.png ./app/assets/javascripts ./app/assets/javascripts/application.js ./app/assets/javascripts/home.js.coffee ./app/assets/javascripts/posts.js.coffee ./app/assets/stylesheets ./app/assets/stylesheets/application.css ./app/assets/stylesheets/home.css.scss ./app/assets/stylesheets/posts.css.scss ./app/assets/stylesheets/scaffolds.css.scss ./app/controllers ./app/controllers/application_controller.rb ./app/controllers/home_controller.rb ./app/controllers/posts_controller.rb ./app/helpers Blair Technology Group - Mac System Administrator |
| QUOTE Thanks | |
| Post Reply | New Thread | Subscribe |
| Thread Tools | |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
|
|||||||
Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| Automatically save log files of terminal sessions | Stubaan | OS X - Apps and Games | 3 | 04-02-2013 11:24 AM |
| Open a url in mac with blocking terminal | tarun91 | OS X - Operating System | 4 | 05-18-2011 10:38 AM |
| Terminal Won't Open | icefall5 | OS X - Operating System | 7 | 08-25-2010 08:26 AM |
| Terminal problems please help | CliveO | OS X - Operating System | 6 | 03-20-2007 10:04 AM |
| Terminal Help | rs2sensen | OS X - Apps and Games | 1 | 04-25-2005 10:52 PM |
All times are GMT -4. The time now is 06:54 AM.
Powered by vBulletin