find file directory with the shell - linux

I want to find the directory 'thimthumb'.
I've a lot of wordpress installations and the search string should be a theme.
In some communities they said thimthumb has a virus and so I want to search it.
I'm root and try to use find but I did something wrong. Can someone create me the find string?
find /thimthumb # that's it?!

find -name ‘thimthumb’ -print From within the directory you want to search.

You can use this find command:
find / -type d -name 'thimthumb' -delete

If you have the "mlocate" package installed you can run:
locate thimthumb
if it doesnt return anything you may need to update the database
updatedb

Related

Where is /root/anaconda3?

I installed Anaconda3 and it should be located in the /root/anaconda3 folder. I can't find it using the search tab (I'm using the OpenSUSE Leap 15.4 operating system). How can I access this?
Most probably it has been put in another directory, you can search it using:
find / -name "anaconda3"
Or:
sudo find / -name "anaconda3"
The last might be interesting in case you need to search within directories where you don't have permission.

Fast way to find file names in Linux and specify directory

This command is slow: find / -name 'program.c' 2>/dev/null
1) Any faster alternatives?
2) Is there an alternative to the above command to search for a file within a specific nested directory (but not the entire system)?
The first / in your command is the base directory from which find will begin searching. You can specify any directory you like, so if you know, for example, that program.c is somewhere in your home directory you could do find ~ -name 'program.c' or if it's in, say, /usr/src do find /usr/src -name 'program.c'
That should help with both 1 and 2.
If you want a command that's not find that can be faster you can check out the mlocate stuff. If you've done a recent updatedb (or had cron do it for you overnight) you can do locate <pattern> and it will show you everywhere that matches that pattern in a file/directory name, and that's usually quite fast.
For fast searching, you probably want locate
It is usually setup to do a daily scan of the filesystem, and index the files.
http://linux.die.net/man/1/locate
although locate & updatedb is for the whole system, the search usually is faster.

Find command not working as expected in centOS

I am using CentOS Linux release 7.0.1406 on virtual box. I am trying to find the files using find command.
this find command is not giving any response:
find . -name "orm.properties"
My current working directory is /eserver6. File orm.properties is present in /eserver6/share/system/config/cluster, but find command is not able to find the file.
I have tried other combinations like
find . -name "orm.*"
find . -name 'orm*'
this is finding few files staring with orm but not all the files present inside the current working directory.
The command line looks correct and it should find the file. Some reasons why it might fail:
You don't have permission to enter one of the folders in the path to /eserver6/share/system/config/cluster.
You made a typo
The file system is remote and the remote file system behaves oddly
There is a simlink somewhere in the path. By default, find doesn't follow symlinks to avoid recursive loops. Use find /eserver6 -L ... to tell find to look at the target of the link and follow it if it's a folder.
The command
find /eserver6 -name "orm.properties"
should definitely find the file, no matter where you are. If it doesn't, look at -D debugoptions in the manpage. You probably want -D stat to see at which files find looks and what it sees.
If your user have entry into sudoers file then its ok and you can run
sudo find / -name "orm.properties"
or else ask your admin to give an entry in sudoers file of your user and run the same command then it will work.

Where can I find .curlrc file on UBUNTU?

Where can i find the .curlrc file? I have tried $HOME/ and echo $CURL_HOME gives me a blank line. I have also tried find . -name ".curlrc" in $HOME. No results.
Please help
updatedb && locate curlrc
make sure you run this command as root
or you could...
nano ~/.curlrc
This is where it should be.
I do believe by default though, there is no curlrc file. You might have to create your own
Try,
find / -name .curlrc
this will output all .curlrc files and you can choose whichever is required.

search/find a folder that has a name with integer numbers in linux from terminal

I am using fedora 15 on my machine. Actually i am trying to find the folders with name like apache-tomcat-7.0.37 by searching in the entire file system
Actually i had some folders like below in the path /opt/tomcat/
apache-tomcat-7.0.37
apache-tomcat-6.0.34
apache-tomcat-7.0.67
.........
And some folders at /usr/share/tomcat/
apache-tomcat-4.0.7
apache-tomcat-6.0.4
apache-tomcat-8.0.6
.........
So i want is to locate/find/search all these folder paths from linux terminal by using a command.
I have googled a lot and got some commands like locate and find as below
find / -name apache-tomcat*
locate apache-tomcat
The above commands are listing all the folder including extra unwanted information of folders, so actually what i want is , need to search for only for the folders that has the name like apache-tomcat-x.x.x,apache-tomcat-xx.xx.xx
Here in the folder name the starting words apache-tomcat is same and only the integer part (version number) changes. So i want to find all the folders with different version number like by using regular expressions in place of integer numbers to find the folders
so can anyone please let me know how to search the folder of the above scenario by using a command with regular expressions or someting like that which find all the folders with name apache-tomcat-xx.x.xxx.....
This should find all files, diretories, links, etc. that have the pattern apache-tomcat-X.Y.Z where X, Y, and Z are integers.
find . -regextype sed -regex ".*/apache-tomcat-[0-9]\+\.[0-9]\+\.[0-9]\+"
If you're looking only for directories, use this variant:
find . -type d -regextype sed -regex ".*/apache-tomcat-[0-9]\+\.[0-9]\+\.[0-9]\+"
If you want to search the entire system starting at /, use this variant:
find / -type d -regextype sed -regex ".*/apache-tomcat-[0-9]\+\.[0-9]\+\.[0-9]\+"
You can provide a suitable regular expression to locate in order to do a fast search of your entire system:
locate -b --regex "apache-tomcat-[0-9]+.[0-9]+.[0-9]+$"
As with any use of locate, the file database it uses will need to be sufficiently up-to-date. If you have sufficient permissions, you can do sudo updatedb to force an update.

Resources