Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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
vote
1answer
20 views

Find all files with characters in unicode private use areas

Something along the lines of find . <...>, but any shell approach, including other languages, is fine.
1
vote
1answer
11 views

find with regex not working as expected

I have a bunch of directories with numerical names, betwen 1 and 1,500 and I wanted to use the find command to find only these that are in range of 1,250 and 1,500, this regular expression should do ...
1
vote
3answers
48 views

How to count cells if it contains a value in Excel

I have an Excel sheet like this: ID | Relations ----+---------------- 1 | , 2 | , 3 | ,1, 4 | ,1,2, 5 | ,2, 6 | ,3, 7 | ,1,2,4, 8 | ,1,2,4,5,6, 9 | ,2,4,5,1, I want to count ...
0
votes
0answers
16 views

Wrong search results in Notepad++ when update silently is enabled

Me and a collegue are both working on some common files in these days, but usually not at the very same time (we are in the same room). I keep all files opened in Notepad++ the whole time. I was ...
0
votes
0answers
4 views

How can you find or highlight all cells having validation in Google Sheets? [migrated]

My spreadsheet has several cells that have had validation applied to them, but it would be nice to recheck them or switch the validation to a complimentary cell. After searching on Google and looking ...
0
votes
1answer
69 views

Combining multiple find commands into one

I have a bash file with the following commands to copy books from my books folder into my toread / Read Later folder find /books -name '*.pdf' -exec cp -n {} /toread \; find /books -name '*.epub' -...
0
votes
1answer
45 views

Deleting backups with `find -mtime +n` – more backups remain than expected

This is my script: find /backup/dir -mindepth 1 -depth -mtime +4 -exec rm -rf \{\} \; And after this I have always not last 4 backups but 5. I think find sucks for this. Maybe someone have any idea ...
2
votes
2answers
46 views

Multiple Search Formula in Excel [duplicate]

I am trying to find a formula which will search one cell for specific words. I would like the outcome of the formula to be words I have selected. The example of this I have is if one cell shows the ...
0
votes
1answer
46 views

Why this hard-to-understand 'find' command broke my system?

I am using archlinux and I was trying to delete core dumps file to save space on the root partition. I stupidly ran this which I found in internet without really understanding it: sudo find / -xdev -...
0
votes
0answers
30 views

Method of finding unique files has stoped working

I have been using this method from Peter John Acklam's answer to How to find / list all unique files across two directories? for about 9 months now. Today, I tried it and got this error: $ find A B -...
1
vote
0answers
29 views

Exclude System entries with “ls” or “find”

Compare Cygwin: $ ls -1 -N /cygdrive/c $Recycle.Bin cygwin64 Documents and Settings pagefile.sys PerfLogs Program Files Program Files (x86) ProgramData Recovery System Volume Information Users ...
1
vote
0answers
12 views

OSX terminal: how to move thousand of files that match a specific name pattern [duplicate]

I have some 70,000 files (basically duplicates) most of which match a name pattern like name(1).ext, name(2).ext .... name(10).ext. However among these files there are others named name (xwz).ext. ...
1
vote
1answer
36 views

Matching multiple path-components with `find`

Let's say I want to find all the node_modules folders in my Code directory: find ~/Code -name 'node_modules' -type d But what if I want to find all the setup folders, that themselves are inside test ...
0
votes
1answer
52 views

use diff against text files with list of files to find different files by size and/or modified date/time

I need to compare two folders to find files that are either: different size and/or modified date/time missing from one I cannot run diff against the two folders in my situation. My plan was to use ...
1
vote
1answer
47 views

How to place Find Results window to the right of text window?

My Find Results widow is always opened and docked and is seen under editing text file. Since strings are often short than I want both text and Find Results window to be high (but narrower). How to ...
0
votes
3answers
102 views

find: ‘echo’: Permission denied

It is my os info: sudo uname -a Linux machine 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u6 (2018-10-08) x86_64 GNU/Linux Files beginning at test in /tmp. ls -al test* -rw-r--r-- 1 debian9 ...
0
votes
1answer
46 views

What does + mean in the bash `-exec command {} +`?

For the command structure -exec command {} \;,i got info in man find. {} means selected files. ; means trminate the argument. \; escaped to protect them from expansion by the shell. In the ...
0
votes
1answer
38 views

Linux find command- display files older than 7 days - without using timestamp

there is process which creates files in every half and hour. I want to remove files older than 7 days. But when I'm running this command its removing file older than seven days from current timestamp ...
2
votes
1answer
70 views

Find fails with “Too Many Arguments” in Shell Script, but not if run directly in a Terminal

I have a work station that stores images temporarily before compressed versions are uploaded to a server for safe keeping. I have an interest in deleting old files once a day at 3 AM using a script ...
0
votes
1answer
37 views

How to find and select multiple items / values at the same time in Excel

here is an over simplified example of my problem I have 2 excel spreadsheets. The first spreadsheet has 1 column with a list of names John, James, Steve, Richard, Bob The second spreadsheet also ...
0
votes
0answers
47 views

How to use use find -iregex OR (|) operator?

Uninstalled an application, but it continues to pop up whenever I try to interact with file types that it used to be associated with. As usual, find has been invaluable in finding and eliminating ...
0
votes
1answer
51 views

How to extract a tgz which consists of many files present in multiple subfolders to another directory (ubuntu linux)

current directory ├──Folder1 ├── sub_folder1 ├──Folder2 ├── sub_folder21 ├── sub_folder22 ├── ...
0
votes
1answer
32 views

Find directories /w files with 2 different extensions

So I am trying to think how I can possibly even do this. I can find the files with this for example, but really what I want is the directories specifically that contain both file types. Any ideas? ...
0
votes
1answer
35 views

Find and rename first result in linux?

I have try using this commanline. find *.txt | head -1 | xargs -0 mv *.txt test.txt i receive. mv: target ‘02.txt\n’ is not a directory What wrong :(?
0
votes
1answer
23 views

Run command only on certain files in subfolders, depending on other files

I've got a folder called Music, that has subfolders of different artist, containing a whole lot of .flac files. I'm trying to convert all of them into the .wav file format and then convert them to ...
1
vote
1answer
33 views

mac: concatenate contents of text files across many directories; append directory names to corresponding text file contents

In the following directory structure: directory1 -subdirectoryA ---fileA.txt -subdirectoryB ---fileB.txt subdirectoryC ---fileC.txt I would like to generate a text file containing the following ...
0
votes
2answers
51 views

Can I make one command with “find . -name ”.sv“ | xargs grep -n ”word for finding“ ”

I'm trying to make an alias or something like command with grep and find command in linux. kinda "find . -name ".sv" | xargs grep -n "word for finding" " Can I make one command or aliasing with ...
0
votes
3answers
58 views

List all files and folders which have a question mark (?) in their name

I ran into an encoding problem when copying lots of files and folders from a Windows system to a Linux one and now I can see plenty of files with question mark in their name. I'd like to know how ...
0
votes
2answers
33 views

I need to find a file *.sh from my directory and subdirectories and display them without Full Path

find . -iname "*.sh" | sed 's/[.]sh$//' ./backup/samukano/ex04/who_am_i ./backup/samukano/ex05/people ./days/day01/samukano/ex01/print_groups ./days/day01/samukano/ex02/find_sh ./samukano/ex04/...
0
votes
1answer
41 views

Equivalent of a wildcard in find for batch?

I'm almost certain this is a duplicate but I was unable to find it after a lot of searching so forgive me. I'm looking for a way to have the equivalent of a wildcard in the find command. For ...
1
vote
1answer
15 views

find: equal file size limit but different unit returns different result

I noticed that the these two commands to list files below 5 GiB produce different results: find . -type f -size -5368709120c find . -type f -size -5G Specifically the one that uses kilobyte unit (...
0
votes
1answer
32 views

Highlight cell based on whether or not a specific word appears in a given range?

I have 2 sheets. Sheet1 & Sheet2. Sheet 1 has a list of items with descriptions & specific numbers. Sheet 2 has a table filled with the same items. What I am wanting to do, is highlight a ...
1
vote
2answers
49 views

how to rename all files under folder with specific extension name ( recursive approach )

we want to rename all files under /home/DB_home ( recursive ) so every file under DB_home will rename with .txt extension example before change /home/DB_home/hg/ir/qemu-ga /home/DB_home/td/...
0
votes
1answer
31 views

how to delete all files that are old then X days and ended with number/s

we want to delete all files that ended with number with digit or more as 2 digit or three digit and so on note - when files is ended with number , its tell us this file was rotate and actually backup ...
0
votes
0answers
45 views

Sed doesn't works over variable

I'm trying to combine find -exec command with a function that should strip the relative path and copy to another place (with same tree). The script looks like the follows: function makeLinks(){ ...
0
votes
2answers
53 views

Find all files & directories with group different than owner

I want to find all the files and directories that have a group different from the owner. So if these were the two files in the directory, I'd want to just find the first one: $> ls -l -rw-rw-r--...
0
votes
1answer
33 views

POSIX equivalent of OpenBSD's find -false

GNU find, FreeBSD find and NetBSD find all have option -false, but OpenBSD find does not. Granted, POSIX does not require an option -false for find, but still, this is very annoying. How can I ...
0
votes
0answers
16 views

Using aria2 instead of curl breaks text substitution

I am trying to mirror a site to archive.org but using curl is very slow so I wanted to try aria2 instead. I first make a link map of the site using this command wget -c -m --restrict-file-names=...
0
votes
2answers
34 views

ubuntu script to retain only latest file of each folders and delete everything else

We have a script which takes hourly backups and stores it inside a folder created as today's date. #CRONJOB TO BACKUP DB HOURLY DAY=$(/bin/date +%d%m%Y) TIME=$(/bin/date +%H%M%S) if [ ! -d /home/...
2
votes
3answers
616 views

Notepad++ Remove New Line Pattern - Find & Replace Command?

I want to remove a new line created after each name in a chat log file. Example: Person1:[space] their message Person2:[space] their message So I set it to extended search in Find & Replace, and ...
1
vote
2answers
217 views

Check if a specific range of values in one dataset exists in another dataset

I have two datasets, 1 and 2, each containing a number of columns with values. My end goal is to find all of the rows in dataset 1 that are different from and can't be found in dataset 2. Dataset 1 (...
0
votes
0answers
77 views

Find command script, gpg decryption, and proper shell path

I wrote a script to encrypt and decrypt symmetrically with find, gpg and inotify. paste a file to samba server, I rename it Encrypted-*, inotify triggers find & runs the commands, encrypts, ...
3
votes
1answer
49 views

find or ls does not list all files in a folder in MacOS (HFS+)

ls or find command do not seem to locate all files located in a specific folder. I'm running a Mac (under El Capitan 10.11.6 (15G21013), 500GB SSD, HFS+). In one of my folders, where I have about 700k ...
0
votes
1answer
97 views

find directories containing multiple file sharing the same basename

How would I modify the following bash instruction to get only the directories that match exactly genre_ (basename) and another genre_*. As the next step, I appended | wc -l to the second find, but I ...
0
votes
1answer
60 views

Why doesn't find work recursively with a wildcard over SSH? [duplicate]

I'm connected to a CentOS server through SSH from macOS. When I try to find with a wildcard at the beginning, it seems to only search the current directly, no recursion. But if I put the wildcard at ...
0
votes
1answer
30 views

Find Files with the same time

I have a directory which contains pairs of files. Unfortunatley, the naming scheme of the files is a mess, therefore it is very difficult to associate the pairs to each other by file name. BUT: each ...
0
votes
1answer
101 views

Logical AND and OR with grep

I want to extract the lines that matches the following logical operation: "AB+CD" AND ("nonAB+nonCD" OR "nonAB+CD"). Which means I want lines with: AB+CD,nonAB+nonCD AB+CD,nonAB+CD AB+CD,nonAB+...
1
vote
1answer
134 views

Appending new lines to multiple files

I'm trying to append new lines to multiple files with the following command: find -name *.ovpn -exec sh echo "line to append" >> {} \; before doing this, I ran a different command to make sure ...
0
votes
1answer
26 views

find generates output only when run as regular user, not root

I'm having some issues with a command that only seems to work when run as a regular user: find /mnt/data* -mmin +119 -name '*.adsr' -type f -delete 2>&1 | tee -a /log/rsynclog.txt If I use ...
0
votes
3answers
1k views

Groovy syntax not working with backslashes

I'm trying to use a backslash on the command bellow at groovy syntax: find /path/folder-* -type f -iname "file*" -exec rm -f {} \; When I try to build this command on a Jenkins pipeline give me an ...