1
vote
2answers
34 views

how can i find all files that contain embedded crc32's

how can I find all files that contain embedded crc32's e.g. Mydocument190_[F285E17D].pdf using the find command to clarify the crc32's are always within brackets [F285E17D] and the file names may ...
1
vote
1answer
72 views

Get total diskspace usign du for multiple directories

I know about du -sh which gives me total disk space used for given directory. My problem is the directories I am interested are scattered in lot of subdirectories. I have right "find" command that ...
3
votes
4answers
389 views

Find files with a specific 2-line pattern using awk

I have a few hundreds of files that has this pattern @<TRIPOS>ATOM 2 H18 65.2220 Du 1 RES1 0.0000 @<TRIPOS>BOND 1 3 5 ar @<TRIPOS>SUBSTRUCTURE among them, some of the files ...
0
votes
2answers
124 views

find/tar combination to backup certain files at one level, and all files in one subdirectory

Our server's directory structure is like this /home/site1/public_html /home/site1/logs /home/site1/cgi-bin etc...(it's the standard when using virtualmin) What I want to schedule backups for is ...
0
votes
1answer
89 views

find -exec not working properly, why?

I am trying to list all the file names (the basename, not the full path) below my home directory using find. I tried to do: find ~/ -type f -exec echo $(basename "{}") ";" However I end up having a ...
3
votes
2answers
231 views

find does not work with my variable

I'm trying to find the number of dirs and files in a given dir. I'm running my bash script like this: ARCHIVE=/path/to/archive ./myScript in my script I am doing this: #find the number of ...
4
votes
7answers
6k views

Filenames with spaces breaking for loop, find command

I have a script which searches all files in multiple subfolders and archives to tar. My script is for FILE in `find . -type f -name '*.*'` do if [[ ! -f archive.tar ]]; then tar -cpf ...
2
votes
1answer
77 views

How to reliably determine all folders not used in last 7 days?

I'm writing a script for cleanup job. The script needs to cleanup all folders which are not accessed for more than 7 days. Currently I'm using - for sub_folder in * ; do if [ -z $(find $sub_folder ...
2
votes
2answers
495 views

How to move unknown files to unknown directories based on folder name?

I am trying to write a script that will search a directory for a folder, and move the folders contents one directory up from their location. this is what i have so far: find ./localFolders -name ...
3
votes
2answers
450 views

Recursively apply the msgfmt command to all .po files in directory with find -exec

I have the following directory structure: webiste/ locale/ en/ LC_MESSAGES/ translation.po de/ LC_MESSAGES/ ...
2
votes
2answers
618 views

how to find exact file without listing folders

my current folder is the top of the folder tree structure somewhere inside I have an *.rpm file. how do I find that *.rpm file in a way that'll list only its full path when found and not list every ...
0
votes
1answer
866 views

How do I remove files as a result of the find command?

I want to rm all the files that I get when I run find search-3S-beta |grep "\.log\." What would be the command?
7
votes
3answers
2k views

How do I exclude a directory by name using find?

I have a lot of directories on my system, with a structure looking like this: \-----data \------- 001abc \------- 002abc \------- 003abc \------- 004abc \------- ...
0
votes
1answer
224 views

Find and exec using pulled variable

So far I have a simple batch script that moves *.mkv files from their source folders to a folder called "Movies". Now I would like FileBot to rename them using the 'find' command, since it (filebot) ...
4
votes
3answers
231 views

bash escaping and find command

I trying to remove boring \-escaping from this command: find . \( -name '*.mp3' -o -name '*.jpg' \) -print by wrapping it in single quotes: find . '( -name *.mp3 -o -name *.jpg )' -print ...
23
votes
3answers
4k views

Find directories that DON'T contain a file

Yes, I'm sorting out my music. I've got everything arranged beautifully in the following mantra: /Artist/Album/Track - Artist - Title.ext and if one exists, the cover sits in ...
2
votes
2answers
865 views

Find files/folders in folder except some specific folders

I'm trying to move all files from one folder to another, except some specific folders. I tried this to move all files except the .git, assets or build folders: find .. ! -regex ...
2
votes
1answer
2k views

find: unknown predicate

This is probably not a Ubuntu question as such, but a Linux one instead, still hope some Linux user out there can help me understand this. I'm trying to use the find command to look for some files an ...
1
vote
2answers
4k views

find: missing argument to -exec

The following works from the terminal no problem find testDir -type f -exec md5sum {} \; Where testDir is a directory that contains some files (for example file1, file2 and file3). However, if I ...
2
votes
1answer
271 views

subshell ls -lh “$(find /music -type d)” doesn't return list, instead results of find command

I'm trying to list the details of all the directories in my music folder using the following command: ls -lh "$(find /music -type d)" However all I get is the return of the find command. Is this ...
6
votes
1answer
14k views

Find file or directory in whole directory structure

How can I find a file with a specific name in bash. I want to search through the whole system. I tried with find, but that only work through one level.
1
vote
1answer
89 views

Get disk utilization by file-type?

Is there a way to get a break down of a disk (or directory) utilization based upon file-type from the command line? I guess I could write a bash script to find+du based upon a few known file-types, ...
5
votes
3answers
5k views

using grep with pipe and ampersand to filter errors from find

I am using cygwin to find a file on the cygdrive. However I need to suppress the permission denied messages (otherwise the results get hidden in the error messages). The following command works: ...
1
vote
3answers
2k views

A problem with Bash script

I want to write a simple script to detect a file created by Windows virus. Usually it creates an .exe file, with the same name, as the directory it drops. Here is the script. It only works, if the ...
1
vote
2answers
488 views

Creating a directory of recently created files

On a system I have, files are uploaded through a series of various mechanisms into one central "incoming" directory. Once a day those files are processed and they are moved off to where they need to ...