Tuesday, May 7, 2024
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 671  / 3 Years ago, fri, september 3, 2021, 3:18:47

I'm trying to become comfortable with the terminal by using it as much as I can. The aspect of my computer usage where I lose most time using command line instead of the gui is when I try to find a song I am interested in.



My music folder is structured like so Music->Bands->Albums->Songs



I often forget what Album a Song is in but I always remember what Band played that song.



I don't search for the song from the Music directory because it takes too long to find a song (I have a lot of music) so I search for the song after I get to the Band directory. Right now in command line I have



# totem /home/user/Music/Red Hot Chili Peppers/


but I forgot what Album the Song "Dani California" is in (totem is a music player in gnome.) The quickest way for me to get around this is to get inside the Red Hot Chili Peppers folder in the file manager gui and hit ctrl+f and type "Dani California".



Is there a way I can search the contents in a directory from terminal while I'm in the middle of writing a command? Or do you have any recommendations on how I can most quickly achieve the same goal I do in the gui from the command line?


More From » command-line

 Answers
2

This is not particularly intuitive as the auto-completion is not working, but you could achieve what you want using file masks:



totem /home/user/Music/Red Hot Chili Peppers/*/Dani Ca*


Another option is use find and then make it pass the filenames it has found to totem:



find . -name "Dani Calif*" -exec totem '{}' +


Though this isn't exactly "search while you're writing a command"


[#43605] Saturday, September 4, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
wheance

Total Points: 314
Total Questions: 96
Total Answers: 112

Location: Benin
Member since Thu, Aug 12, 2021
3 Years ago
;