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. ...
0
votes
1answer
34 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
24 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?
0
votes
1answer
28 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
1answer
60 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 ...
1
vote
4answers
58 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 ...
0
votes
0answers
11 views

Detect symlink errors in installation

It is my understanding that the Linux Filesystem Hierarchy is supposed to be structured like this: /usr/lib/prog-ver - contains the actual installation of prog (e.g., java) version ver (e.g., ...
0
votes
2answers
38 views

find: show directories which contain certain subdirectories

I have a list of directories /u2/tip/coy/inter/fcs/ /u2/tip/coy/inter/fcs/devel /u2/tip/coy/inter/fcs/ecom_flink /u2/tip/coy/inter/fcs/totalstable /u2/tip/coy/inter/fcs/develbi ...
0
votes
1answer
54 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 ...
0
votes
2answers
46 views

How to List Files greater than particular timestamp?

I have a directory in linux which has a list of log files where log files get auto generated if some job runs. Each log file gets appended with the timestamp like "JobName_TimeStamp" UPDATED: ...
1
vote
1answer
26 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 ...
2
votes
1answer
42 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 ...
0
votes
1answer
17 views

linux find file modiffied past exact hour

I would like to find files that are modiffied past exact hour. example: File Time Modified test1.log 14.45PM test2.log 15.01PM ...
2
votes
1answer
35 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 ...
0
votes
1answer
69 views

Using find and wc -L to find files containing lines longer then 500 characters

I have this command: find . -name "*.php" -exec wc -L '{}' \; And I believe it gives me the count of the longest line for each file. But I'm looking for a way to only print out the count and file ...
2
votes
1answer
42 views

Are there limits to file length piped from find to xargs or using find -exec +

In question [ Find and delete all the directories named "test" in linux ] on this site, the best answer talks about using these two commands: find . -name test -type d -print0|xargs -0 rm ...
4
votes
3answers
84 views

Using Unix's find command to find directories matching name but not subdirectories with same name

Edited: I mistakenly misrepresented my problem. A more accurate example now appears below. I'd like to recursively walk all directories inside a target directory, and stop each recursive call after ...
0
votes
1answer
43 views

Why result of find command in linux is unsorted?

When I do a find the results are apparently in random order, shouldn't they be sorted by name?
0
votes
1answer
25 views

How to find files that contain a string in its content OR the path?

Find and grep does not work afaik because I need to create a list of files that satisfy EITHER requirement, not both. I assume this requires more than a one-liner. Any suggestions?
0
votes
3answers
58 views

How to exec two commands in one find

I would like to find specific folders echo their name ls -l their contents My problem is that I don't know how to combine an echo {} and an ls -l {} in one find command. line for echo: sudo ...
1
vote
0answers
256 views

find command with exec sh doesn't work in shell script but in commandline (raspberrypi)

I want to find "old" folders in /volume1/photo/ipcam which are named like "????-??-??" and move corresponding folders within dropbox (with the same directory structure /ipcam/...) to the subfolder ...
0
votes
1answer
20 views

post-order for find -exec?

I want to remove certain directories from a hiearchy using 'find -exec' find $rootdir -type d -name target -exec rm -rf {} \; I get error messages find: `foo/bar/target': No such file or directory ...
1
vote
1answer
54 views

Combining two linux commands

Im trying to use mergecap to merge 15 old pcap files in a folder. I tried to use FILES=($(find /mnt/md0/capture/DCN/ -maxdepth 1 -type f -name "*.pcap" -print0 | xargs -0 ls -lt | tail -15 | awk ...
2
votes
1answer
76 views

*nix find -type flag: can it accept multiple types?

I want to use find for getting all simlinks and regular files. I can use the -type for these individually, and I can use -o to string them together, but I apparently can't do -type fl. Is there a way ...
1
vote
4answers
91 views

String Search: find and grep and?

Task: 1) find a string 'decor' inside files in a directory 2) get # of occurrence for decor for each file that has it The first part of the problem is partially solved with find . -type f | grep -i ...
1
vote
1answer
88 views

Find the largest file in directory without size in output

I need to find the biggest file Only one file should be listed Search should work in given directory and subdirectories Output should display absolute path to the file with filename find "$PARAM" ...
1
vote
2answers
28 views

Configure find not to even look in directories, if directory name maches 2012

I'm using find /home/myid/dir-with100directories/ -mmin -5 -not -path "*/2012/* to find all files, except not in directory 2012, but somehow it works really really slow. And my guess is that find ...
2
votes
1answer
72 views

find -mtime fails to return results that ls -l show are there

On a Red Hat Linux system, I have a directory with several hundred files. I wanted to delete all files older than 24 hours. I did the deletion using find . -type f -mtime +1 -delete. Trivial stuff, ...
3
votes
2answers
218 views

Is there anything faster than `find . | wc -l` to count files in a directory?

Not uncommonly I have to count the number of files in a directory, sometimes this runs into the millions. Is there a better way than just enumerating and counting them with find . | wc -l ? Is there ...
0
votes
0answers
14 views

How to use find with -delete when looking for directories

I know I can do find . -name '*.pyc' -delete But when I'm loooking for specific directories, -delete fails reporting that directories are not empty. Is it possible to force find to delete non ...
3
votes
1answer
382 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 ...
0
votes
1answer
81 views

moving the directories using find command

I am trying to find particular directory in one path and move the directory in other path using find. Source directory looks like below, /Dir1/country1/month1/date1,date2,date3 ...
1
vote
3answers
71 views

Move multiple files from filename list to a new folder

I have a list of filename in list.txt, which have 'abc1.png, abc2.png, abc3.png....'. However, I don't know the directories where the files are. I want to find all files in the txt file, and move ...
0
votes
1answer
49 views

How to find and copy files with spaces?

I am trying to find mp3 files in any subdirectories and to copy them, for example, in the current directory. Here is the command I tried: find . -name *.mp3 -ls | gawk '{printf("cp %s .\n", $11);}' ...
28
votes
5answers
943 views

Deleting millions of files

I had a dir fill up with millions of gif images. Too many for rm command. I have been trying the find command like this: find . -name "*.gif" -print0 | xargs -0 rm Problem is, it bogs down my ...
0
votes
1answer
44 views

Copy specific subfolders on linux

I have similar file sturecture: /home/dave/documents/static/ /home/static/ /home/dave/pictures/static/ /home/dave/otherfolders/ ... I want to copy from this directory only folders named static. ...
0
votes
2answers
64 views

How to find the file which was last updated on my Linux box?

I'm executing a command which updates a file in an unknown location on my system. What is the the find/locace/whatever command that will tell me, which file was the last to update on the system? This ...
1
vote
1answer
61 views

How to only remove file extensions while keeping other parts as they are

I have quite a few files with different extensions sitting under sub folders like 'aaa' /f1/aaa/a.txt /f1/aaa/a.sql /f1/f2/aaa/b.txt /f1/f2/aaa/b.csv what I need is to extract all these files from ...
1
vote
1answer
436 views

How to remove string from JPEG files using find?

I have many files in many media catalogs with some string and I want to remove this string. The string is contained inside JPEG files and looks like: ...
1
vote
0answers
130 views

Linux: Trying to find files from a list recursively and copy them somewhere else

I'm trying to find files from a list and copy them to another place. So I started my test loop like that: # cat ~/my_filelist.txt | while read file ; do echo "$file" ; done After I hit enter all ...
1
vote
3answers
146 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 ...
1
vote
1answer
55 views

Linux find command copy found files

I have mounted an image and have used the find command to show all file types found on the image ~/mounted $ find . -type f -exec file {} \; I know how to direct the output of the command to a .txt ...
1
vote
1answer
57 views

What is the meaning of -perm -400 in find command?

I found in a text the command find / -name "foo" -perm -400. What does the -perm -400 indicate?
1
vote
1answer
263 views

Batch run mogrify including subdirectories

The command mogrify -format jpg *.NEF when run in a directory converts all *.NEF files to JPEGs. What I want to do is to be able to run mogrify in *.NEF files inside subdirectories as well using one ...
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
1answer
243 views

linux find: searching for files smaller than 2Kb misses the ones between 1 and 2Kb

I just stumbled in an oddity with the find command on Linux, in a nutshell I had the need to find all files smaller than 2Kb in a certain folder, so I issued the command: find /folder_to_search_into/ ...
1
vote
2answers
1k views

find command: search for files owned by many users in one command

In Linux, is there a way to do a search for files owned by multiple users (or group(s) of users) with the "find" command? Something like this? find . -user john, akido
2
votes
3answers
237 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 ...
2
votes
1answer
275 views

Recursively delete all .exe files with the same name as the containing folder

I want to delete all .exe files in the current folder and all the sub-folders. I read that find . -name "*.exe" -exec rm -f '{}' \; will do, but I want to do the delete only if the container folder ...
4
votes
2answers
303 views

How make a compressed tar when there are too many filenames for the shell to expand on a single line?

Normally I would just do something like: tar -czf archive.tar.gz *.csv But when there are too many files in the directory for the shell to expand on a single line this doesn't work. In these cases ...