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.

learn more… | top users | synonyms

4
votes
2answers
248 views

Running find and xargs in background

I want to run this command in background because the process could take a long time. How can I send it to a background process? find /tmp/ -type f -mtime +3 | xargs rm -Rf This does not work: find ...
0
votes
3answers
123 views

Listing files, including archive contents

Is there some method to find, from the shell, all files matching a file pattern including those inside archives (specifically: zip archives)? The simulation package "VASP" produces files called ...
5
votes
7answers
2k views

How do I return only file names from the find command?

I'm looking to get a list of just file names (without the rest of the path) when executing the find command from a terminal. How do I accomplish this on the mac?
1
vote
1answer
1k views

Removing files older then 1 month, but leave one file per month

I try to script something similar to Removing files older then 1 month, but leave files created at the 1st day of the month. The difference is that I need one file per month. I am using the script ...
1
vote
3answers
3k views

Argument list too long for xargs/exec

I'm working on a CentOS server and I have to move around and cat together millions of files. I've tried many incarnations of something like the below, but all of them fail with an argument list too ...
0
votes
0answers
72 views

Find match in Excel 2010 from 2 sheets & copy corresponding contents from sheet 2 to sheet 1

I have 2 worksheets: Worksheet 1 with Column H need to find a match on Worksheet 2 with Column F If a match is found, I need to copy the contents of worksheet 2 column g to worksheet 1 column E. ...
0
votes
2answers
553 views

Find directories containing a certain number of files

Was hoping I would be able to do this with the find command but I can see no test in the manual for doing what I want. I would like to be able to find any directories in the working directory that ...
7
votes
3answers
10k views

Finding files which contain a certain string using find (1) and grep (1)

find . -type f -print -exec cat {} \; | grep some string Command above doesn't print the file path. I'm using: Ubuntu, bash 4.
1
vote
2answers
80 views

Checking version of Applications installed in ~/Applications with unknown username

I'd like to check the version of Firefox through Apple Remote Desktop of all managed computers. I have written this, but it only checks for Firefox in /Applications /bin/cat ...
3
votes
2answers
77 views

How to exclude files using find

Unlike the --exclude parameter for rsync that can excludes both files and directories, the *nix find command's -prune parameter can only exclude directories. So how can I exclude a certain type of ...
1
vote
1answer
142 views

Linux command find -print. When to I need this option?

What is the difference between: find . -name "*.txt" and find . -name "*.txt" -print ? I mean what is the use of print in find. I see that it prints the results anyway so why is this option ...
1
vote
1answer
309 views

Find command doesn't work for certain subdirectories

I just downloaded some source code from a repository and I'm trying to locate a specific file in it. For simplicity, assume that the entire project has the following directory hierarchy ...
2
votes
2answers
2k views

Print full path of files and sizes with find in Linux

Here are the specs: Find all files in / modified after the modification time of /tmp/test, exclude /proc and /sys from the search, and print the full path of the file along with human readable size. ...
0
votes
1answer
740 views

excel 2010 how to identify if a word is present in a group of cells or a row [duplicate]

I would like to use a formula to identify if a cell in a group of cell contains a specific word. Example, I'd like to search if a cell has the content X The formula's response could be 1 if found, 0 ...
-1
votes
2answers
53 views

Unix - Searching for every file with a certain string in it

I am searching for every file within a root directory and want to search every subdirectory as well. I have tried grep -r "message" * but I am not sure that this searches every subdirectory, any ...
3
votes
2answers
2k views

Efficient way to search string within file find and grep

I am searching all files containing a specific string on a filer (on an old HP-UX workstation). I do not know where the files are located in the file system (there are many directories, with hudge ...
0
votes
1answer
31 views

Find a directory only contained within a certain folder

I have a directory structure like: foo |__bar |__bin | |__tmp | |__bez |__tmp I need to find the tmp directory in bin/tmp, but not the one in bez/tmp. It seems to me ...
0
votes
2answers
264 views

Linux command to find all instances of a file pattern?

I'm looking for a way to scan a directory recursively and print out all instances of any file that ends ".qfx". Thus, for a given directory: somedir/ fizz.qfx buzz.qfx blah/ ...
2
votes
3answers
766 views

In the Mac terminal, how do I “find” a file and then quickly cd to the parent directory?

I want to open terminal, find a file or folder, and quickly navigate to that folder or the parent directory of the file. I can quickly get the path using find ~ -name 'filename.txt' but I can't ...
2
votes
2answers
2k views

How can I make `find` find files in reverse chronological order?

I want to find files in subdirectories sorted by timestamp (of creation), with most recent first. I have looked at the man page but it seems to only seems to let you filter by timestamp rather than ...
4
votes
4answers
192 views

How can I find a path by providing only part of the path?

Let's say I need to find this path /<some_where_in_root>/find/this/path and the only information I have is /find/this/path. What would be the best means of locating the full directory? I ...
0
votes
1answer
100 views

How to collect all media file in a mac directory structure?

I'm trying to copy all media files (Mac file type of Image or Movie) to the same directory structure, only taking media files. Is there a more efficient way than what I've got below? Is there a ...
0
votes
2answers
509 views

Trying to find any home directory that is writable by anyone

I am trying to locate any user home directories and their files that are writable by anyone. I wrote this: find /home -type d -perm -200 | grep . || echo no world-writable directories here ...
0
votes
1answer
84 views

How to use arguments with 'find -exec'?

I'm trying to generate static html files for all php scripts inside dir: find . -name "*.php" -exec php {} > {}.html \; But it just dumps all results to {}.html. How to do it properly? And how ...
3
votes
1answer
425 views

Delete old log files in AIX

I am trying write a script to delete old log files in \var\log\applog\nmon on my AIX system. We usually get alerts that the file system is almost full and at the moment delete old files by hand. So ...
0
votes
3answers
402 views

How to print out all non-hidden files recursively in a dir using lpr

find . -type f | grep -v '/\.' lists out all non-hidden files in the current dir recursively. Example of this command given the following file tree . ├── css │   ├── base.css │   └── main.css ├── ...
2
votes
3answers
9k views

How to display file details (size, date, etc.) from Linux “locate” command?

The (slow) Linux “find” command has an option, “-ls”, to display size, date, etc. like the “ls -l” command. But the “locate” command doesn’t seem to have that. So how can I get the equivalent ...
0
votes
1answer
1k views

How can I use lookahead and lookbehind regular expressions on Linux using find?

I generally use the following command to match patterns find . -maxdepth 1 -regextype posix-egrep -regex '.*/{pattern}' However when I attempt to use a lookahead for example, no results are ...
0
votes
1answer
198 views

Cygwin: `find / -name libstdc++-6.dll` shows no results

In Windows Explorer, when I search for libstdc++-6.dll, it returns half a dozen results. I'm trying to do a similar filename search in Cygwin with find, but that shows no results. find / -name ...
0
votes
1answer
2k views

find command is giving error on Mountain Lion

I'm trying use the following command on Mac OSX Mountain Lion to get a list of my mail folders as part of my .muttrc file: `echo -n "+ "; find ~/.mail/fastmail -maxdepth 1 -type d -name ".*" -printf ...
0
votes
1answer
45 views

find expression not working

I would like to convert all powerpoint type files to pdf using the find -exec and unoconv command. find . -name '*.@(ppt|PPT|pptx|PPTX|pps|PPS|ppsm|PPSM|ppsx|PPSX|pptm|PPTM)' -exec unoconv -v -f pdf ...
4
votes
2answers
3k views

How do I make “find” exclude the folder it searches in?

I'm running the following command: find /var/www/html/content/processing -type d -mtime +1 -exec rm -rf {} \; I would like to delete all the folders under the processing folder (the processing ...
2
votes
1answer
1k views

how to delete a file matching a pattern in linux

How do I find a file matching a pattern and then delete all of it? Something like find -name 'pattern%' Then how to delete all of found entries?
3
votes
1answer
983 views

How do I find all files that are *not* group writeable?

I see the following question describing how to find group writeable files: How can I find all PHP files with group write permissions? But I want files that are not group writable! (Also, I couldn't ...
0
votes
1answer
197 views

Does the order of how a find command in Linux is negated matter?

I am attempting to negate a find command so that I get every other file except for the file or files in the command. find . -maxdepth 1 -regextype posix-egrep -regex '.*/.*\.svg' -exec echo {} \; ...
0
votes
2answers
138 views

Find a file matching a pattern, but not in directory matching another pattern

I have a source tree having some directories with names ending with -old, which are kept as a reference when rewriting components that are in them. There's also a Makefile that just finds all *.cpp ...
6
votes
3answers
13k views

On Linux, how can I find all files that contain a string and delete them?

I want to delete all files that contain the string foo. How can I do this using bash in Linux?
0
votes
1answer
139 views

Listing unreadable group files in Unix

Is there a way I can list ordinary files that are unreadable by a group in Unix? What would be the necessary code for that? And can I do it without using the find command?
0
votes
1answer
18 views

Extracting output only from the current directory

How can I extract from the output of find . -name "*.c" -print only filenames in the current directory? Why does it always include the subdirectories? Need help with getting aorund that.
1
vote
2answers
3k views

Match regex pattern only in filename.extension

I need to use find to locate a file matching a regex pattern in filename.extension instead of the default, which matches /path/to/filename.extension. For instance: /folder |--a-love-song.ogg ...
3
votes
2answers
296 views

linux: is tree -i -f -L $depth supposed to be faster than find -maxdepth $depth?

I am querying specific directories to see if I find files with a specific pattern in them and I have been trying it with two different commands: Standard find command: find -L $unix_dir\*/ -maxdepth ...
0
votes
1answer
83 views

Linux find always returns 1 record

Why command find -cmin +20 in Linux CentOS always returns 1 record which is .? How can I work around this?
2
votes
1answer
34 views

Native solution to use find from vim

I'm on a server, editing some files, and I'm using an account shared with others. I'd like to know if there's a way to use find to get a list of files to edit, just like :grep does, but for files. I ...
4
votes
1answer
7k views

Ubuntu Linux: find files between specific times?

I found an SO called using Find/Grep to search files between specific time of day Based on that and a Unix SE called Grep command to find files containing text string and move them I ended up with: ...
0
votes
1answer
1k views

Using find with -exec gzip and grep

I have a bunch of zipped up log files and I want to search them all for a string. I tried this but it's not working: find ./ -name "*.log.zip" -exec gzip -dc {} | grep ERROR \; It's giving me: ...
1
vote
1answer
40 views

Windows 8: identify and consolidate files

Windows 8: How can I output a list by folder of all my MP3 music files which I can import into Excel so I can then select and consolidate in one folder? I have seen some code which would appear to do ...
1
vote
4answers
2k views

How to combine find and grep to recursively search for str or str2 in *.html and *.php files from /home/smith/sourcecode?

How can i combine find and grep to search for str1 or str2, recursively, in all *.html and *.php files starting from a directory named /home/smith/source? The output only needs to list files (with ...
2
votes
1answer
79 views

Using inode number to locate hardlinks

How can I use the inode number to locate all hardlinks to the file "file.txt" in my home directory?
2
votes
1answer
36 views

List directories without erroring if none exist

I have a rather strict set of specs for a directory listing that I need: It must list the directories in the current directory It must list purely the basename (no "./", no trailing slash) It ...
1
vote
2answers
517 views

Finding not empty directories without subdirectories and specific sorting

I have a problem with my "homework" on studies. I have to list all not empty directories from /var and /usr, which do not have subdirectories and their owner is not root user. Also, for each ...