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 ?
By default, find examines symbolic links themselves when it finds them (and, if it later comes across the linked-to file, it will examine that, too). If you would prefer find to dereference the links and examine the file that each link points to, specify the ' -L ' option to find .
The symbolic link does not contain any data, but you can perform all operations on the symbolic link file. Removing a symbolic link does not delete the original file, but deleting a file makes the symlink a dangling link.
You can do it with grep alone (without find). grep -riL "somestring" . -L, --files-without-match each file processed. -R, -r, --recursive Recursively search subdirectories listed.
In Command Prompt, run this command: dir /AL /S c:\ A list of all of the symbolic links in the c:\ directory will be returned.
Check the man page again ;) It's:
find /path/to/files -type f
type f
searches for regular files only - excluding symbolic links.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With