Operating System - HP-UX
1753765 Members
5785 Online
108799 Solutions
New Discussion юеВ

list of all files in Unix

 
SOLVED
Go to solution
djoshi
Frequent Advisor

list of all files in Unix

Can anyone tells a single UNIX command to generate a list of all 4ge files in the system along with path,date and time stamp of these files

Thx,
5 REPLIES 5
Deeos
Regular Advisor
Solution

Re: list of all files in Unix

Hi,


Yes, it is possible. you can get this by doing this command

#ls -lR|more

it will full fill answer of your question and if you want all these file output record in a file, you can do:

#ls -lR > /systemfile




Regards
Deeos

Deepak
Pete Randall
Outstanding Contributor

Re: list of all files in Unix

ls -lR *.4ge

would probably work more closely to what you desired.


Pete

Pete
Deeos
Regular Advisor

Re: list of all files in Unix

HI,


As per Pete,
#ls -lR *.4ge

it will give you probabaly what you want! but you execute this command on "/" directory.


Regards
Deeos




Deepak
djoshi
Frequent Advisor

Re: list of all files in Unix

Thank you all
Steven Schweda
Honored Contributor

Re: list of all files in Unix

> [...] generate a list of all 4ge files in
> the system [...]

What's a "4ge file"?

> ls -lR *.4ge
>
> would probably work [...]

Really? Have you tried that? Does it see
any "*.4ge" files in a subdirectory? Around
here, for example, looking for "*.c":

dyi # ls -lR
total 16
-rw-r--r-- 1 root sys 476 Feb 15 2010 junk.c
drwxr-xr-x 2 root sys 96 Aug 16 21:39 subdir

./subdir:
total 16
-rw-r--r-- 1 root sys 476 Feb 15 2010 junk2.c

But:

dyi # ls -lR *.c
-rw-r--r-- 1 root sys 476 Feb 15 2010 junk.c
dyi #

Perhaps more useful:

dyi # find . -name '*.c' -exec ls -l {} \;
-rw-r--r-- 1 root sys 476 Feb 15 2010 ./junk.c
-rw-r--r-- 1 root sys 476 Feb 15 2010 ./subdir/junk2.c


Note that here "*.c" is quoted to keep the
shell from expanding the wildcard file name.


Of course, on an OS with a different design,
this sort of thing can be easier:

alp $ dire /date /size [.test...]*.txt

Directory ALP$DKA0:[SMS.TEST]

FRED.TXT;1 1596 22-DEC-2007 00:09:21.02

Total of 1 file, 1596 blocks.

Directory ALP$DKA0:[SMS.TEST.B]

BB.TXT;1 1 1-MAY-2008 14:57:25.77

Total of 1 file, 1 block.

Directory ALP$DKA0:[SMS.TEST.C]

CC.TXT;1 1 1-MAY-2008 14:57:33.66

Total of 1 file, 1 block.

Grand total of 3 directories, 3 files, 1598 blocks.

But that's VMS DCL, not a UNIX shell.


> Thank you all

But if you're happy, ...