LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-07-2004, 01:42 PM   #1
AlexCPU
LQ Newbie
 
Registered: Sep 2004
Posts: 4

Rep: Reputation: 0
Print directory list command


Is there a command to write the entire directory structure to file. I'm in the process of backing up my entire HDD to spare drives, and cds for a Gentoo/WinXP build. I just guessed that it's going to be much easier to save the list in linux than windoze.
Sorry for the somewhat question, oh, and i'm using Knoppix atm because i'm to lazy to repartition.

Alex
 
Old 11-07-2004, 01:53 PM   #2
ror
Member
 
Registered: May 2004
Distribution: Ubuntu
Posts: 583

Rep: Reputation: 33
interesting problem, to do the entire file structure, there's ls -aR / > file

Unfortunatly ls -adR / > file stops the recursive behaviour.
 
Old 11-07-2004, 01:59 PM   #3
ror
Member
 
Registered: May 2004
Distribution: Ubuntu
Posts: 583

Rep: Reputation: 33
ok tree is the command you want

tree -d / > file
 
Old 11-07-2004, 02:07 PM   #4
ugge
Senior Member
 
Registered: Dec 2000
Location: Gothenburg, SWEDEN
Distribution: OpenSUSE 10.3
Posts: 1,028

Rep: Reputation: 45
Code:
ls -R / >listing.txt
This would do the job.

Correction:
Didn't notice the need to only print directory structure.
This problem might call for a bash script, combining more commands.

Last edited by ugge; 11-07-2004 at 02:16 PM.
 
Old 11-07-2004, 02:08 PM   #5
ror
Member
 
Registered: May 2004
Distribution: Ubuntu
Posts: 583

Rep: Reputation: 33
except that would lsit files as well as directories, (also also not like hidden ones)
 
Old 11-07-2004, 03:41 PM   #6
AlexCPU
LQ Newbie
 
Registered: Sep 2004
Posts: 4

Original Poster
Rep: Reputation: 0
I'll give those a try in the morning, thanks
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a single command to list all hardware installed (command line)? davee Linux - Hardware 6 02-28-2009 07:19 PM
Apache Directory Listing Of NFS Mount, cannot view directory list via apache luqmana Linux - Networking 2 12-19-2005 06:03 AM
Command to run another command against a list of files psweetma Linux - General 3 11-09-2005 05:29 PM
print list of installed packags? Randall Slack Slackware 3 07-30-2005 03:10 PM
directory list jpostma Linux - General 1 10-23-2003 06:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration