Skip to main content

Questions tagged [find]

The find command in Windows systems is used to filter lines of input text, and return those matching the filter. The find command in *nix system is used to locate files or folders that match a certain criteria.

Filter by
Sorted by
Tagged with
-1 votes
0 answers
31 views

How to bulk rename if file contents found? [closed]

I need a script the will search the contents of a file for a particular string, and if found I’d like to replace a portion of the file name with something else. There’s currently about 300,000 files ...
Sarah Eastman's user avatar
0 votes
1 answer
78 views

I want my macro to find all words (in a certain unformatted document) that start with a certain string ("yyy") give these words a different formatting

I want to find all words (in a certain unformatted document) that start with a certain string ("yyy") and give these words a different formatting. The following VBA-code executes once and ...
Bert van der Saag's user avatar
0 votes
1 answer
56 views

Setting Details View by default after a find operation - Windows 10

When I perform a find operation inside a folder, the default view is Content. Is it possible to set it as Details (only for find's results, not for the file explorer)?
Federica Guidotti's user avatar
0 votes
0 answers
14 views

"find" command does not find all files from root unless folder is specified [duplicate]

I am trying to find the files that are named setenv.sh on this machine, I am logged in as root and am searching from the '/' using the following syntax and receiving the output: # First [root@...
user1917670's user avatar
-2 votes
2 answers
99 views

Can ionice reduce wear and tear on hard disks?

Without knowing how ionice works functionally, I was wondering if ionice more smartly batches disk I/O operations for more efficient physical movement (spinning disks specifically). I run a lot of ...
Sridhar Sarnobat's user avatar
0 votes
0 answers
23 views

windows-equivalent of mac's "insert pattern" functionality for {find,search}ing/replacing text

surprised no one has asked this question yet. is there any way to get the "insert pattern" functionality that is available on pretty much all mac apps with search and replace (except, ...
gagan's user avatar
  • 1
1 vote
1 answer
268 views

How to "find" while following specific symlinks on Linux?

I would like to find files (with similar feature to find), but follow and only follow specific symlinks (by pattern matching). Apparently find itself cannot handle it: There is no option to setup ...
user2771324's user avatar
0 votes
1 answer
85 views

Linux Find directories that don’t containing a specific type of file? [duplicate]

I'm new to Linux and I want to find directories which doesn't contain a type of file, like *.jpg. Is there a parameter of the find command to do that?
Daydreamer067's user avatar
0 votes
2 answers
507 views

Find and delete files with linux command line

I want to delete all files containing "chrome". I have this command on linux : find . -type f -name '' -print -delete after name I don't know what to put. I tried *chrome* or *chrome*.*...
Daydreamer067's user avatar
0 votes
0 answers
102 views

How to recursively search for files starting with ".#" under a path in zsh?

In the current working directory, la -a returns, . .#program 2.py .DS_Store picker.py .#picker 2.py .#program 3.py hw1 temp.test .#picker.py .. hw2 I ...
scribe's user avatar
  • 206
1 vote
1 answer
193 views

In `find`, after using a test like `-type d`, how can I at some point undo this setting, so the rest evaluates as if `-type d` wasn't there?

When using the command find, I often need to have a flow control, e.g. if .. then. A simplified example; find ~ -maxdepth 1 -type d -exec echo -e "\nnext beg of new dir::" \; -exec ls -lad \{...
Anton Wessel's user avatar
0 votes
1 answer
333 views

How to find and delete folders that are 15 days older using cron jobs in Truenas Scale?

I have security camera in my home it upload recorded videos to my Home NAS every one hour time intervals which is powered by Truenas Scale Operating System now all the footage are stored in my NAS I ...
user avatar
2 votes
1 answer
184 views

Linux file search: fdfind command vs. fdz command

I'd love to use the fdz command to search for files on a Linux system, the presentation of fdz results is much more pleasant. But there's something I need to resolve first. An example will be much ...
mazda's user avatar
  • 177
0 votes
1 answer
67 views

Delete line with batch script when testing only the first 4 characters on the line

How can I search in lines in the batch file. And only if the first 4 chararcters start with SLUI or VRLP then the line must be deleted. Now I have the following commands in script, only the line will ...
Nico den Breejen's user avatar
0 votes
1 answer
792 views

Regex to find more than one occurrence in GrepWin

I want to find more than one occurrence of the tag h1 in multiples files. The following regex brings files that has it more than 2 times, which is working great: /(h1.*){2}/ However, what if I want ...
Mike's user avatar
  • 377
1 vote
0 answers
101 views

Using aspell to check many files in a cancellable way

I'm on macOS and using zsh. I have about a hundred Markdown files which I would like to spell check from the command line. It seems like aspell is the right way to do this, however I want to be able ...
Nick K9's user avatar
  • 141
1 vote
3 answers
652 views

How to strip suffix with basename inside a find -exec command?

I have not found a way to do the following example with find: $ find . -name "*.mp3" -exec echo $(basename "{}" ".mp3") \; I expected the basename command to remove ...
will's user avatar
  • 229
-3 votes
2 answers
934 views

ls -R instead of find

I can see ls -R lists all files and folders. I can grep the file name from the list. What are the advantages of "find" ? Also, any caveats if I use ls -R instead of find?
Bijo's user avatar
  • 1
0 votes
2 answers
100 views

Can `find` piped to `echo` be used to do massive harm?

I am currently taking the Google cybersecurity coursera cert course. I am now in the Linux section and learning a few Linux commands, I am totally new to it but I was wondering about one thing. While ...
user avatar
0 votes
1 answer
135 views

AIX find file age in seconds no -printf with find

AIX 7.2 Looking to recreate the below on AIX. find /etc -maxdepth 1 -iname "*conf" -type f -mmin +5 -printf '%p;%T@\n' | awk -F ';' -v time="$( date +%s )" '{ print $1";&...
mdtoro's user avatar
  • 3
1 vote
1 answer
253 views

find and rename base directory and files under each basedir, add a prefix

I would like to recursively rename all matching directories and files under a path with a prefix that depend from the current directory. . ├── G1_BIN_REFINEMENT │   └── marker_genes │   └── ...
user1967473's user avatar
1 vote
1 answer
1k views

Excel - return True/False value by searching multiple keywords in one column

I need help with returning results for several keywords in multiple columns in an Excel sheet, and I'm having trouble finding a similar scenario using search engines, so apologies if this has already ...
Yasmin's user avatar
  • 13
1 vote
1 answer
729 views

How to tell which files are new or have been modified between calls of a script

I want to call a shell script regularly, and in it I need to process the files present in a directory tree that are new or that have been modified since the previous call of the script. My 1st thought ...
dargaud's user avatar
  • 220
2 votes
1 answer
884 views

List only bottom level directories using find

So, let's say I use find to search a directory for folders. find "/home/user/Documents" -type d -print While this does list all the directories in said location, I only want to get the ...
Eduardo Perez's user avatar
3 votes
1 answer
416 views

Notepad++ Delete Multiple Lines with Find in Files

I want to delete the whole line that contains certain words such as: build, name, disk. I know that there is a search string ^.*?build.*$(\R|\Z) which will find lines containing "build" How ...
wikisP's user avatar
  • 33
3 votes
1 answer
829 views

Color of the highlight of the found word is too faint to see in Word 365

When I use the "Find and Replace" feature, the word that has been found is highlighted in a very faint gray such that I can't see it very well. How can I change the default color that MS ...
Eddie Gnz's user avatar
1 vote
1 answer
239 views

How to find 2 consecutive words, but counting only the shortest string [closed]

I want to be able to search in Notepad++ for a string that begins with a [startWord] and ends with an [endWord]. Additional conditions: the [startWord] and [endword] can each only appear once in the ...
Atlantida23's user avatar
0 votes
0 answers
43 views

How can I find an alias to a server that no longer exists on Mac M1Max Verntura 13.2

I installed Carbonite on my Mac. Every time it runs it produces an Apple dialogue box that says it is unable to find the server "Craig's Computer Server". Note the ' mark. This causes ...
evan-e-cent's user avatar
0 votes
1 answer
37 views

How to transform nested subfolders into a single subfolders

Whats a good way of “collapsing“ subfolders of a specified directory into a single folders whose name is a join the subfolders? So given this directory structure… ./zero.csv ./reports/r1/a/b/c/one.csv ...
Ashley Coolman's user avatar
1 vote
2 answers
512 views

Cygwin find returns "missing argument to `-exec'"

I have backups script that removes backups older than x days. On Linux machine this is working well: find /backups/dummy-prod-db -name "*_D_dummy-prod-db*" -type f -mtime +7 -exec rm -v {} \;...
Kamil's user avatar
  • 2,666
-1 votes
3 answers
228 views

How do I list all directories with include same name subdirectory?

My musiclibrary is a mess. I try to create this structure: /music /music/artist/album/ For some reason I have several artist with this structure. /music /music/artist/artist/ /music/artist/...
jafi's user avatar
  • 3
11 votes
1 answer
645 views

In bash, how to find all copies of a given file in particular directories?

Let's say we have a file /a_long_path_1/foo.doc of size, say, 12345 bytes, and we would like to find all copies of this file in directories /a_long_path_2 and /a_long_path_3 including all their ...
user avatar
1 vote
1 answer
531 views

Set "Find in page" starting position in Firefox (works in Chrome)

Summary Is it possible for "Find in page" (built-in browser page search) to work in Firefox like it does in Chrome, specifically: can one specify, by clicking on the page, the start point on ...
coderbot's user avatar
2 votes
1 answer
2k views

Bash find using regex fails with digit matching

I'm using find (GNU findutils) 4.7.0 with GNU bash, version 5.0.17. touch hello.32.world.txt find . # works, output is: ./hello.32.world.txt find . -regextype posix-extended -regex '.*hello\.32\.world\...
Andrew Parks's user avatar
1 vote
0 answers
91 views

UNIX command find starting directory .*

Can you explain what does the following UNIX command find does? find .* where .* - starting directory. I know "." is current directory, but cannot find the explanation about ".*".
StaceyKosheen's user avatar
1 vote
1 answer
1k views

Find files containing a string and execute command

How do I find files that contain a specific string and execute a command on these files? In my case, I'd like to find all *.md files that contain the string ^ - HIMS$ and stage them with git. I know ...
longing-for-an-answer's user avatar
2 votes
1 answer
35 views

Inconsistent behavior from 'find' on zfs under Linux

I was checking to see if I had multiple copies of python on my system today, and I got some super strange behavior from find: mark@neverland:~/repos/lpod-python$ ls -i /bin/python3.10 534638 /bin/...
MTippetts's user avatar
0 votes
1 answer
447 views

Move and rename files based on their parent folders

I'm trying to write a Bash function that will find files in a given directory tree and move them to the current folder while renaming them based on their parent folder, but I'm still stuck on the ...
Hashim Aziz's user avatar
0 votes
0 answers
140 views

How to move all old files from Downloads to the trash with one or more terminal commands in macos?

I already found the command with which I can select all the files and directories that I do not want to send to trash. That command looks like this: find ~/Downloads -newerat "2 months ago" -...
Evert's user avatar
  • 131
0 votes
1 answer
531 views

Make an alias work in "that" directory? Even if created in .zshrc [duplicate]

This is zsh but perhaps applies to other shells. Say you are in directory /foo and you % find $PWD -name '.*' it works fine, results are from /foo. Now (in /foo) type this % alias crazy="find $...
Fattie's user avatar
  • 121
0 votes
1 answer
520 views

Find folders that contain only one specific file (.DS_Store) and no others?

Is there some way to use the find command in macOS terminal to find all folders recursively within a given path that are virtually empty, or empty aside from a single .DS_Store file? I've tried the ...
MikMak's user avatar
  • 2,107
0 votes
1 answer
922 views

What does this find command with options mean?

When i run this command in Debian sudo find . ! -name . -type d -or -type f It lists all the files in the current path, but not the directories, so I think I know what it does. But what does the -...
Tlink's user avatar
  • 179
0 votes
1 answer
2k views

find + how to delete files that exists only on specific folder

to delete files on under folder we can use the following approach with find find /home -type f -delete but how to delete recursive only the files that exists under temp folder ? lets say we have the ...
King David's user avatar
0 votes
1 answer
223 views

Detect files with multiple extensions

I've a synology running a kind of linux OS. I've transfered there a lot of photos. Unfortunately, some are with .jpg and some with .JPG depending of the tool I used to import. These are considered as ...
Skippy's user avatar
  • 13
0 votes
1 answer
159 views

Insert new line if file contain string

I need to insert 'import packagename' to the line after imports. In files which contains the specific word. What I try: find iOS/Chat \ -type f \ -name "*.swift" \ -exec gsed -e "/...
Bimawa's user avatar
  • 101
0 votes
1 answer
468 views

How to do a recursive filename `find` from the shell using a glob pattern with "set braces"

From the shell, I'd like to recursively search a directory for a given glob pattern. But I want to use set-braces-syntax in my pattern: find ~/path/to/dir -name '*.{h,m}' Here I'd like to recursively ...
Todd Ditchendorf's user avatar
1 vote
1 answer
348 views

Pass each find result as an argument with prefix to exec

I would like to find some files and turn them into a chain of arguments for a command. What I have so far is: find . -name '*.yml' -exec cmd -f {} \+ which results in cmd -f ./foo.yml ./bar.yml but ...
milkpirate's user avatar
1 vote
0 answers
2k views

Can I use regex in find path?

env = bash, centos7 My goal is to delete jenkins workspace cache files under specific path, except for today's. Successful command : cd /jenkins/jenkins/workspace/CMSvc_Build/caches/modules-2/files-2....
Lunartist's user avatar
  • 159
1 vote
1 answer
2k views

How to find a character in a string using Powershell?

Using Contains to find a value using PowerShell is not working. Full Story: I have to get the PartNo, Ver, and Rev values from an SQL DB, and check if these values occur in the first line of the text ...
Brute's user avatar
  • 23
1 vote
1 answer
2k views

7-zip windows command to extract .rar from a networkshare recursively but keep files in the dir with the .rar file

Long story short I have one folder on a network share, that has 200+ other folders in them, some of which have .rar files in them. I want to extract all the .rar files IN PLACE. Not to another dir. ...
Taeleus's user avatar
  • 13

1
2 3 4 5
21