listing every file with it's directoryForum: Other Help Topics Topic: listing every file with it's directory started by: clacker Posted by clacker on Aug. 08 2004,11:45
Is there a way to get a listing of every file on the system, similar to the output from tar -t??? Besides the obvious:tar -cvf mytar * tar -tvf mytar I am trying to make a dsl for a program that runs a lot of configuration programs after the *.deb files load with apt-get. What I would like to do is get a listing of every file in /ramdisk and /etc, including full path names and file sizes, before and after I load the new program. Then I want to take any line in the second file that isn't in the first (using grep) and add that entry to a file. Then I will take that file and use tar with the -T command to make my dsl. Posted by roberts on Aug. 08 2004,15:12
Sure, use the find command.find /home -print > myfiles.lst or cd desired_dir find . -print > myfiles.lst There are lots of options to find. It is one of the most useful commands. Posted by ke4nt1 on Aug. 08 2004,15:36
....ke4nt sneaks in for a bite.... roberts, I have wanted to do this very thing many times before to see how an extension affects the file system... So , would this work..... "find / -print > b4.txt" before installing an app.... then "find / -print > aft.txt" After installing the app.... then "diff b4.txt aft.txt > newlist.txt" ? Would this work? 73 ke4nt Posted by roberts on Aug. 08 2004,18:55
Yes, but I would filter out stuff not really needed in the list list /KNOPPIX and /proc maybe /dev also mnt if you have a bunch of other drives mounted.Just create pipes to grep -v find / -print | grep -v proc | grep -v KNOPPIX > mylist.txt Using *nix one becomes a wordsmith. Posted by clivesay on Aug. 08 2004,19:19
Lots of good stuff to know around here. I am going to have to start printing things and placing them in a binder!
Posted by mikshaw on Aug. 08 2004,21:01
The "-print" option is default, isn't it? I've never used it anyway....
Posted by roberts on Aug. 08 2004,22:07
default is -print. But nice to explain things. Like I said many options with find. The "swiss army knife" of *nix commands .
Posted by clacker on Aug. 08 2004,23:46
Great. This was just what I needed. I looked at the manpage for find to check out the options you mentioned and saw that they even have a switch to find files modified after a target file. So I can use:touch /home/dsl/myMarker <do my apt-get stuff in here> find / -newer /home/dsl/marker | grep -v proc | grep -v KNOPPIX > myfiles I learned a lot from this, thanks. Posted by chibiace on Aug. 09 2004,04:20
mmmm this could be useful.
Posted by Alisdair Kelly on Aug. 09 2004,12:15
[QUOTE]mmmm this could be useful.That may be the understatement of the week. This group/forum is remarkable for the ideas and the solutions to problems. "Me 'ats off ta ye all!" Posted by clivesay on Aug. 09 2004,15:44
I agree!! The people who stick with the major distros really limit themselves. I am proud of myself for sticking it out with the small distros even though I have been often frustrated. It is so great to interact with such bright and innovative people. I consider myself kind of innovative but a little more dim than bright. Chris Posted by optixz on Aug. 10 2004,22:03
This seems like a simple task for 'ls' as welljust type the following cd destination_dir ls -alR The capital R is needed for recursive listings of directories I've taken a note on using the find command though. Very good tip. Posted by ke4nt1 on May 22 2005,04:10
bookmark
|