search for files in a directory hierarchy

learn more… | top users | synonyms

0
votes
3answers
15k views

List all files added/modified on date

How can I use the find command to list all files for example modified on april 9 2011. Thank you, Chris
0
votes
5answers
422 views

Find all files recursively by a certain date

My site is compromised by an FTP brute attack and the cracker modified / created some files in my home directory. Let's say the date of the malicious creation / modification is 2011-4-5 21:38:09. ...
1
vote
3answers
894 views

Dos find command? [closed]

Are there any utility find commands that you can download and use in DOS which match the UNIX find command?
0
votes
2answers
3k views

How to compare to text files using command line tools, under windows [closed]

I have to sorted files, say A.md5 and B.md5. I would like to write a small windows batch file, which returns the lines (in my case a list of files), which are present in A but not in B (not case ...
0
votes
1answer
513 views

Creating an MD5 file for a directory tree for only a given extension

I would like to create an MD5 file of a directory tree, containing only the bare names of the files. md5deep exactly does that, but it cannot filter for files when in recursive mode. md5deep -rb . ...
6
votes
3answers
8k views

finding a file which was modified in last 10 minutes

I am running this command to find out the files which were modified in last 10 minutes find / -fstype local -mtime -10m but it is giving following error each time find: missing argument to ...
28
votes
8answers
71k views

how to find out mac addresses of all machines on network

Is there some easy way to find out mac address of all machines on my network rather than doing an SSH into each and ifconfig | grep HWaddr if there are 300 machines on network I really need some easy ...
3
votes
3answers
859 views

find files their name is smaller or greater than a given parameter

Say that in a given directory I got tzury@x200:~/Desktop/sandbox$ ls -l total 20 drwxr-xr-x 2 tzury tzury 4096 2011-03-09 10:19 N00.P000 drwxr-xr-x 2 tzury tzury 4096 2011-03-09 10:19 N00.P001 ...
2
votes
2answers
92 views

How to list directories that aren't being symbolic linked to in a directory?

I'm trying to do some cleanup similar to this question. In a UNIX OS, I want to delete the directories that aren't being symbolic linked to in a given directory. e.g. I have a deployment script that ...
-1
votes
1answer
74 views

Cygwin find integration

I would like to find all NON read-only files in my directory using cygwin's find command. Is it possible ?
1
vote
2answers
525 views

finding a group of string common in two files

I have used diff command in past.I faced a situation to which I did not had a clue here are some text strings (which can be stored in a file) CONFIG_XEN=y CONFIG_XEN_PVHVM=y ...
0
votes
4answers
1k views

how to find a text string which may be present in some unknown file in entire filesystem

I am stuck up with a problem I have a line 'something' in some file. In which file is this line that I have forgotten. In the entire root file system I would like to find out which file and where is ...
17
votes
2answers
3k views

How to find files in a Debian system not installed or created by dpkg?

I've installed some things manually in the past and would like to weed out all related files. So, I need a way to automatically find all the files (in /usr, for example) that are not included in any ...
5
votes
2answers
1k views

List directories not containing a file

I've seen similar questions to this, but nothing I can find related directly to files. Is there any way to give me a list of directories which do not contain a specific file? Example: /dir1/good ...
2
votes
5answers
2k views

Find files containing a string on the whole filesystem

I need to find all the instances of a given string in the whole filesystem, because I don't remember in which configuration files, script or any other programs I put it and I need to update that ...
7
votes
4answers
1k views

Bash: execute command on results of FIND

I am trying to resize all files that are found using a FIND command (they are all files within a directory and its subdirectories). I tried many options but stumble across different errors each time. ...
3
votes
3answers
968 views

sh script to remove just txt files using find and exec rm warns me of missing argument to exec

find /full/path/dir -name '*.txt' -exec /bin/rm {} \; Fine in a shell, but pop it in a sh script along with some similar lines, to get it to run nightly from a cronjob, and it reports: find: ...
1
vote
1answer
72 views

find command + print manipulation

with the following command: find /tmp -depth -name file I get the: /tmp/file /tmp/test_file/file But what I need to add to find command in order to get the following print? ...
1
vote
2answers
3k views

Recursively rename files using find and sed

I want to go through a bunch of directories and rename all files that end in _test.rb to end in _spec.rb instead. It's something I've never quite figured out how to do with bash so this time I thought ...
8
votes
6answers
9k views

find command + enable Exit status to be diff then 0 when not match

when I perform find /tmp -name something find command not find the something word under /tmp echo $? I get $?=0 it's OK but how to enable Exit status diff then 0 when find command not ...
0
votes
2answers
329 views

rename files and dirs under linux

why the following command " find / -name 'node1' -print0 | xargs -0 rename 's/node1/node_STAR/' " not replace the node1 under /var/tmp directory? my target is to scan linux sys and rename ...
0
votes
4answers
772 views

directory with 980MB meta data, millions of files, how to delete it? (ext3) [duplicate]

Possible Duplicate: rm on a directory with millions of files Hello, So I'm stuck with this directory: drwxrwxrwx 2 dan users 980M 2010-12-22 18:38 sessions2 The directories contents is ...
3
votes
1answer
346 views

List directories without a specific folder

I need some help constructing a directory listing using 'find'? An example directory structure looks something like this: / (root) - /foo - /folderA - /folderB - /bar - /folderA ...
1
vote
3answers
1k views

chmod of 400,000 files inside multiple subdirectories?

Howdy... I'm looking to chmod 777 a whole bunch of files. Alternatively, since it's more secure, I could also settle for a chown www:www of these files to make them web accessible. Now, since I have ...
6
votes
4answers
12k views

“find -mtime” does not work as expected on files with different timezones?

I have some files on server with the date several months ago, but invisible for find -mtime 7 search. When I list them as ls -l they look perfectly normal -rw-r--r-- 1 root root 347253 Jun 12 ...
0
votes
2answers
199 views

Search multiple strings from multiple files

How to search multiple strings from multiple files with a single command. May be using grep or find or if there is any other in Linux or Solaris
5
votes
2answers
17k views

rsync only files created or modified after a date and time

The goal is to rsync (or using any other tools that give the desired result) only files that are created or modified after a date. It should work with filenames containing spaces (and/or other ...
0
votes
3answers
2k views

exclude all hidden files and directories in solaris

Unix newbie could use your help. I'm using Solaris 10 and need to find all files, excluding all hidden files and directories. The ultimate goal is to put this in a script that will delete files 60+ ...
1
vote
1answer
908 views

rsync and find files edited in last day

using rsync to do daily backups of our databases but i don't want to mirror the original every days and just download the files that have changed. this is nearly there but when there's one match in ...
0
votes
1answer
540 views

Finding/deleting top level folders not containing any files

I want to delete the top level directory which does not contain any files, but can contain other empty (meaning again not containing files) directories. For example: $ ls -R .: foo/ ./foo/: bar bar1 ...
8
votes
2answers
3k views

Linux & SVN: How to remove all versioned files but KEEP directory structure, ignore .svn dirs?

I want to remove all the versioned files from my repository, but KEEP the versioned directory structure. Obviously I want to leave all the .svn directories untouched. In other words, I want to ...
19
votes
4answers
7k views

A better unix find with parallel processing?

The unix find(1) utility is very useful allowing me to perform an action on many files that match certain specifications, e.g. find /dump -type f -name '*.xml' -exec java -jar ProcessFile.jar {} \; ...
0
votes
2answers
176 views

Copying files (of a particular extension) remotely onto local computer preserving paths

I have bunch of files on the remote server. I'm not interested in most of them, except for .pl files. I want to get a copy of these on my local computer. What is the best way to do this (at the ...
3
votes
1answer
30k views

How to search in centos or linux

I have found that sometime i can find files using locate but sometimes it dont find. Which directories it find the file using locate or find Suppose i want to find the files or directories having ...
1
vote
2answers
216 views

Multiple command executions from find

Most people are familiar with using find to run the same command on a number of files, e.g.: find -type f | xargs command or find -type f -exec command {} \; My question is whether it's possible ...
0
votes
1answer
632 views

List all files without 775 or 777 permissions

How can I list all files without 777 or 775 file permissions?
1
vote
3answers
5k views

find command no such file or directory error

I am using this command to delete the files and folders older than 150 days find /media/Server/VPS/dailySQL/* -mtime +140 -exec rm -rf {} \; The problem is that i get the error like below find: ...
0
votes
3answers
874 views

Linux: exclude specific file types when running “locate”

I'd like to configure locate to always exclude specific file types. For example, I would like to exclude ".pyc" ".class" "~" etc.
10
votes
1answer
7k views

Get all extensions and their respective file count in a directory

Getting all extensions for a directory: easy. Getting file counts for a particular extension: easy. But getting all file extensions and their respective file counts is alluding me. eg. + dir + ...
0
votes
2answers
187 views

File name using find

How to get the file name while using find command? When I use find command to search particular type of files from a directory and subdirectories, I get the whole path of that file, how do I get the ...
11
votes
2answers
6k views

find command default sorting order

what is the default sorting order for entries returned by the linux find command? For example, if I issue find . -type f -name '*mp3' and the output consists of multiple files across multiple ...
5
votes
7answers
2k views

Linux Colorize Find?

Is it possible to 'colorize' the output from find? I have a find that searches /home on all of my servers, and exec 'rm' certain files. As these are mixed in with my other find results, among ...
2
votes
3answers
750 views

How to use find to replace several files of the same name

I have several files of the same name (say, somefile.php) scattered within several directories under /var/ If I want to replace all of them with a new version of somefile.php located in, say, ...
1
vote
3answers
3k views

mass mv using find?

there are a bunch of filename.gif scattered in /home/ directories. I want all the filename.gif replaced by a /home/shared/filename_default.gif. I tried something like find /home/ -name ...
1
vote
3answers
310 views

Find in files, Linux

Say I want to find all files that mention "Jonathan Appleseed" in a Linux system. I see examples using grep, but I can't quite grep yet how to search (all directories from HERE). So I want to look ...
1
vote
2answers
566 views

Linux shell script: delete all files without “01” in the name

I have a backup script that creates files named for the day of creation in the format backups_YYYYMMDD.tar.gz I currently purge everything over 30 days old with a command like this: find /backups ...
2
votes
4answers
3k views

How to remove directory on NFS fileystem with an enormous number of files

A poorly tested program created a directory on an NFS share with an enormous number of files, which I need to remove. ls -ald /home/foo drwxrwxr-x 2 503 503 317582336 Jul 29 11:38 /home/foo The ...
1
vote
3answers
2k views

How to delete everything except .svn directories?

I have quite complex directory tree. There are many subdirectories, in those subdirectories beside other files and directories are ".svn" directories. Now, under linux I want to delete all files and ...
6
votes
4answers
3k views

find only files in directory with permissions not set to 644 on linux

This is my first question although I've been lurking for a while. Question: I would like to use find to get only the files in a directory with permissions not set to 644 (or another permission ...
6
votes
3answers
475 views

Using `find` to delete

So, given three options... find .... -delete find .... | xargs rm ... find .... -exec rm ...; ..or variations thereof, which option is preferable? I'm guessing there is no hard and fast ...