find is a command line utility to search for files in a directory hierarchy

learn more… | top users | synonyms

2
votes
2answers
48 views

Assistance in how to display write only files for a user specified folder

I'm writing a script that allows a user to enter in a folder of there choice. Upon completion, the script will then search starting from the root for the folder and display all the files within that ...
2
votes
1answer
85 views

How to get filenames when using find and sed

I am writing a script to apply sed on certain files and then list files that have been changed so that I know which have been modified. This is how I am finding and then using sed: find . -type f -a ...
2
votes
1answer
42 views

Is there a version of the 'find' command that saves its state?

If a find is searching a large disc, and is aborted for some reason, I'd like to be able to start it again, from where it left off. Is there a version of 'find' that does this? The problem is that, ...
1
vote
1answer
26 views

Find Source Files for OpenGL on Host

I am a newbie to linux. I just installed openGL on ubuntu and would like to tweak some of its source files I use in order to print certain results of some calculations done. I found the header file ...
1
vote
1answer
46 views

copying and working on OSX .app files (folders) in linux

tldr; I want to run a script over an external hard drive and tar.gz every folder that ends with .app into their own archive. That is, I don't want them all in one tar.gz file, I want to create one ...
1
vote
1answer
226 views

Find files older than a given file - a few hours

I'm using the following to find all files that are older than a reference file... find /home/testuser -name "dummyfiles*" ! -newer referencefile.txt ... which works as expected. However, I want to ...
1
vote
1answer
19 views

What changes are made to ./.dns?

My server hosted at Hostgator was recently hit by malware and hence to monitor the file system I use find -mmin -xx command at regular intervals. But everytime I run the find command, I see the first ...
1
vote
1answer
50 views

Different results OS X/Linux with “find PATH -mount \( -type f -o -type d \) -print0 | LC_ALL=C sort --zero-terminated > OUTPUT.txt”

this command is part of a script I use for comparing files: find test/ -mount \( -type f -o -type d \) -print0 \ | LC_ALL=C sort --zero-terminated > OUTPUT.txt // test/ is the PATH ...
0
votes
1answer
27 views

Recursive Directory search, Showing most recent file in folder

Can someone point out where am going wrong please. Am doing a directory search (Based on the folder structure and file type) The folder structure is the same for every customer. Just the customer ...
0
votes
1answer
21 views

Why find is not finding some folders with spaces?

find -name "* *" -type d | rename 's/ /_/g' For instance, 'Paired End' folder name on this path is not being replaced with spaces: ...
0
votes
1answer
31 views

Does find Command Do Match For Regexp Because Of Implementation?

In this case discussed: find (GNU findutils) 4.5.11 grep (GNU grep) 2.20 Let's say I have a directory that contains a bunch of files. I want to find the files named jtobdops02.key and ...
0
votes
1answer
35 views

Using xargs to construct a find command that excludes a list of directories from an environment variable

I know how to exclude certain directories from find: find <path> ! -path <path to exclude>. But this can be too tedious to type out when I need to exclude a lot of directories or simply ...
0
votes
1answer
81 views

Cron to find exec cp and redirect output with time / date per line?

I try to setup a cron task to run a set of basic shell commands. I need to look to any files created on the last day, then copy to another folder and generate a log stating, line by line, the date ...
0
votes
1answer
147 views

c shell script: find the directory and rename it

i am still new in this shell script. I have a task that given to me which i have difficulty to execute it. The task is i have a lot of directory which is based on ddmmyy. 03Mar2014 08Aug2013 ...
0
votes
1answer
2k views

find: cannot fork: Cannot allocate memory

I want to delete 1 file at a time from my directory which contains so many files,So i want to remove 1 file at a time. Just to avoid too many reads and failed at too many arguments. find ...
0
votes
1answer
226 views

Find command to check only for the last 10 minutes and not the whole folder

I have an nvr system that recording video surveillance into a file server (Debian). I made a Nagios plugin to check if the NVR system is recording correctly and send me a notification when it stops ...
0
votes
1answer
46 views

Folder research task

I have a folder with 3 subfolders containing 6 files each.There are 2 files in each subfolders with :NOPM in their file names. I need to create a shell script that checks all the folders and their ...
0
votes
1answer
98 views

How to pull one day old data from remote server to local server?

From what I have searched till now I only found command to PUSH one day old data from local server to remoteServer but what I want is to PULL one day old data from remoteServer to localServer. I ...
0
votes
1answer
111 views

Find part of String and replace entire string in a file

I have a file named A.xml which contains a strings such as "Ticket_Release1" and "Ticket_V2". I want to find and replace all the strings in the file starting with Ticket_ with something called ...
0
votes
1answer
65 views

“find” function still prints files I've already removed

I've removed some directories and files inside them using sudo rm and sudo rmdir, but when I execute sudo find /*/*/ng* the files I've previously deleted are still showing up. Does anybody know why ...
0
votes
1answer
152 views

Search a file for a string in multiple directories

Can someone please help me with a command to search a file for a string in multiple directories? I am searching for the VIP in httpd.conf in multiple httpd instances. I am using: find ./ -name ...
0
votes
1answer
144 views

bash: What is the difference between these two script variants?

(Note: Both of these examples may require GNU or BSD find and may not work as-is with the POSIX "edition" of find). Both of the scriptlets below must be understood as excerpts from way more complex ...
0
votes
1answer
132 views

Delete subfolder and keeping up parent folder

I need to delete folderx which are not accessed for seven days, easily I can do it with next: find /path/folder -type d -mtime +7 |xargs rm -rf The probelm is when I have subfolder marked for ...
-1
votes
1answer
39 views

Searching for most recent file (Display Unique)

If i have a Folder structure with 10 Sub dirs Each sub folder has the possibility to hold a version of a file (Older or newer) "Poor folder structure." I was looking to use Find to locate all files ...
-3
votes
1answer
31 views

List the names of file with a certain permission only in the sub directories

So basically, I want to know how to list only the name of the sub directory that has a certain permission. The command I got so far is this: find */* -maxdepth 2 -perm 770 but this just gives me ...
3
votes
0answers
98 views

find printf switch POSIX alternative

I'd like to rewrite these 2 command so they will use only POSIX-complaint switches: find "$TARGET_DIR" -maxdepth 1 -type d -printf '(DIR) %f\n' find "$TARGET_DIR" -maxdepth 1 -type f -printf '%s %f ...
3
votes
0answers
202 views

What types of regex DO support (e.g.) negative lookbehind?

Bash on GNU: I am using a collection of find commands, most of which employ -regex to do their matching. Each time I try a different feature in my regex I have to cycle through the values for ...
3
votes
0answers
2k views

diff -r only for certain file types

Is there a way I can perform a recursive diff of two directories but only compare (in their respective places) files that match a specific filename or filetype predicate? E.g. I would like to do ...
2
votes
0answers
66 views

use find command in bash file

I am using this script in my Linux machine to find all files that were modified yesterday: #!/bin/bash find /home/*/domains/*/public_html/ -name "*.php" -mtime -1 | while read line; do echo "$line" ...
2
votes
0answers
94 views

Backup using find and ssh to off-site server

I'm sure this has been been answered in bits and pieces on many sites, but somehow I can't seem to get this (as a whole) to work reliably. Scenario: I have a server that I would like to do ...
1
vote
0answers
17 views

Find and redirect to capture pattern filename

I'm looking a way to do something like: find /path -name "201[2-6]*" | awk -F"/" '{print $5"/"$6"/"$7"/"$8",0,0,0"}' > archives_201\1.csv where archives_201\1.csv could be archives_201[2-6].csv ...
1
vote
0answers
37 views

Copy file into all subdirectories that contains a file with certain name

I am trying to copy a features[30,55].R script from my desktop into all the subdirectories that contain a file whose name is DONE. I tried the following command: find . -name "DONE" -exec sh 'cp ...
1
vote
0answers
189 views

rsync only files newer than given date, with --delete

I'm trying to use rsync to backup only the files that have been created or changed after a certain date. The reason is that on that date, the whole system has been backed up. However, those global ...
1
vote
0answers
39 views

What are the major differences between the Darwin/BSD and GNU versions of Findutils?

OS X comes with its own versions of find, locate, and xargs. GNU versions of these utilities are also available as part of GNU Findutils. What are the major differences between the two versions? Is ...
1
vote
0answers
60 views

What is SELinux's regex type?

I'm trying to locate all files on my system matching an SELinux file context (fcontext). These contexts are specified using some regex, and I'd like to use find -regex ... to the same effect. However, ...
1
vote
0answers
233 views

Using Rsync to SSH and Find files

Hello I am trying to use Rsync to SSH into a remote server and pull a certain type of file that has been modified within the last 24 hours. Here is what I am trying: rsync -avx --timeout=480 ...
1
vote
0answers
128 views

trash and restore script - issue restoring

#!/bin/bash echo "Are you sure you want to move this file to the Recycle Bin?" "(Yes/No)" read ans case "$ans" in Yes) echo "$(readlink -f $1)" >> "$HOME/TrashLog" && mv "$1" ...
1
vote
0answers
177 views

Find command incorrect results with days filter

I am trying to find all files modified before march 6 in a directory with thousands of files. I executed the following commands in the PWD where I want to find files. find -mtime +47 > ...
1
vote
0answers
66 views

GUI for find which can show video thumbnails

Is there a GUI for find (or just a graphical search tool which supports regex searches on filenames starting from a specific directory) which is able to show thumbnails found video and image files? I ...
0
votes
0answers
39 views

How to create a symbolic link of all files in a directory using a shortened name obtained with using a piped cut on the filename

I have a directory full of libraries (*.so.0.*), and I want to use find to create a symbolic link to each file, named *.so.0. Here is a (non working) try: find $HOME/.local/lib64/ -name ...
0
votes
0answers
35 views

find awk log print error

I'm trying to find one year old directories named in yyyymmdd format and print it in the log file placed at different location. find ${LOG} -maxdepth 1 -type d -mtime +${DAY} -name ...
0
votes
0answers
29 views

Fixing Signal 13 Error on find

I have a situation where I'm trying to install softwares into my system. I'm using a fakeroot approach to install them in a separate directory where I'm listing all the files, directories and links ...
0
votes
0answers
27 views

find and copy files change the modified date to 1980-1-1

I use command to find and copy files in cygwin in windows . My command is find -name '*.docx' -exec cp -p -t /word {} + however , when the files is copied to destination folder, I can see the ...
0
votes
0answers
124 views

rsync, find, and other useful commands for synchronizing a large quantity of data

Here is the structure of the folders I would like to consider: /mnt/network/ is my network drive and /local/ is my local folder. What I want is to synchronize the content of these two folders ...
0
votes
0answers
76 views

Directory research example

I have a folder with three sub-folders containing six files each. There are two files in each sub-folder with :nopm in their file names. I need to create a shell script that checks all the folders ...
0
votes
0answers
92 views

Help with find function in Linux

I searched around and couldn't find this—so sorry if it's another duplicate. Using Kali Linux I am to find a file who is owned by user bandit7, owned by group bandit6 and is 33 bytes in size. ...
0
votes
0answers
51 views

Is there a `find` command that uses a database, like `locate`?

locate is simple yet quick because it's database based. find offers much more options but it's slower because it actually browses the filesystem each time it's invoked. So.. find using a database ...
0
votes
0answers
136 views

Storage Formats for Flat File DB

Currently I use a flat file database with find -type f -ls to store information for about 400GB of files. I'd like to store also the md5sum/sha[1|256]sum of the files. Because the files are often ...
0
votes
0answers
585 views

Find if the file is compressed or not

I need to find whether the file is compressed or not in script.If it is compressed I need to uncompress and send as attachement. My find command results in two files sum12.pdf.Z and sum23.pdf.Z My ...
0
votes
0answers
189 views

Where is the libstdc++ test suite?

I have GCC/g++ 4.7 and it works fine. But I need to run the libstdc++ testsuite but I don't find where the testsuite is on the system and how to run it. How can I do that?