0
votes
1answer
41 views

Direct errors in find to /dev/null by default

On my OSX command line, find directs errors to STDOUT. I find this very inconvenient, and I also find it annoying to add 2>/dev/null to the end of the command every time. This brings up several ...
1
vote
1answer
22 views

How can I restrict a bash find to only specific sub-sub-directories

I'm trying to list all the files in a specific sub-directory but different directories which are themselves on a different volume. The following works, but only on a fully specific sub-directory (and ...
0
votes
2answers
18 views

Adding logic to 'find' directories containing either [criteria A] or [criteria B]

I have inherited a vast media archive without a unifying organizational scheme. Its contents date back at least 10 years. I have been asked to find a needle in this hay stack, and I have some guesses ...
0
votes
1answer
32 views

mdfind -onlyin not working in hidden directories recursvily? How to use it properly?

I am trying to find all files named doc.py in one of my virtualevns (called data_science), which are all in hidden directory .virtualenvs under /Users/adni and so I go: mdfind -onlyin data_science ...
1
vote
2answers
97 views

Trying to find folders that only contain one file

I would like a find command (or similar) that when pointed at a folder, it would list all the files that live inside that folder or any of its subfolders, but only if the folder contains a single ...
1
vote
2answers
66 views

How do I search for a string in a group of files when some of those files contain spaces?

I'm running Mac 10.7.5. In a terminal, I'll use this command for finding files with strings find src/main -name "*" | xargs grep -i 'mystring' However when the files contain spaces, I'll get ...
1
vote
1answer
45 views

Unhide all .htaccess files on mac

I am trying to unhide all the .htaccess files in my home folder. Below I've pasted what I'm using now, but it isn't working. find ~/ -iname ".htaccess" | xargs chflags nohidden "{}" Anyone knows ...
1
vote
2answers
70 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 ...
2
votes
3answers
417 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 ...
0
votes
1answer
88 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
70 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 ...
0
votes
1answer
65 views

List of directory names without the path?

I'm looking to get the name of a bunch a directories at a specified level. This is what I've got so far: find . -type d -depth 2 -print But this also prints the relative path of these ...
1
vote
1answer
47 views

How can I select files which meet a condition in a directory structure

In have a big directory tree in OSX (Mountain Lion), and I need to delete all the files below a certain threshold filesize. I could create a duplicate of the directory excluding the small files, or ...
1
vote
3answers
403 views

Difference between xargs /bin/ls and exec ls?

Hi this may be a very newbie question, but why doesnt the xargs /bin/ls work in this case? I thought it was supposed to be faster? Also what are those /fd/3 directories? sh-3.2# find / -name 'GOALS*' ...
2
votes
2answers
175 views

Using “find” on mac doesn't locate .so files

For some reason "find" doesn't locate .so files unless they're in the same directory I'm in. For example: r-mbp:~ todd.r$ cd /usr/local/apache/modules/ r-mbp:modules todd.r$ ls httpd.exp libphp5.so ...
1
vote
1answer
123 views

Show files from terminal command results in Finder

I can find original files in a directory (as opposed to hard links) in Terminal with find ./ -type f -links 1 -name file2find How can I view the results in a single Finder window?
1
vote
6answers
1k views

UNIX “find” command, match literal “dot”

I need files ending with ".pdf" or ".png"; here's my attempt: find /Users/robottinosino/Desktop/_PublishMe_ -type f -regex '.*[pdf|png]' this incorrectly includes files ending with "Apdf", "Zpdf", ...
-2
votes
2answers
754 views

Can't find the path to proxy.pac file in OS X

I need to control my proxy.pac file in OS X, but I couldn't find it anywhere. I used whereis proxy.pac from terminal too — the whole story short: I want to find the path to a file in Mac OSX.
0
votes
1answer
663 views

How do I make “find” only match files in specific sub-directories

I'm using bash for Mac OS X 10.6.8. Using the find command, I would like to search for files that match *.XML. However, I would like to match only those files in the 16xxxx sub-directory and not ...
4
votes
1answer
179 views

Why does $ find -delete not work sometimes?

I think what I'm talking about is this part of the manpage, which is just barely too indecipherable for me: -delete ... It will not attempt to delete a filename with a ``/'' character in its ...
2
votes
2answers
984 views

Textmate: regular expression to replace matches preserving case?

How can I use a single search / replace to replace all words town with village preserving the case of the first letter in this sentence: Towns are small cities. I live in a town.
1
vote
2answers
639 views

How can I prevent MacVim from showing OS X' Find/Replace dialog when pressing Command-F?

Using MacVim, I'd like Command-f to not show OS X' Find/Replace dialog, but instead beginning a normal search in Vim, i.e. sending / from normal mode. I.e. I'd like MacVim to use Vim's internal ...
2
votes
2answers
151 views

How to copy head of files to another folder, keeping tree structure?

I have a bunch of huge files (4GB+ each) with the same extension in a directory structure in a network drive, but am only interested in the first few bytes of each, so I'd like to copy them all to my ...
3
votes
1answer
2k views

How do I get files found by command-line 'find' ordered by modification date in OS X?

Using the Mac OS X Terminal, how do I write a find command that orders results by modification date (most recent first)? There are similar questions already, but they refer to GNU find and POSIX, but ...
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 ...
4
votes
10answers
2k views

Is there a simpler form of find . -name “*substring_of_filename*” on Mac OS X and Linux?

On Mac OS X or Linux, is there a simpler form of the command find . -name "*substring_of_filename*" which is to find all files having names containing substring_of_filename within the current ...
0
votes
0answers
187 views

What's a good find / replace utility for Mac OS X? [duplicate]

Possible Duplicate: Mac OS X search and replace tool with regular expression support I'm looking for a utility to do some multi-line find / replace with a GUI interface, possibly with some ...
0
votes
1answer
2k views

mac os x, find all symbolic links that point to files on a different volume

In my ~ dir, I have some symlinks that point to "/Volumes/Macintosh HD 2/..." and I want to find them all recursively. A look at the man page for 'find' says the '-lname' argument will search the ...
8
votes
4answers
17k views

How do I find a file by filename in Mac OSX terminal?

I want to find a file on my Macbook with the filename: abc.dmg. I've tried to use spotlight, but it doesn't find it. When I tried find, and used: find -name abc.dmg -path /, I got errors back. What ...
2
votes
2answers
2k views

Why doesn't 'find' prune the way I think it should?

I'm running MacOSX 10.5.8 I run the following: ~/Sites/jjprof/trunk/content > find . -type d -name '*svn' -prune ./.svn ./resources/.svn ./resources/sitewide/.svn ./temporary/.svn ./users/.svn ...
0
votes
2answers
298 views

How can I find all files that are not of a certain kind using Spotlight?

I can enter "Shockwave Flash Movie" in the the search field of a Finder window and find all files that are of Kind, "Shockwave Flash Movie" However, I really want a list of all files that are NOT ...
1
vote
1answer
2k views

How do I specify a date range for find command on OSX?

I need to find files within a date range to the minute. I suppose knowing how to do it to the second might be beneficial one day. Anyhow. I've learned how to use -newermt and even -not -newermt; ...
0
votes
2answers
172 views

Copy a file from source directory to target base directory and maintain source path

Forgive me, I am probably not using the right terms to describe the problem and misunderstanding the most basic usage for a couple of common commands. I have a simple find statement that is ...
2
votes
2answers
227 views

Most efficient way to get a large directory listing over network

I'm searching for specific files on a Windows 2003 server directory that contains thousands of files. The directory is part of a network volume that's mounted on my Mac. Right now I'm using find: ...
1
vote
2answers
478 views

find shellscript execute command for every file

I found "find" command is much faster than "Spotlight" in mac os x i rather visualize the results with automator with no luck so I hope geeks around SU will help with solution about that a ...
3
votes
2answers
3k views

Syntax for find on Mac OS X

I have a project directory that contains source code and subdirectories of source code. I want to use the Unix program find to search recursively for the names of files of certain extensions. The ...
3
votes
2answers
1k views

How can I use sed to alter the results of find and pass the results to cp?

In solaris, I'd like to copy all files found by the find command to a slightly different path. The following script basically executes cp for each file found by find. For example: cp ...
14
votes
9answers
20k views

Copy all files and folders excluding subversion files and folders on OS X

I'm trying to copy all files and folders from one directory to another, but exclude certain files. Specifically, I want to exclude subversion files and folders. However, I'd like a general yet ...