Tagged Questions
2
votes
4answers
95 views
Find and copy directories containing file type
I have a directory "Movies" containing subdirectories "Movie Name". Each subdirectory "Movie Name" contains a movie file and related image/nfo files etc.
I'm trying to copy all directories containing ...
0
votes
3answers
70 views
Find executable files recursively
I have got the directory called Test and a few directories inside it. Both Test and the directories inside it have executable files. I'd like to print them with ls. I'd use this command.
ls -l `find ...
2
votes
4answers
307 views
Move all files with a certain extension from multiple subdirectories into one directory
Suppose I have a bunch of zip files in several directories:
Fol1/Fol2
Fol3
Fol4/Fol5
And I want to move them all to a common base folder. How would I do this?
2
votes
3answers
195 views
Manipulate file name piped from find command
I'm relatively new to Bash and am trying to do something that on the surface seemed pretty straightforward - run find over a directory hierarchy to get all of the *.wma files, pipe that output to a ...
1
vote
2answers
103 views
find “an expression” on each file of a directory recursively
One of my website on my webserver has suffered an attack : code injection.
Here is the malicious code :
<script type=\"text/javascript\" language=\"javascript\">
(function () {
var t ...
2
votes
2answers
224 views
Search for file permisions other than 755
In AIX really, how can I search in several directories and those below it, for files that are not of the specific permissions of 755.
So I want to search /path/to/, /path/to/mydir, ...
5
votes
3answers
1k views
Find files with same name but different content?
I want to generate a list of files that have:
Same name
Different content
in a directory (including all children directories and content).
How to do? Bash, perl, anything is fine.
So, two ...
6
votes
3answers
3k views
How can I find all files that do NOT contain a text string?
What concise command can I use to find all files that do NOT contain a text string?
I tried this (using -v to invert grep's parameters) with no luck:
find . -exec grep -v -l shared.php {} \;
...
6
votes
2answers
2k views
How do I stop a find from descending into found directories?
I'm wanting to find all directories with a specific string so I can do another find on the files contained within.
So I don't want to waste time on ./my-search-term/dir/my-search-term etc.
How can I ...
2
votes
3answers
626 views
create md5 hash from a recursive file listing when some paths have spaces
I need to create an md5 hash of every directory and file inside of one main directory. The only thing that is keeping me from success is figuring out a way around files with a space in the path.
I am ...
4
votes
3answers
855 views
recursively copy only images and preserve path
I'm working on a website migration. I have a scrape of the site, with all the files and directory structure as you would see them in the URL. I want to pull all images, maintaining the directory ...
5
votes
4answers
1k views
find not recursive when file at top
Imagine a source tree. There are xml files everywhere.
But since there is a XYZ.xml at the root of this tree it won't find my xml files.
find -iname *.xml
returns
./XYZ.xml
instead of
...
3
votes
2answers
445 views
Find files with same name but different extensions, send to tgz
I have a large archive of edited images from my camera, each image is actually a pair of files - *.nef & *.xmp. I would like to go through all the folders and then zip these pairs into single tgz ...
6
votes
4answers
3k views
Finding a substring in files across subdirectories with a single built-in command?
In Windows, if I wanted to find a string across all files in all subdirectories, I would do something like
findstr /C:"the string" /S *.h
However, in Linux (say, Ubuntu) I have found no other way ...
10
votes
2answers
544 views
Tar up all PDFs in a directory, retaining directory structure
I'm trying to create a compressed tarball that contains all PDF files that exist in one of my directories. The directory structure needs to be retained. Empty directories are not needed, but I really ...