I want to find files in Linux that follow a certain pattern but I am not interested in symbolic links.
There doesn't seem to be an option to the find
command for that.
How shall I do ?
I want to find files in Linux that follow a certain pattern but I am not interested in symbolic links.
There doesn't seem to be an option to the find
command for that.
How shall I do ?
This works for me:
Actually, don't really need the -H
Like @AquariusPower say, the use of
find -type f -xtype f
solved my problem, and now I get only real files and not symbolic links anymore.From: https://linux.die.net/man/1/find
I got:
Thanks.
Check the man page again ;) It's:
type f
searches for regular files only - excluding symbolic links.For example, if you want to search all regular files in /usr/bin, excluding symlink:
I have readed the MAN and now it seems is -P also, using -type r would raise an error. also notice is the DEFAULT behavior now.
Do you want it to follow symlinks but not return them (if they match your pattern)?
find -H
?