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 ...
1
vote
1answer
116 views

How do I remove HTML from MS Word 2010 document with Find/Replace Wildcards/Regex?

I found a website to help me choose domain names. I have my shortlist which I can't export, but I need to share the list with some other team members first. It also won't let me copy and paste the ...
2
votes
1answer
52 views

find -regex not recognizing \d digit

I have a directory structure that looks like the following: processor0/10 processor0/10.1 processor0/10.2 processor1/10 processor1/10.1 processor1/10.2 ...etc... processor7/10 processor7/10.1 ...
2
votes
1answer
38 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 ...
1
vote
2answers
59 views

Find all php files which first or second line has more than N characters

I would like to find all php files on my server which first line or second line has more than N characters. I would like to print both the file name and the line content that was found. How would I ...
0
votes
1answer
73 views

Word Find - find any highlighted text that starts with a squared bracket

Is there a way to Find highlighted text that ONLY begins with a open square bracket? I've tried using the square bracket as a wildcard, but it won't find any adjoining words. For example, I have a ...
1
vote
3answers
151 views

Permanently set `find` regextype

GNU find allows the use of different regex formats via the -regextype option, but as far as I can tell I have to type out -regextype <whatever> every single time which is onerous. If one wants ...
0
votes
1answer
65 views

linux find regex - can I use 'search', instead of match?

the find utility is powerful, but I'd need some additional features. its -regex search treats each filename (or dirname) as a string and applys given regex only at the beginning of name. like ...
2
votes
3answers
250 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 ...
1
vote
2answers
73 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 ...
0
votes
1answer
803 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 ...
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 ...
1
vote
2answers
86 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
1answer
934 views

Why does the following find regular expression not work on Linux?

I am attempting to locate files that match a particular pattern however attempting to run the command below returns no results even though there are files that should match the pattern. find . ...
1
vote
1answer
342 views

Using find and sed to rename several subfolders

What I am trying to do is rename folders that are anywhere in the current tree, not neccessarily directly in the working directory. What I need to do is: "A 1" becomes "A 01" "A 2" becomes "A 02" ...
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
1answer
114 views

Linux “find -regex” doesn't handle binding

I have the following files, and need to match them like: ./foo.bar1.sh -match ./qux/foo.bar2.sh -match ./foo.sh -match ./baz.sh -no match ./foo.bar3 -no ...
0
votes
2answers
437 views

grep doesn't produce the correct output when run on find command

My task was to print the number of files in the current directory without using ls and wc commands. I had typed the following lines in the script: #!/bin/bash find . -maxdepth 1 -type f \( ! -iname ...
3
votes
2answers
5k views

How to use command “find” to list files with specific filename length?

In my folder I got files like /data/filename.log /data/filename.log.1 /data/filename.log.2 /data/filenamefilenamefilename.log /data/filenamefilenamefilename.log.2 I wish to use "find" command to ...
8
votes
3answers
11k views

How to ignore certain filenames using “find”?

One of my favorite BASH commands is: find . -name '*.*' -exec grep 'SearchString' {} /dev/null \; which searches the contents of all of the files at and below the current directory for the ...
2
votes
2answers
1k 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
1answer
421 views

Linux find and grep for files not match pattern

I'm trying to search the entire file system for specific text. This command does that but it gets hung up in certain directories like '/proc': find / -print0|xargs -0 grep whatever What I'd like ...
0
votes
1answer
69 views

Searching for *.graphml files with the find utility

I am trying to find all my GRAPHML files under the current directory in bash. So I ran the following command: find . -name *.graphml And I get the error message: find: paths must precede ...
1
vote
2answers
74 views

using find to locate filenames before a certain date

I have a ton of files that are timestamped directories. These all look like 2011-06-24_13.53.36 // a directory name for june 24th, 1:53:36 pm I have thousands of these directories. I want to do ...
4
votes
2answers
1k views

How to rename all files and directories in current folder?

I have a directory structure like this: ./ whatever/ foos_whatever.ext something/ foo/ 1.ext 2.ext another/ foo.ext I want to rename all files and directories that ...
3
votes
2answers
2k views

How to get list of files that don't match patterns in bash?

I have a file with joker character patterns: ./include/* ./src/* etc. From the current directory I would like to recursively get the list of files that do not match these patterns.
8
votes
4answers
7k views

How to list all source files (*.c, *.cpp, *.h)

I'd like to find source files (*.c, *.cpp, *.h) that contain in Linux/MinGW/Cygwin, and recursively in all sub directories. My basic idea is using find and grep. However, building a regular ...