I have the following version of locate:
$ locate --version
mlocate 0.26
Copyright (C) 2007 Red Hat, Inc. All rights reserved.
This software is distributed under the GPL v.2.
This program is provided with NO WARRANTY, to the extent permitted by law.
I am trying to find all files (not directories) that have some specific basename, e.g. python
, so I've tried the following:
$ xargs -a <(locate -b '\python') -I{} file {} | sed -E '/directory|symbolic/d;s/:.*$//g'
This prints exactly the expected output. However, I wonder if there is an efficient way to achieve that instead?