niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » *nix » Linux » Distributions » RedHat
how can i make a complete file system
Post new topic   Reply to topic Page 1 of 1 [6 Posts] View previous topic :: View next topic
Author Message
Tommy
*nix forums beginner


Joined: 26 Mar 2005
Posts: 9

PostPosted: Tue Aug 02, 2005 11:50 pm    Post subject: how can i make a complete file system Reply with quote

i was told you can make a command find / > file-list
but i want the file properties i.e file size, date modified,
permissions.

thanks
Back to top
HASM
*nix forums addict


Joined: 01 Jul 2005
Posts: 69

PostPosted: Wed Aug 03, 2005 1:20 am    Post subject: Re: how can i make a complete file system Reply with quote

"Tommy" <tom23499@yahoo.com> writes:

Quote:
i was told you can make a command find / > file-list
but i want the file properties i.e file size, date modified,
permissions.

Either of these should work:

find / -exec /bin/ls -l '{}' ';'
find / -print0 | xargs -0 /bin/ls -l

though you may possibly want to add "-xdev" and/or a combination of
"-fstype <type>" not to follow some mount points, and maybe avoid scanning
/proc or /var with something like "-not -regex '/proc/*'".

You will need to be super-user to be able to descend some directories.
There's also some pretty print file systems tree printing programs around.

-- HASM
Back to top
Nicholas Andrade
*nix forums addict


Joined: 23 Feb 2005
Posts: 84

PostPosted: Wed Aug 03, 2005 2:33 am    Post subject: Re: how can i make a complete file system Reply with quote

Tommy wrote:
Quote:
i was told you can make a command find / > file-list
but i want the file properties i.e file size, date modified,
permissions.

thanks

Alternatively, to what HASM suggested, ls -lR > file-list would work as

well. Note that the output is a flat file, and if the purpose of this
is to create a file that can be searched, etc. than the program slocate
works much better.
Back to top
tom23499@yahoo.com
*nix forums beginner


Joined: 03 Aug 2005
Posts: 5

PostPosted: Wed Aug 03, 2005 12:11 pm    Post subject: Re: how can i make a complete file system Reply with quote

Tommy wrote:
Quote:
i was told you can make a command find / > file-list
but i want the file properties i.e file size, date modified,
permissions.

thanks

thanks to both replies. i tried out all commands and they were exactly
what I was looking for. the only one that gave me trouble was the
command -> find / -exec /bin/ls -l '{}' ';'

not sure if it was a typo but bash shell gave the error -> find:
missing argument to 'exec'.

thanks again vey much appreciated.
Back to top
Nicholas Andrade
*nix forums addict


Joined: 23 Feb 2005
Posts: 84

PostPosted: Thu Aug 04, 2005 4:22 am    Post subject: Re: how can i make a complete file system Reply with quote

tom23499@yahoo.com wrote:

Quote:
Tommy wrote:

i was told you can make a command find / > file-list
but i want the file properties i.e file size, date modified,
permissions.

thanks


thanks to both replies. i tried out all commands and they were exactly
what I was looking for. the only one that gave me trouble was the
command -> find / -exec /bin/ls -l '{}' ';'

not sure if it was a typo but bash shell gave the error -> find:
missing argument to 'exec'.

thanks again vey much appreciated.

I'm inclined to say it's syntax error as well (I believe find expected a

\ at the end. eg. to move all files ending in .txt to /home/txt use:
find . -name "*.txt" -exec mv '{}' /home/txt/ \;
Back to top
HASM
*nix forums addict


Joined: 01 Jul 2005
Posts: 69

PostPosted: Thu Aug 04, 2005 3:07 pm    Post subject: Re: how can i make a complete file system Reply with quote

Nicholas Andrade <SDNick484@nospam.yahoo.com> writes:

Quote:
command -> find / -exec /bin/ls -l '{}' ';'

I'm inclined to say it's syntax error as well (I believe find expected a \
at the end. eg. to move all files ending in .txt to /home/txt use: find
. -name "*.txt" -exec mv '{}' /home/txt/ \;

Not quite, find expects a ; (semi-colon) to terminate an -exec clause.
However, as the semi-colon is also usually the command separator, one needs
to escape it or the shell will not pass it on to find.

Escaping can be done with backslash or single quoting (most cases). All
four command lines below work on my system, with bash or zsh:

find / -exec /bin/ls -l \{\} \;
find / -exec /bin/ls -l '{}' ';'
find / -exec /bin/ls -l '{}' \;
find / -exec /bin/ls -l \{\} ';'

Try it, with /tmp instead of /, or you'll have to kill the command or wait
for it to complete :-)

-- HASM
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [6 Posts] View previous topic :: View next topic
The time now is Fri Jan 09, 2009 8:07 am | All times are GMT
navigation Forum index » *nix » Linux » Distributions » RedHat
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Running php file everyday on scheduled time sachin PHP 1 Fri Jul 21, 2006 12:49 pm
No new posts Bug#379104: ITP: complearn-mpi -- parallel quartet tree s... Rudi Cilibrasi devel 0 Fri Jul 21, 2006 11:30 am
No new posts Bug#379103: ITP: complearn-gui -- 3D drag-and-drop interf... Rudi Cilibrasi devel 0 Fri Jul 21, 2006 11:00 am
No new posts Regarding thesaurus iso file Srikanth modules 0 Fri Jul 21, 2006 10:42 am
No new posts make printer network available Johann Höchtl networking 0 Fri Jul 21, 2006 9:01 am

Loans | Credit Card Consolidation | Loans | Cheap Loan | Credit Card Consolidation
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.2431s ][ Queries: 16 (0.1574s) ][ GZIP on - Debug on ]