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
3answers
29 views

How to list file names on Windows as the Unix find command?

I'm looking for an equivalent command line on Windows to the following Unix command: find test -name '*.txt' -print This command lists every filename which is in the 'test' folder and subfolders, ...
30
votes
4answers
26k views

How can I recursively copy files by file extension, preserving directory structure?

At the Linux command line, I'd like to copy a (very large) set of .txt files from one directory (and its subdirectories) to another. I need the directory structure to stay intact, and I need to ...
1
vote
1answer
20 views

Is it possible to move last modified files using ls, tail and mv?

I want to move the last 3 modified files from a directory using bash commands. However, I noticed that I can use find in the following way: find . -type f -mtime -0.5 -print -exec mv {} ...
4
votes
2answers
2k views

How to physically reorder files `03.mp3 01.mp3 02.mp3` (`ls -f`) in a directory?

The physical order of the files matters when I copy them onto my USB stick and listen in car mp3 player. Most of my music album folders are unsorted, e.g. ls -f may produce: 03.song3.mp3 01.song1.mp3 ...
0
votes
1answer
12 views

How to delete broken symbolic links

I have a case where a lot of symbolic links remain after the original file was deleted. It was the result after leaving a Jenkins installation saving all build logs until the number of available ...
-2
votes
0answers
12 views

How to remove all text in string with find and replace

I have a large spreadsheet with characters, letters and numbers. I want to use "find and replace" to remove all text and characters and only keep the numbers. Is there a way to use a wildcard or any ...
2
votes
1answer
80 views

bash script to compare dates within a diven dir (incl. subdirs)

I would like to write a bash script (or just use a command in the CLI) to find all the instances within a given directory and its subdirectories for a given time period copy those files into a ...
0
votes
2answers
12 views

Passing multiple files with whitespace to python script

I have to convert a lot of .ai files to .svg, and I've found ai2svg tool. I've tried for i in `find ./ -type f -name \*.ai`; do python ai2svg.py "$i"; done But I get errors like IOError: [Errno ...
3
votes
4answers
2k views

Finding subdirectories inside all directories with the same name

I want to run a command to: Find all directories named "inc" under a folder "X". List all the subdirectories under each "X/.../inc/". Redirect the output to a file named "list" I tried various ...
1
vote
1answer
38 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
2answers
26 views

linux: how to show permission of files (like ls -l) does on files returned by the find command

I am doing a find command to show me the files of a specific extension, like: find $directory -type f -name "*.vm" however I would like to be able to see the file permissions as well (like ls -l ...
0
votes
1answer
257 views

Exclude all hidden directories in UNIX find

I'm doing a word search using the following command: find . -exec grep -q [some_word] '{}' \; -print -o -name .svn -prune -o -name .ssh -prune -o -name .boneyard -o -name log -prune -prune -o -name ...
1
vote
1answer
214 views

how do I write find expression (atime = ctime) (access time = change time)

I want to find a set of files to remove that have not been access since their last inode change. Files in which the last activity happened when they were moved into the directory they are currently ...
1
vote
3answers
92 views

Checking how many files there are of a certain type in a directory and all sub-directories

I want to find how many .py files I have in my GarlicSim directory and all its sub-directories. How do I do that? Either Windows or Linux is fine.
41
votes
12answers
49k views

Unix/Linux find and sort by date modified

How can I do a simple find which would order the results by most recently modified? Here is the current find I am using (I am doing a shell escape in PHP, so that is the reasoning for the variables): ...
-1
votes
2answers
56 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: ...
2
votes
1answer
2k views

How to find hyperlinks in Excel 2010 and de-activate them?

When opening my Excel sheet using Excel 2010, I get a yellow bar at the top from Excel informing me that it has de-activated the automatic update of hyperlinks. To my best knowledge, I do not know ...
0
votes
1answer
30 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 ...
1
vote
1answer
35 views

Why the blackslash dot (\.) in the prefix of the path?

I was running the find command looking for some config files and this is exactly what it outputted: ./log4j.xml ./log4j2-test.xml ./proxyserver/src/main/resources/log4j.xml ...
4
votes
3answers
10k 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?
10
votes
3answers
3k views

Is there any way of making Ctrl+f in Chrome use the selected text, as per Firefox?

One thing that's really bugged me since switching to Chrome is that Ctrl + F behaves slightly differently from Firefox. In Firefox, if you have text highlighted and hit Ctrl + F, it'll start finding ...
0
votes
1answer
56 views

searching large number of possible file names in large directory tree

I need to search a large directory tree for a large number of possible file names, i.e. I have an input file with a long list of strings that I need to find in the tree (or as below: print all those ...
1
vote
4answers
12k views

Find all files older than one minute

How can I use find to select files that have been written and not modified in the last minute? I know I can do it the other way around, find files modified in the last 60 seconds with -mtime -60s, ...
0
votes
0answers
22 views

Finding all files modified more than 60 minutes ago [duplicate]

I am struggling a little with find . I need all the files that where modified more than 60 minutes ago. As far is understood from all the sources find . -mmin +60 should give me the desired result. ...
1
vote
4answers
67 views

How to get first line of output from command line?

I'm running a find command that's returning multiple results, but I only need the first result. A bit of googling led me to the "read" command, but I couldn't figure it out, and the man page didn't ...
0
votes
4answers
5k views

Find file matching extension, then count files in the found directory

I am trying to search the filesystem for all files matching an extention (*.what), then count all files in the directory where it found the *.what files. The output should contain the directory name ...
1
vote
2answers
75 views

What does \; mean in a script?

What does \; mean in the following command? I’m also not sure what {} means. Is \; really necessary? find ./ -name file_1 -exec cp {} ./ \;
4
votes
3answers
1k views

how to limit find command's output used with option -print0

I'd like to limit output of find command. In the past I used to use for this ls command, e.g: ls *tgz|head -100|xargs -i mv "{}" ../ but I got to know that the result may be unpredictable if name ...
2
votes
1answer
36 views

find using regexp and echo matches

I have about 50 users in /home/ directory and I have cloned a git repository to everyone: Executed at /home/ as root user: find . -maxdepth 1 -type d ! -name . -prune -exec git clone ...
2
votes
2answers
1k views

find -printf on Mac (-printf unknown option)

I have a little bit of code that I use to get an MD5 sum of the most recently modified file time find ./media -type f -printf "%TY-%Tm-%Td %TT %p \n" | sort | more | tail -1 | md5 -r | awk '{print ...
0
votes
1answer
41 views

how to find all files under directory different directories

How can you find files name 'xyz' under directories name 'abc'? something like this....but its not working. find . -type d -name 'abc' -exec find {} -type f -name 'xyz' \; find . -not -path 'abc' ...
2
votes
1answer
25 views

Find not expanding variable

I tried the following and it didn't work one bit. image=.jpg,.png,.gif find . -type f -iname "*$image" Why? Does find not expand variables?
4
votes
4answers
341 views

Windows XP: How to find the files with 2 characters only?

recently I found back door on my laptop. I t was generating many files with random names only 2-3 characters only. The most of them is empty. How can I find files only with 1 to 3 characters generated ...
0
votes
3answers
480 views

How to separately count number of files, directories, symbolic links and hard links within a single find run?

To check a successfull migration I'm using find to count the number of files, directories, symbolic links and files with more than one hard link. As the directories to check contain a huge number of ...
0
votes
1answer
23 views

OS X: Copying only files without a special string in filename

I have to copy only files from a folder that don't have following string in its filename: NNNNxNNNN (a 3 or 4 digit number followed by the character x followed by a 3 or 4 digit number again -> it's ...
2
votes
3answers
243 views

How can I find all files on a folder tree that have a none alpha numeric characters in it

I have taken over from someone else a lot of historic data. However the file names are totaly random and badly formatted IMHO. To start with I want to get a list of all files that contain spaces, or ...
0
votes
1answer
29 views

How to get the time information of the files after find | grep keyword command?

Now I know how to use find | grep keyword to get the file I want. But after that, how should I know the size, create_time info of each file I found? For example, after find | grep tutorial, I got ...
1
vote
4answers
64 views

Linux remove files without giving error

I have this running as cron job /usr/bin/find /backups/* -mtime +5 -exec rm -rf {} \; But it gives me this error on email /usr/bin/find: `/backups/Jun-20-2014': No such file or directory Is ...
3
votes
1answer
420 views

How to find a file whose size is less than 10 MB?

I need to find a file in my current directory whose size should be less than or equal to 10 MB. ls -lh gives me the file size of each file but not sure how to find the files whose size are less than ...
26
votes
2answers
4k views

Why is it so hard to find a file in Ubuntu?

It's very hard to find files in Ubuntu. In Windows, you could just go to C:\Program Files and you would find what you need. In Ubuntu, you must use search to find something you need. Maybe I am ...
30
votes
5answers
45k views

Bash script to delete files older than x days with subdirectories

I'm trying to delete a ton of files older than x days. Now I have a script to do that find /path/to/files* -mtime +10 -exec rm {} \; But this will also delete the subdirectories. There are a ton ...
40
votes
4answers
42k views

How can I find files that are bigger/smaller than x bytes?

In a terminal, how can I find files that are bigger or smaller than x bytes? I suppose I can do something like find . -exec ls -l {} \; and then pipe the result to awk to filter by file size. But ...
0
votes
2answers
20 views

How to execute files which are found by find

I have some executable files under a directory tree. I want to find them and execute them the most simple way. I've tried this so far: find . -perm 0775 -type f | xargs exec But exec is not an ...
0
votes
2answers
48 views

Windows DOS Command for Finding folder name with specific characters & select it

Trying to write batch file code for copying contents of a folder with path "C:\ABC" to another folder whose exact name is unknown ( its a Profile data folder of firefox) Profiles of Firefox are ...
2
votes
4answers
51 views

Is there a way to use > operator in find -exec

I'm trying to empty lots of files under a certain folder. >file or cat /dev/null > file or echo "" > file can empty file. find . -type f -exec blahblah {} \; can find files and do something ...
1
vote
2answers
112 views

Permission denied when attempting to mv (sudo su userName)

I am currently working on a backup script to log into my production server and pull the latest SQL dumps to my staging server. I have no issue pulling the SQL dumps but I do have an issue with moving ...
0
votes
2answers
55 views

Why doesn't xargs on find work with a series of commands using pushd and popd to walk a directory subtree?

On a Linux Centos 4 machine, I am trying to create a simple bash command line to walk a directory structure below an arbitrary current directory and in each subdirectory touch a file, list the ...
2
votes
3answers
76 views

In windows, is there a way to count the amount of times a string appears in a file

I am currently trying to write a batch script and at this point, I need to find a string, "null", and determine how many times it is shown in the file. I'm downloading an API from a website ...
0
votes
1answer
41 views

How to capture diff output from find command exec?

I am using Ubuntu (Precise 12.04) I am trying to write some bash script to see if file is changed via awk replace by using diff command. I did a test with the following: #! /bin/bash diff fileA.htm ...
1
vote
1answer
80 views

Use 'find' command to search for PNG files, pipe output to imagemagick for batch conversion

I've got a directory with thousands of image files, mostly JPG but some PNG. The files have no extension, they're just numbered. I need to convert all of them to JPG. Using find I can get a list of ...