I have some files and folders on a drive (OS) which I want to write to a text file (long story short, drive it dying, some files I could not backup because copy failed, want to generate a list of them all).
If this was Windows I would run:
DIR /S > M:\File.txt
This would create a text file called File.txt on the M:\ drive which contained a list of all the files & folders ...
Now, because the drive was dying I am using Ubuntu LiveCD (Linux) to backup my files ... now the question is how can I accomplish the same thing in Ubuntu?
Any advice, help, information would be much appreciated.
Thanks,
Page 1 of 1
Equivalant Of Windows Dir /S ≫ M:\File.Txt Using Ubuntu Livecd?
#2
Posted 02 July 2009 - 08:21 AM
to generate a list of files in a given directory, you could run a command like this:
Obviously, you'll need to change /dir/ for the correct path and you might want to output the list of files to somewhere other than /tmp/listOfFiles.txt, but the command above will generate a list of filenames with their paths.
Hope this helps!
find /dir/ -type f > /tmp/listOfFiles.txt
Obviously, you'll need to change /dir/ for the correct path and you might want to output the list of files to somewhere other than /tmp/listOfFiles.txt, but the command above will generate a list of filenames with their paths.
Hope this helps!
><> FishSponge <><
[Richard Hobbs] [HiFi Forum]
This site is funded largely out of my own pocket, so if you are feeling generous, please
[Richard Hobbs] [HiFi Forum]
This site is funded largely out of my own pocket, so if you are feeling generous, please
Page 1 of 1

Sign In
Register
Help


MultiQuote