Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

text list of contents from hard drive?

I have a bunch of hard drives both external and Internal. I would like to create either a text or spread sheet of their contents' file names. Is there an easy way to do this? Some research online has suggested using the Terminal utility however I'm not entirely confident I understand that procedure or if I can harm my computer typing the wrong words. Is there an easier way or can someone walk me through the proper way to create a text file that lists all the file names throughout all the folders on a hard drive?


any help is very appreciated, thanks jeff

Mac Pro (Early 2008), OS X Mountain Lion (10.8.2)

Posted on Dec 18, 2016 1:09 PM

Reply
Question marked as Best reply

Posted on Dec 18, 2016 4:19 PM

Try

Applications -> Utilities -> Terminal


sudo find / >$HOME/filelist.txt

Password: <your_login_password_assuming_you_are_logged_in_as_the_admin_account>


This will give you every file on every mounted volume.

In filelist.txt stored in your home folder.

This includes all the system files and various files that are typically hidden from your sight.


The file names will have full paths, so you can edit the .txt file, then copy and paste the different /Volume/namedVolume sections into their own separate .txt files.


You can most likely copy and paste ranges of files from the .txt file into a spreadsheet.


There are other methods to getting command line command to give you a list of files.


You could also try

sudo ls -R1a / >$HOME/filelist.txt

6 replies
Question marked as Best reply

Dec 18, 2016 4:19 PM in response to ArchFotos

Try

Applications -> Utilities -> Terminal


sudo find / >$HOME/filelist.txt

Password: <your_login_password_assuming_you_are_logged_in_as_the_admin_account>


This will give you every file on every mounted volume.

In filelist.txt stored in your home folder.

This includes all the system files and various files that are typically hidden from your sight.


The file names will have full paths, so you can edit the .txt file, then copy and paste the different /Volume/namedVolume sections into their own separate .txt files.


You can most likely copy and paste ranges of files from the .txt file into a spreadsheet.


There are other methods to getting command line command to give you a list of files.


You could also try

sudo ls -R1a / >$HOME/filelist.txt

Dec 19, 2016 6:49 AM in response to BobHarris

Hi Bob, thank you for responding to my question. I tried both of your suggestions, typing in: sudo find / >$HOME/filelist.tx brought the response of: -bash: sudo find: command not found


typing in sudo ls -R1a / >$HOME/filelist.txt I got a warning that said improper use of the sudo command could lead to file deletion... it was a long paragraph I should of copied it,.. put in my password and the response was:

ls: illegal option -- ?

usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...]


While I would be interested in figuring out the proper procedure (or code text) to do what you are suggesting, my concern (because I am a novice with terminal and computer code in general) is that I really need to be able to do this regularly to keep on top of my archive of files. I'm really hoping to find a simpler way to extract all the files names of an external hard drive that I can either paste into a text file then finally into a spreadsheet or even create a flow chart


Any other ideas?


thanks, jeff

Dec 19, 2016 4:59 PM in response to ArchFotos

I'm glad you find a solution via TextWrangler.

While I would be interested in figuring out the proper procedure (or code text) to do what you are suggesting,

those commands should have worked as is. Did you manually type them in, or copy and paste directly from this web page?

-bash: sudo find: command not found

says bash (the shell in charge of processing your commands) did NOT see a space between 'sudo' and 'find'. That is to say, it thought 'sudo find' was a single word to lookup as a command, and not 2 words separated by white space.


So I do not know what was the character between the 'o' and the 'f', but bash did not think it was a space or a tab.

ls: illegal option -- ?

at least bash was able to separate 'sudo' from 'ls', but for some reason it some something in the -R1a besides '-' 'R' '1' and 'a'. The ? is most likely a non-printable character.

text list of contents from hard drive?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.