Questions tagged [gnu-findutils]

GNU's basic directory searching utilities (Unix filesystem CLIs)

The GNU Findutils package comprises the following CLIs, which relate to finding directories and files on Unix systems:

  • find - search for files in a directory hierarchy
  • locate - list files in databases that match a pattern
  • updatedb - update a file name database
  • xargs - build and execute command lines from standard input

Linux distributions typically come with find and xargs from this package; while locate and updatedb are typically also present, they may come from a different source.

See http://www.gnu.org/software/findutils/

82 questions
0
votes
2 answers

Using find command in Bash script and excluding the subdirs

I wrote some function that should find a directory inside a parent directory, but the thing is that it's taking to long, probably it's searching in the subdirectories as well. Here is my code: function findMspDir () { mountedDir=/opt/SwDrop/ …
Alex Brodov
  • 3,365
  • 18
  • 43
  • 66
0
votes
1 answer

find / sed to find a file and replace a substring

I am trying to use findutil / sed / grep in windows to look for a particular file in all drives, look for a substring in that file and replace it with a new substring. From what I have worked out, I have to do this one drive at a time and then cd to…
0
votes
1 answer

Unix, search for string in multiple files. ( Case sensitive, and accept if the string is in a string )

I've been using this command: find /path~ -type f | xargs grep -iR STRING1 to find strings in multiple files, but i was wondering me how can i find a string in multiple files, Case Sensitive, and even if the string is in other string. For…
user3672754
0
votes
2 answers

Change PHP tags with shell command

my problem is this: I try to change all tags (
user3680708
  • 117
  • 2
  • 9
-1
votes
1 answer

How to exclude a hidden folder from being deleted

The following command will remove all files and folders in the current directory, except for those mentioned. find . -mindepth 1 ! -path '*testResults*' ! -path '*artifacts*' ! -path '*node_modules*' -exec rm -r {} + 2>/dev/null My question is: how…
Idan Adar
  • 44,156
  • 13
  • 50
  • 89
-1
votes
1 answer

Why doesn't Linux GNU find -size match du or ls -l?

While working in a UNIX environment via SSH today, my cohort stumbled on a seeming idiosyncrasy in the GNU findutils related to the -size flag. When I run the ls -l command, it tells me a file is 155 bytes in size. But running find ~/ -size -1K…
-2
votes
1 answer

Why and when do source and dot behave differently in find -exec {}

I have heard it said, multiple times, that in Bash source is merely an alias for .. Even in the Bash man page. However, I've noticed, while digging into this question that they are not identical when called via find. Here is a reproducible…
Uberhumus
  • 921
  • 1
  • 13
  • 24
1 2 3 4 5
6