1753849 Members
8092 Online
108807 Solutions
New Discussion юеВ

find syntax

 
SOLVED
Go to solution
Chapaya
Frequent Advisor

find syntax

Hello ,

i want to find all the links in the system ,
what is the syntax ?

Eran .
5 REPLIES 5
Jean-Luc Oudart
Honored Contributor
Solution

Re: find syntax

find / -type l

man find

Rgds,
JL
fiat lux
Robert-Jan Goossens
Honored Contributor

Re: find syntax

Hi Eran,

# Find / -type l -exec ls -l {} \;

Robert-jan.
Tim Adamson_1
Honored Contributor

Re: find syntax

Hi,

If you are trying to find all the symbolic links, use something like this:

# find / -type l <<< lowercase L

Refer to the find(1) man page for more information.

I don't think it will find hard links. Are you also after hard links?

Hope this helps.


Tim
Yesterday is history, tomorrow is a mystery, today is a gift. That's why it's called the present.
Jean-Luc Oudart
Honored Contributor

Re: find syntax

if you need more details, you can pipe into xargs :
find / -type l | xargs -l20 ll
(less costly than the exec option)

Rgds,
Jean-Luc
fiat lux
Graham Cameron_1
Honored Contributor

Re: find syntax

If you have nfs mounts, then some of the above suggestions will take a long time to scan all the remote file systems and may turn up results you don't want.
Likewise if you have CDs mounted, these will also be scanned.

Run "mount -p" and if you see any with "nfs" in the 3rd col, these denote remote nfs mounts. You need to exclude then from your search, using:

nice find / -fsonly vxfs -type l -exec ls -ld {} \;

Note, the "vxfs" above matches what was returned in col 3 of the mount -p command. It could be (hopefully not) that you are running hfs, in which case use "hfs" instead of "vxfs".
See "man find" and look at the -fsonly switch.

And I always prefix "find" with "nice", in order not to be too antisocial!

-- Graham
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.