How to search in multiple directories in Atom editor - search

I have several folders in my project as the sample structure below.
parent-directory
| sub-directory-1
| sub-directory-2
| sub-directory-3
| ....
| sub-directory-n
While searching for a string in all the files in the parent-directory using Atom editor, it takes a lot of time to fetch the results.
But if the search is limited to a particular folder like 'parent-directory/sub-directory-n' the search time gets reduced considerably.
Now the challenge is that I'm unable to search inside specific folders at once. I tried all the different combinations below, but nothing seems to be working fine.
parent-directory/sub-directory-1;parent-directory/sub-directory-2
parent-directory/sub-directory-1+parent-directory/sub-directory-2
parent-directory/sub-directory-1,parent-directory/sub-directory-2
Please let me know if there is such an option available in the Atom editor.

The issue is your are using the parent directory name also. You need to use the child and path in there. See below screenshot
As you can see I am able to search multiple directory. But I don't use the main folder insomnia in my path

Related

shell script to check if images in a folder are being used by a set of HTML files

Sometime ago I worked in a team that developed a bunch of educational softwares and now they are been reviewed for bugs and updates.
During this process, I noticed that the folder "imgs" accumulated too many files. Probably one of the developers decided to include all the images used by each of the softwares into the folder. However, because there are too many softwares, it would be too painful to check manually all of them (and some of the images are part of the layout, almost invisible).
Is there a way to write a shell script in Linux to check if the files in a given folder are being used by a set of HTML and JS files in another folder?
Go to the images folder and try this
for name in *; { grep -ril $name /path/to/soft/* || echo "$name not used"; }
Im not sure I understood your question correctly,
But maybe this will help you
ls -1 your_source_path | while read file
do
grep -wnr "$file*" your_destination_path ||
echo "no matching for file $file"
# you can set any extra action here
done
in source_path you put director from hi will list all files name and destination where he should searching.
It is not possible to check for the generic case - since HTML and Javascript are two dynamic (e.g. the Javascript code could create the image file name on the file). Likewise, images can be specified in CSS style sheet, inline style, etc.
You want to review the HTML/JS files, and see if possible to identify the tags that are actually used to specify images. This will hopefully, reduce the number of XML tags and attribute names that need to be extracted.
As an alternative, if you have access to the 'access log' of the server, you can find out which images have been accessed over time, and focus the search on images not referenced in the log file.

Exclude all folders with specified name on "Find in Path" in WebStorm

I want to exclude from search results in "Find in Path" window all folders in the project with a name "__tests__". (I know that there is a file mask option but looks like it works only with file names).
How can I do that?
please follow IDEA-130905 and linked tickets for updates.
For now, I can suggest creating a custom scope in Settings | Appearance & Behavior | Scopes with these folders excluded and using this scope in Find in Path

Excluding Files and Folders from dupFinder

I'm trying to use dupFinder to scan for duplications in a .NET codebase. I have certain files and folders that I want to exclude from the scan but I'm struggling to get it working.
The command I'm running is:
dupfinder.exe --show-text --output="dupReport.xml" --exclude="Some.Folder.*;*Resource.designer.cs" MyCode.sln
So what I'm trying to do is:
Scan the MyCode.sln solution.
Ignore all folders matching the pattern Some.Folder.* e.g. Some.Folder.Code and Some.Folder.Tests (these folders are in the root of the repository alongside the solution file).
Ignore all files matching the pattern *Resource.designer.cs in any folder i.e. MyCode.Resource.designer.cs.
I'm sure I'm just doing something wrong but the dupFinder documentation doesn't show an example of using the exclude option.
I have eventually managed to get this working, the conclusion I've drawn is that you can't exclude folders only files.
I think because my original exclude pattern was trying to ignore folders the whole thing wasn't working.
I know this is an old question but I also searched for this.
To exclude complete folders you should use double *
e.g.
--exclude="**\Tests\**;**\Resource.designer.cs"
excludes all Files in all Tests folders and Resource.designer.cs in whatever folder.
Edit:
Tested and still working on JetBrains.ReSharper.CommandLineTools.2020.3.4. Which was the current version when I wrote the answer.
Current version seems to have a bug again and not excluding at all.

how to show contents of the file rather than filename when searching by solr

I have a lot of pdf files (text inside), and I want to build a simple search engine to search the sentences which contains the given keywords. After several hours' searching, I chose solr as the tool.
I am new to solr. I downloaded latest solr 6.5.0 and set it up in windows 7.
I have used the following commands to create a collection called gettingstarted and can search operation by visiting the link http://localhost:8983/solr/gettingstarted/browse
bin\solr.cmd start
bin\solr.cmd create -c gettingstarted
java -Dauto -Dc=gettingstarted -Drecursive -jar example/exampledocs/post.jar *.pdf
However, it only shows the filename which contains the keyword rather than the detail lines of the file. The following picture shows this case:
I also tried the integrated example called techproducts and to my surprise, it can show the exact sentences which contains the keywords. The following picture shows this case:
So I have a question if I can do something to enable the sentences which contains exact keywords show in the first picture. I don't know about velocity, config files and even the underlying principles. I just want it work, giving the detail search results. I do not care about the security issues and also do not care about the way it shows (uglyness is OK).
It is the first day I play with solr, so maybe I made some mistakes about the description. Thanks for your patience. I need your help.
http://localhost:8983/solr/gettingstarted/browse
this is example UI application (solritas )which comes by default with solr.
You should use /select request handler to query, which handles you query and retrieve results.
http://localhost:8983/solr/gettingstarted/select?q=keyword
For Indexing PDF.
when you index pdf, all content inside pdf goes to field called content by default.
Example:
Assuming you created gettingstarted collection already.
Navigate to directory example/exampledocs/ and hit this command.
java -Dauto -Dc=gettingstarted -jar post.jar solr-word.pdf
if it indexed successfully. go to admin and search for keyword inside pdf, it should give content field with value (text inside pdf)
example query request URL
http://localhost:8983/solr/gettingstarted/select?q=solr&wt=json&indent=on

OpenCart - finding files

I am relatively new to OpenCart and need help locating the right files on Cpanel to customize site, most especially the home page. How do I locate a file name using Google Chrome Inspect element on storefront and then find the same file on my Cpanel File Manager? I am most especially looking for the html file on file manager for the home page. I would appreciate any advice.
Let me tell you the correct way.
Lets say your store URL is
http://demo.opencart.com/index.php?route=common/home
There are two parameters after route. They are
1st is folder
2nd is file
3rd is function
Since we know that this is the front end, so we will go in catalog folder in root. If you have to find the file in admin panel, you will check inside admin folder in root.
So http://demo.opencart.com/index.php?route=common/home is basically CATALOG FOLDER / common folder / home.php / function index().
If we have to search something in admin lets say http://demo.opencart.com/admin/index.php?route=catalog/category/add&token=43d61e31aa46a1e66b4bfe63181ebe85 so it is basically ADMIN FOLDER / catalog folder / category.php / function add().
Now if you go through the function, there will be a line at the end something like this.
$this->response->setOutput($this->load->view('common/dashboard.tpl', $data));
This is your tpl file. Go inside the views folder, templates, common, dashboard tpl. This is your desired file.
I know this is an old question, but sometimes it's harder to find what you are looking for in OpenCart.
I have been searching for someting for more than an hour. As it turns out, what I was looking for (PHP CODE), was written in DataBase for whatever reason in this oc_modification table as an XML-ish text.
So if you are having trouble finding some file, it actually might not be a file at all. Actual code snippet could be in DB.
I use opencart 3.x.
Easiest way to find something is by downloading whole project, opening it in notepad++ and using "Find in Files" tab. If you can't find it there, there is a big chance you find it in DB.
Open PhpMyadmin, go to current database for your project, press SEARCH button on top, put wildcard like '%YOURTEXT%', make sure to select "ALL TABLES" and click GO.

Resources