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

0
votes
2answers
401 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
79 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
318 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
310 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
6k 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
702 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
156 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
1k 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
43 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 ...
3
votes
2answers
2k 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 ...
1
vote
1answer
865 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
636 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
156 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
101 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 ...
4
votes
3answers
9k 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
97 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
17 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
2k 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
260 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
76 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 ...
3
votes
1answer
4k 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
35 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 ...
0
votes
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
71 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
33 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
370 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 ...
0
votes
1answer
93 views

Single “find” command with multiple arguments?

I need to devise a single find command that searches for: All C# or Java programs Located in the home directory of the current user Have at least one hard link Readable for everybody Have at least ...
0
votes
1answer
40 views

how to find files with cygwin

We like to search many directories in a Windows environment with cygwin. We tried find . -name *.txt -print but it complains the -print predicate. What is the correct command then ? We only want ...
1
vote
2answers
84 views

Finding folders only

My harddrive is in a mess, so I decided to do a cleanup. As a part of this, I want to merge all folders containing music into one. What I want to do is, look for any *.mp3's and *.aac's on my drive ...
0
votes
2answers
82 views

Do I need to use -r with the command cp when using the find command in Linux?

I have documents spread between multiple directories in a given path e.g. /media/devicename/name_of_directories. I used the find command to help locate certain files e.g. .doc, docx, etc find . -type ...
4
votes
1answer
263 views

How to find all jpeg images of the same camera model

Recently during a installation messup , I lost all my files from my windows NTFS drives. I installed on testdata on Ubuntu 12.10 Desktop edition and with the help of photorec could recover a lot of ...
1
vote
0answers
167 views

Search From a List of Multiple Entries using CTRL+F

I have many documents that I am viewing using Google Chrome and I am searching the PDF document for a word1. If word1 doesn't show up, I search for word2. If word2 doesn't show up, I search for word3. ...
1
vote
3answers
61 views

find exactly one file in directory

I have very big collection of files. When I use command find I'm sure there is only one file in this collection. To make all my find commands faster I would like to run find command just until it had ...
2
votes
1answer
278 views

Removing a directory containing a file using find

I'm searching a list of directories for certain files and I want to delete the directory that the file is in. This is what I'm trying: find /converter/storage/unmatched/ -size -4b -name '*.mp3' ...
1
vote
2answers
3k views

How list file by range of date?

I would like to list files with 3 days years old. I found this one at stackoverflow: find . -type f -printf "%-.22T+ %M %n %-8u %-8g %8s %Tx %.8TX %p\n" | sort | cut -f 2- -d ' ' | grep 2012 But I ...
5
votes
1answer
466 views

Convert symlinks to hard links

I'd like to recursively convert soft links to hard links in a directory. I've tried something like this: for f in *; do (mv $f{,~} && ln $(readlink $f~) && rm $f~) done …but it ...
0
votes
2answers
40 views

How to move old file with previous command

this command finds me files which I want to move to old folder find /home/ -maxdepth 1 -type f -mtime +1 now how I cann result of this command to move command mv (previous files) /old
2
votes
2answers
2k views

Renaming multiple files which match UNIX find keyword

I have the following output from find command for finding files containing yyy in name: ./plonetheme/xxx/yyy-logo.png ./plonetheme/xxx/profiles/default/plonetheme.yyy_various.txt ...
0
votes
1answer
548 views

Copying all files inside subdirectories and renaming instead of overwriting

I have a number of images inside subdirectories of another directory which I'd like to copy to one single directory so all the images are in one place. After a bit of searching, I found and then ...
-1
votes
2answers
53 views

How to search a tree folder

How can I do a search of all directories calles i18n under trees like src/main/resources using find or any other unix command. Everything I'm trying doesn't work I'm looking for something like: ...
0
votes
2answers
297 views

Linux - Find recently accessed files on webserver by web visitors

Is it possible to find files which were recently accessed by web server? Using the Unix "FIND" command? I am getting a lot of SPAM emails because someone's accessing a PHP script in one of my ...
3
votes
1answer
801 views

How to get rid of errors when running find command in Linux?

I am using following command to list out 20 large files in a directory. But along with the file listing, it also shows error messages, such as permission denied. I tried adding 2> /dev/null but it ...
-3
votes
3answers
222 views

How to comble find and file command? [closed]

My teacher gave me a homework on combining find and file Use find and file to display all files in the /home subdirectory tree, as well as a guess at what sort of a file they are. I tried ...
2
votes
3answers
260 views

Using find, xargs, etc. to output similarly named files

I have a folder full of HTML files: 001.htm 002.htm 003.htm … I want to run Pandoc on them to convert them to similarly named Markdown files: 001.md 002.md 003.md This command works on one of ...
0
votes
2answers
71 views

How to send files from Find to another program?

If this is the wrong stack* site, I apologize, but I'm trying how to send the results from find to another app? what I'm trying to do is find all *.plist files and send them to plutil to convert them ...
1
vote
1answer
473 views

batch script help, find, replace registry keys

I'm trying to figure out why my reg import command is not working in the script below. When I run the reg import fileName.reg from the DOS it works fine but when included in the script below it does ...
6
votes
2answers
542 views

Why is the grep/-r/--include combination slower than the find/-exec/grep combination?

From my understanding, the two following commands roughly accomplish the same thing: Command 1: find -name "filename.xml" -exec grep someString {} \; Command 2: grep -r --include=filename.xml ...
3
votes
2answers
290 views

find any script which is running for more than say 30 minutes in Linux System

Please share command to find any script which is running for more than say 30 minutes. in Linux System