Unix/Linux Forum: Equivalant Of Windows Dir /S ≫ M:\File.Txt Using Ubuntu Livecd? - Unix/Linux Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Equivalant Of Windows Dir /S ≫ M:\File.Txt Using Ubuntu Livecd? Rate Topic: -----

#1 User is offline   Shaitan00 Icon

  • Newbie (User Level: 0/10)
  • Group: Members
  • Posts: 1
  • Joined: 02-July 09

Posted 02 July 2009 - 02:50 AM

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,
0

#2 User is offline   fishsponge Icon

  • Administrator
  • Icon
  • Group: Admin
  • Posts: 476
  • Joined: 23-June 05
  • Gender:Male
  • Location:Cambridge, UK
  • Linux User #: 313906

Posted 02 July 2009 - 08:21 AM

to generate a list of files in a given directory, you could run a command like this:

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 Posted Image Posted Image
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



Cambridge Plus :: Cambridgeshire Steam Rally :: PIC Development Bedfordshire :: Wellworthy Piston Rings
Unix Man Pages / Linux Man Pages :: HiFi Forum :: A14 Comments :: UNIX/Linux Forum Archives