1
vote
4answers
64 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 ...
1
vote
4answers
89 views

Find all files where other files with different extension dont already exist

I want to use the find command, to find all files with a certain extension (avi), where the same filename with another extension (mp4) does not already exist. so considering these files: a.avi a.mp4 ...
1
vote
1answer
28 views

find . file -/+ size except *.filetype

Alright what I am looking for is a way to do something that can find all files less than size except filenames with an extension or more. May be more than one. find . -type f -size -20M -name /! ...
1
vote
1answer
96 views

Why is [find] running incredible fast, if run twice?

In the Dash of my Ubuntu/Linux system are two versions of the same program. To find where the corresponding .desktop files are located I used find / -type f -name 'Sublime Text.desktop' 2> ...
3
votes
2answers
74 views

How to exclude files using find

Unlike the --exclude parameter for rsync that can excludes both files and directories, the *nix find command's -prune parameter can only exclude directories. So how can I exclude a certain type of ...
3
votes
1answer
5k views

Ubuntu Linux: find files between specific times?

I found an SO called using Find/Grep to search files between specific time of day Based on that and a Unix SE called Grep command to find files containing text string and move them I ended up with: ...
1
vote
3answers
61 views

find exactly one file in directory

I have very big collection of files. When I use command find I'm sure there is only one file in this collection. To make all my find commands faster I would like to run find command just until it had ...
3
votes
3answers
335 views

Why doesn't this for loop work?

This is on Ubuntu 12.04 I'm trying to figure out how to get ffmpeg to do a batch conversion of FLACs to MP3, recursively. If I cd into a directory and use for f in *.flac; do ffmpeg -i "$f" -c:a ...
5
votes
4answers
2k views

Gracefully deleting files older than 30 days

I have a cache folder with minimum of 15000 files. I tried this: find cache* -mtime +30 -exec rm {} \; But this made my server load fly to the skies! Is there any faster/better solution? Or can ...
3
votes
5answers
1k views

Grep all files in a directory and print matches with filename

I have a list of log files that I create as part of a video encoding script that I wrote. I would like to search all of them and print out certain statistics from the encode - how fast they were ...
0
votes
2answers
331 views

recursively delete but keep .gitignore file

I've been trying out several methods from SU but I have been unable to do this: I got a folder (example: /var/www/tmp/) which contains several files and directories. I'd like to delete all the files ...
10
votes
4answers
6k views

Ubuntu grep, find etc: “Permission denied” and “No such file or directory” output

When I grep or find something I always get annoyed by the "Permission denied" and "No such file or directory" notice, smth like that: johndoe@johndoe-desktop:/$ grep -rnP 'YII_CORE_PATH' ./ | grep -v ...
26
votes
2answers
4k views

Why is it so hard to find a file in Ubuntu?

It's very hard to find files in Ubuntu. In Windows, you could just go to C:\Program Files and you would find what you need. In Ubuntu, you must use search to find something you need. Maybe I am ...
5
votes
7answers
1k views

How can I use command to open the first search result with vi?

Every time I need to find a file and then open it, I have to use : find ./ -name **.properties. , then copy the result, and then vi "paste the result here" . If I need to use a mouse, it can be a ...
3
votes
5answers
13k views

Find document files and copy them to another directory

This is a bit of a basic question but I'm trying to copy all .doc files I find in a directory and copy them to another directory. I know each command: find -name '*.doc' . and: cp filename ...
1
vote
2answers
1k views

Ubuntu bash command find -exec

I want to list every file that ends with "conf", and output the results to a given file (with the command "find -exec"). I tried this: find -name *conf -exec /home/ubuntu/myfile Is this wrong?
1
vote
4answers
1k views

How do I find and modify permissions on one filetype in an Ubuntu terminal? [duplicate]

Possible Duplicate: How to chmod 755 all directories but no file (recursively) ? I've just upgraded from Ubuntu 8.04 to 9.04, added an extra hdd for /home and used an iPod (FAT32, sadly) to ...