A commandline utility to find files and directories.

learn more… | top users | synonyms

18
votes
2answers
2k views

Why I can find *main.o but cannot *.o?

This one is correct: $ find . -name *main.o ./main.o So, why I can't find *.o? $ find . -name *.o find: paths must precede expression: main.o Usage: find [-H] [-L] [-P] [-Olevel] [-D ...
3
votes
1answer
69 views

Find a file which contains a string and delete it in Ubuntu

My CMS is full of SPAM scripts and they are almost in every folder. I figured out, that I can find those scripts by using this find/grep command: sudo find . -type f \( -name '*.php' -or -name ...
0
votes
3answers
35 views

What's the easiest way to list files of a given extension, save that list to a text file, but omitting the actual extensions when in the text file?

This is for a counterstrike server, where mapcycle.txt contains all the maps found in the maps/ folder, but the list of maps must not contain the .bsp extension. Example of maps/ folder: map1.bsp ...
0
votes
1answer
26 views

find is using a LOT of resources - how do I find out why?

My Ubuntu 12.04 LTS system has been running very slow lately. I keep having to reboot it, and then within 24 hours it's slowed down again. I've gone in and run top and what keeps coming up at the ...
3
votes
3answers
384 views

For loop with unix find

Trying to do a mass convert from M4A to OGG in a large music collection, I have: #!/bin/sh for i in `find /home/family/Music -name *.m4a -print0` #do ffmpeg -i "$i" -acodec libvorbis -aq 6 -vn -ac ...
5
votes
1answer
186 views

Finding all .cpp files in the users home directory

How we will find more accurately all .cpp files in the users home directory that were modified no more than 5 minutes ago?
0
votes
0answers
29 views

I can not install windown back. I get error message “cannot find backlight controller” “Support for cores revisions 0x17 and 0x18 disabled by module”

I tried to install ubuntu to my win8 pre installed computer and I am new at ubuntu so I chose lvm option while installing. and now ubuntu deleted all data about win8 and does not let me install ...
2
votes
2answers
86 views

Renaming multiple files

My security cameras recorder (located in distant place), FTP`s to my server video files after any event. It automatically creates sudirs with name containing date of day. Using find and ffmpeg ...
1
vote
1answer
24 views

Efficiently finding the first file (in the lexicographical sense) among multiple directories

I have hundreds of folders and each folder contains thousands of files. I want to identify the "first" file among all files of all folders, "first" being defined by the lexicographical order of the ...
0
votes
1answer
46 views

Change the permissions of files and directories excluding one directory

I'm trying to change the permissions of files and directories, excluding one directory though. What I've got is: find ! -name test -exec chmod -R 700 {} \; test being the directory that I need ...
0
votes
3answers
69 views

What is wrong in follwing -exec command

I m getting error in follwing command cd /opt/lampp/htdocs/EspoCRM-2.5.2 && find data -type d -exec chmod 775 {} error: find: missing argument to `-exec'
1
vote
4answers
48 views

What the -exec in `find … -exec …` do?

I am learning searching and I'm confused this command. find -name "*.swp" -exec rm {} ';' Can you explain to me what this command means?
0
votes
0answers
43 views

How to use folder with wildcards and spaces in find command in script

I want to use find to find files in a set of folders restricted by wildcards, but where there are spaces in the path name. From the command line, this is easy. The following examples all work. find ...
0
votes
1answer
30 views

combine multible commands in one run one of them is find

I want in one line a command to use find to get a file name from a txt file , search for it , and play it then after closing the video I need to run a certain script I managed the first part but ...
1
vote
1answer
221 views

find: paths must precede expression:

I found the following line here: find * -maxdepth 0 -type d -exec tar czvf {}.tar.gz {} \; \; It is meant to tar gzip each folder in the current directory individually. But running it returns the ...
0
votes
2answers
66 views

Compute folder size for a given file extension only

I have a folder containing all my PHP projects, I'd like a command that would output the folder size of each project but only for the *.php files inside it. Ideally the output would be something like ...
0
votes
0answers
28 views

No Downloads, Documents, … folders in Home folder after installing dvsdk

Today I have installed dvsdk package in Home folder. For installing i have changed the mode using chmod 777 and executed ./[package_name]... After that, it asks where to install, I chose home ...
3
votes
3answers
65 views

How to list all properties of folders

How to list the properties of folders in a directory. Like, I want to 'find ./ -type d' and at the same time 'll' them.
4
votes
2answers
528 views

Why locate is faster than find? [duplicate]

I was looking for a file in my source and tried both locate and find. Surprisingly locate was searching in entire machine and was faster than find, which was searching only in current directory and ...
0
votes
1answer
18 views

find photos shot by a certain type of camera via terminal

I have a huge collections of photos shot with different cameras on my computer. Now, I would like to find all photos which has been shot with a certain camera via the terminal. I think it should be ...
0
votes
2answers
58 views

Find and exec in found folder

I'm trying to find files containing *.nef and move them to a subdirectory name NEF of the folder in which the file is found. I've started testing with the following command, but this always copies to ...
0
votes
2answers
65 views

Terminal - Search entire directory for keyword

I am working on a Ruby on Rails project so I have to manage multiple files. I think I made a syntax mistake somewhere but I'm not sure well. It would be awesome if I could search for a keyword through ...
0
votes
1answer
59 views

Does the mlocate.db generated by my updatedb cron job also applies to 'find'?

Reviewing the find man pages for Linux and for Unix, I came across the fact that the mlocate.db seems to apply to 'find' based searches as well as to 'locate' executions in certain flavors of Ux. So ...
0
votes
3answers
44 views

Filter only path of files (without directories path) from output using pipe |

rpm -qpl dhad-9.0.27891-2.x86_64.rpm allows to display all file paths and directory paths of this package . Example of output : /opt/dhad/tv_bin/wine/lib/wine/winmm.dll.so ...
0
votes
1answer
79 views

How Can I Combine 'SRM' and 'Find'?

I'm using SRM to securely delete files and directories. Most of the data is on FAT and NTFS volumes since I dualboot with Windows (I'm trying to use Ubuntu as much as possible and stay away from ...
0
votes
1answer
42 views

Lot of “file not found” when using sudo find / -type s

In the attempt to understand why I keep getting the following error error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)' while using the command sudo find ...
1
vote
2answers
42 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 ...
0
votes
1answer
31 views

finding some files and sorting the result by size and copy it to folder

well I want to use the cmd "find" to search some files and in the same time I want to sort the result by size sudo find ~ -name $i -exec du -sh {} \; | sort -nr | head -1 I used the cmd "du" for ...
1
vote
1answer
225 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 ...
-1
votes
4answers
544 views

how to find a word in text files from a directory [duplicate]

Suppose that I have a directory with name _file and includes two sub directory like _1 and _2 and on each one I have some text files. I want to search a word like foo in one of these text files. How I ...
3
votes
4answers
678 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
3answers
55 views

Using find and stat to display filename(s) and statistics

I'm trying to run a command to find all files starting with 'geo' and see when they were edited. I am trying to following but unfortunately am having no luck.. Is there a param for stat to display ...
1
vote
1answer
56 views

Find files in a directory and list them

I'm in a directory containing several sites directories. All these sites have a logs/ directory. I wish to find and list the files under each logs/ directory with the -ls parameter.
1
vote
1answer
94 views

Track file and folder name changes

I'm successfully running a remote backup of a small server over the internet using rsync. However, the process can be lengthy if the following happens. Let's say a large directory has had its name ...
7
votes
5answers
492 views

How can I combine the find command with other commands so I don't have to navigate to the folder?

Sometimes I want to run certain files, but I don't want to navigate all the way to the folder. If I know the file name and find -name file_name.py only returns one result, can I just use that? For ...
-2
votes
1answer
49 views

What xargs does exactly?

I don't understand exactly what xargs does that's why I'm surprised why these 2 return different results: find ~/Downloads -iname *btsync* | ls -al find ~/Downloads -iname *btsync* | xargs ls -al ...
2
votes
3answers
523 views

Get absolute path of files using 'find' command

Is there a way to get absolute path of a file that is being searched? For example: find .. -name "filename" It gives me results like ../filename but I want the full path. What I need is to find ...
0
votes
2answers
188 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 ...
1
vote
2answers
73 views

Find word that has more than 50 characters

I am trying to use find in combination with grep to find all the php files in my web server which have a word (any sequence of characters except whitespace) with more than 50 characters. I have this ...
2
votes
3answers
131 views

Find all .htaccess files that contain a particular string?

How would I find all the .htaccess files (recursively from current folder) that contain a particular string ('common.php') in my case? What would be the command to do so?
1
vote
1answer
213 views

Where are the uploaded files from redmine stored? and its not in “/redmine/files”

I am doing a migration from redmine 1.3.2 stable to 2.4.3 for that I need to migrate as well the uploaded files. In every documentation I can find it says that the uploaded files are in the ...
0
votes
1answer
118 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 ...
0
votes
1answer
379 views

How can I combine find command with gzip

I am trying to compress a specific files: find /media/mount/storage -newermt "2013-08-01 00:00:00" -path '*/*wind.txt' -print0 | xargs -0 gzip -l >> file_system.tar.gz but I am getting the ...
0
votes
1answer
25 views

Can't find Bluetooth file

This may sound dumb, but i have searched everywhere for /etc/bluetooth/audio.conf . I cannot find it. I have tried searching and doing everything of the manner, but I cannot find it. Please help.
0
votes
1answer
22 views

Need Help regarding Finding tools

When I type command find / -name ??.conf the output is a lot of files such as : find : /home/simmer/local/share/gvfs.metadata : Permission Denied Don't get the desired result, And if I use the ...
0
votes
1answer
73 views

Find directory and delete it's content but not itself

How do I find a directory and delete all it's content but not the directory itself? find -type -d -name 'Tmp' -exec rm -rf {} \; But this also deletes 'Tmp' directory. Thanks in advance.
1
vote
2answers
63 views

Find out where the directory is in Linux?

When I executed the command to give the pid of my processes running, it gave me like this - user@machineA:/$ ps -eo pid,command | grep exhibitor | grep java | grep -v grep 1615 java -jar ...
0
votes
4answers
607 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
0answers
33 views

Which app scans all disks searching any kind of media files (photos, videos, etc.)?

Is there an app which scans disks looking for all kinds of media files (photos, videos, etc.) the same way Picasa does for pictures? I could write a bash script to perform such thing, but I'm not ...
1
vote
3answers
176 views

Find directories that DON'T contain a file but YES another one

I have quite a large music collection and would like to find the directories in which I still have compressed files (*.rar) unprocessed. Hence looking for a command that lists directories in which i ...