Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find files excluding symbolic links?

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 ?

like image 971
Barth Avatar asked Apr 30 '13 15:04

Barth


People also ask

Does find follow symbolic links?

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 .

Does removing symbolic link remove the file?

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.

How do I find all files not containing specific text on Linux?

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.

How do I find all symlinks in Windows?

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.


1 Answers

Check the man page again ;) It's:

find /path/to/files -type f 

type f searches for regular files only - excluding symbolic links.

like image 67
hek2mgl Avatar answered Sep 22 '22 01:09

hek2mgl