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.
1,044
questions
-2
votes
2
answers
78
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 ...
0
votes
0
answers
22
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, ...
1
vote
1
answer
41
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 ...
0
votes
1
answer
37
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?
0
votes
2
answers
63
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*.*...
0
votes
0
answers
50
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 ...
1
vote
1
answer
130
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 \{...
0
votes
1
answer
160
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 ...
2
votes
1
answer
167
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 ...
0
votes
1
answer
43
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 ...
0
votes
1
answer
350
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 ...
1
vote
0
answers
74
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 ...
1
vote
3
answers
327
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 ...
-3
votes
2
answers
542
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?
0
votes
2
answers
84
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 ...
0
votes
1
answer
101
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";&...
1
vote
1
answer
211
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
│ └── ...
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 ...
1
vote
1
answer
379
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 ...
2
votes
1
answer
715
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 ...
3
votes
1
answer
360
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 ...
3
votes
1
answer
633
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 ...
1
vote
1
answer
222
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 ...
0
votes
0
answers
35
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 ...
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
...
1
vote
2
answers
341
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 {} \;...
-1
votes
2
answers
116
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/...
11
votes
1
answer
628
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 ...
1
vote
1
answer
387
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 ...
2
votes
1
answer
1k
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\...
1
vote
0
answers
55
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 ".*".
1
vote
1
answer
996
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 ...
2
votes
1
answer
33
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/...
0
votes
1
answer
421
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 ...
0
votes
0
answers
103
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" -...
0
votes
1
answer
391
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 $...
0
votes
1
answer
452
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 ...
0
votes
1
answer
436
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 -...
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 ...
0
votes
1
answer
201
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 ...
0
votes
1
answer
126
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 "/...
0
votes
1
answer
402
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 ...
0
votes
1
answer
283
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 ...
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....
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 ...
1
vote
1
answer
1k
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. ...
1
vote
1
answer
2k
views
Searching for multiple line breaks in Notepad++
I have a large text file that I am editing in Notepad++ and want to search for all instances where there are two line breaks and a particular string of characters on the following line (i.e., two left ...
0
votes
1
answer
3k
views
Google Chrome Bookmarks File is NOT in the Default Folder Everyone Says It's In -- So Where Is It?
I have hundreds of bookmarks in Google Chrome, on my Windows 10 system, and they all work fine in Chrome, but I want to look at the place where they are on my computer, and I can't find them. I am ...
0
votes
0
answers
49
views
How to highlight text that is not available as typical HTML Element Text?
We can press Ctrl + F in browser to find a text on the page as it gets highlighted if found a match. Even we can use good browser extensions to define our keywrords and then use the extension ...
0
votes
0
answers
436
views
Random "The active directory domain services is currently unavailable" error
This error started appearing today, seemingly at random times, while I'm working, browsing or gaming. The following 2 windows open. I tried finding more info using Process Explorer and apparently the ...