1

In most editors it's possible to perform a search within the open folder/project. How can this be achieved with Code in Juno, if at all possible?

1

I don't think the feature exists in Code yet. However, a simple workaround is:

  1. Right-click the folder / project, select "Open in" > "Terminal"
  2. Type in the command: grep -Ril "text to search for" .

That will list all the files containing that text. Some notes:

  • . Means search from the current folder
  • -R Searches recursively, not just files in the current folder
  • -i Searches case-insensitively
  • -l Prints just the file names, not showing the line of text it's in

Update: If you want to then open the files in Code, add `pwd` to the end, which will print out the full paths of the files. Then use the names like io.elementary.code filename to open it in Code.


If you need to find files with a particular name, you can use the same method to open the folder in Terminal, then run the following command:

  1. find . -name '*part of name*' -print

If "part of name" is for example "list", that will match files named "todo list.txt". You can also use the following flags:

  • -type d To search for only directories (folders)
  • -type f To search for only files
  • Thanks Dane, but I moved away from elementary OS. There were so many issues with Juno, it was relly disruptive for my workflow. In the meantime I switched back to Pop!_OS, and smooth sailing ever since. – wout Nov 27 '18 at 14:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.