I want to search for a file using file extension and parts of a path name in ubuntu terminal

55 Views Asked by At

I am working in an ubuntu terminal, remotely connected to the supercomputer at university and looking for files with the extension '.pha'.

However, the directory I am in has so much information in it, it takes over an hour to search the first folder and its sub-folders. I know my file should be located somewhere with a path name temperature*/clusters/XMMXCS*/spec/

where * is the wildcard symbol. There are lots of folders beginning with the word temperature, and lots of sub-folders called clusters and spec.

Is there any way I can get the path directory of all '.pha' files with an unclear path extension such as this?

I have tried find /temperature*/clusters/XMMXCS*/spec/ -name '*.pha' and ls temperature*/clusters/XMMXCS*/spec/ and just trying to cd into folders with the same path name, but with no luck.

Thanks!

1

There are 1 best solutions below

2
On

With a bit of chance, the 'super computer' run updatedb once a day (or such), then you can use

locate -ir 'temperature.*/clusters/XMMXCS.*/spec/.*\.pha$'

as far of this is cached, this is quicker than find.