[SOLVED] How to create a catalog text file in Mageia 2 ?

This forum is dedicated to advanced help and support :

Ask here your questions about advanced usage of Mageia. For example you may post here all your questions about network and automated installs, complex server configurations, kernel tuning, creating your own Mageia mirrors, and all tasks likely to be touchy even for skilled users.

[SOLVED] How to create a catalog text file in Mageia 2 ?

Postby onikage » Dec 4th, '12, 19:12

Hello,
I have a directory on my HDD that is full of subdirectories containing .pdf and other documents that I want to list into a simple text file.

For example if Directory "A" contains file1.pdf, file2.pdf, file3.pdf, I want to create a text list that goes like that (or similar):
--- A (dir name) ---
file1.pdf
file2.pdf
file3.pdf

---B---
etc....

I would do it manually but there are over 1000 .pdf documents in these folders and I want to automate the process. Any ideas how ? Thanks.
Last edited by onikage on Dec 4th, '12, 21:02, edited 1 time in total.
onikage
 
Posts: 75
Joined: Nov 15th, '12, 18:07

Re: How to create a catalog text file in Mageia 2 ?

Postby tom_ » Dec 4th, '12, 20:03

open a terminal and type

Code: Select all
find /folder_with_your_subfolder -name "*.pdf"


should give you the list

NB: untested, but I'm confident it works :)
tom_
 
Posts: 423
Joined: Sep 3rd, '11, 12:26
Location: Porto Ercole, Italy

Re: How to create a catalog text file in Mageia 2 ?

Postby onikage » Dec 4th, '12, 21:02

tom_ wrote:open a terminal and type

Code: Select all
find /folder_with_your_subfolder -name "*.pdf"


should give you the list

NB: untested, but I'm confident it works :)


Thanks it worked.
onikage
 
Posts: 75
Joined: Nov 15th, '12, 18:07

Re: How to create a catalog text file in Mageia 2 ?

Postby doktor5000 » Dec 4th, '12, 23:02

tom_ wrote:
Code: Select all
find /folder_with_your_subfolder -name "*.pdf"



Minor nitpick:
Better use -iname option to ignore case, as *nix is case-sensitive.
If there's a file with a .PDF suffix instead of .pdf it will not be contained in that listing ;)
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18017
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: [SOLVED] How to create a catalog text file in Mageia 2 ?

Postby onikage » Dec 5th, '12, 05:18

Cool. Thanks.
onikage
 
Posts: 75
Joined: Nov 15th, '12, 18:07


Return to Advanced support

Who is online

Users browsing this forum: No registered users and 1 guest