find an executable

osprey

Well-Known Member
Joined
Apr 15, 2022
Messages
1,461
Reaction score
1,507
Credits
14,159
I acquired a computer running debian bookworm.
On running the command "weather" there's a result.
I want to find where the executable is on the system to alter it.
The problem is that I can't find where it is.
Everything I've tried is in the commands below.
It's not in the usual /bin, /usr/bin, /sbin, /usr/sbin.
It's not locateable in the locate database.
What other commands can I use to find it, or how to find it?
Code:
[dav@debl ~]$ weather
Weather report: wellington

     \  /       Partly cloudy
   _ /"".-.     18 °C          
     \_(   ).   ↓ 46 km/h      
     /(___(__)  10 km          
                0.1 mm         
                                                       ┌─────────────┐                                                       
┌──────────────────────────────┬───────────────────────┤  Sat 16 Apr ├───────────────────────┬──────────────────────────────┐
│            Morning           │             Noon      └──────┬──────┘     Evening           │             Night            │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│  _`/"".-.     Patchy rain po…│  _`/"".-.     Patchy rain po…│     \   /     Clear          │     \   /     Clear          │
│   ,\_(   ).   16 °C          │   ,\_(   ).   15 °C          │      .-.      +15(13) °C     │      .-.      +15(14) °C     │
│    /(___(__)  ↘ 46-62 km/h   │    /(___(__)  ↘ 46-68 km/h   │   ― (   ) ―   ↓ 27-47 km/h   │   ― (   ) ―   ↙ 16-27 km/h   │
│      ‘ ‘ ‘ ‘  10 km          │      ‘ ‘ ‘ ‘  10 km          │      `-’      10 km          │      `-’      10 km          │
│     ‘ ‘ ‘ ‘   0.1 mm | 89%   │     ‘ ‘ ‘ ‘   0.1 mm | 75%   │     /   \     0.0 mm | 0%    │     /   \     0.0 mm | 0%    │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘
[dav@deb ~]$ which weather
[dav@deb ~]$ whereis weather
[dav@deb ~]$ echo $PATH
/home/dav/.local/bin:/home/dav/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
[dav@deb ~]$ ls /bin | grep weather
[dav@deb ~]$ ls /sbin |grep weather
[dav@deb ~]$ ls /usr/local/bin |grep weather
[dav@deb ~]$ ls /usr/local/games |grep weather
[dav@deb ~]$ ls /usr/games |grep weather
[dav@deb ~]$ ls /home/dav/.local/bin |grep weather
[dav@deb ~]$ apropos weather
weather: nothing appropriate.
[dav@deb ~]$ locate weather
/usr/lib/python3/dist-packages/youtube_dl/extractor/__pycache__/theweatherchannel.cpython-39.pyc
/usr/lib/python3/dist-packages/youtube_dl/extractor/theweatherchannel.py
/usr/lib/x86_64-linux-gnu/lxpanel/plugins/weather.so
/usr/share/icons/Adwaita/16x16/status/weather-clear-night-symbolic.symbolic.png
....
 


LOL That's because it's an alias. That weather "app" isn't an app at all. It's an online thing. It's likely aliased - in your ~/.bash_aliases is where it should be.

I actually wrote about it in an article a while back.

 
Thanks KGill. I found it in the .bashrc. Hadn't thought to run the command "alias" which would have found it, so thanks for that.
 
G'day @osprey and welcome to linux.org from DownUnder :)

You can actually even sometimes drop the State, for example with David G.'s @KGIII 's example

curl wttr.in/rangeley

will produce an output.

It can be a 3 - 4 day forecast.

I was about to respond but my friend beat me to it.

Cheers

Chris Turner
wizardfromoz
 
'Snot a problem. See the article for more choices.

I also strongly suggest using .bash_aliases instead of putting things into the .bashrc. If something goes awry, it's constrained to the aliases file. They're also more portable, meaning you can take them from OS to OS. The .bash_aliases file I am currently using is at least a decade old - having been updated over the years but keeping things consistent between operating systems.
 
Also, I could see why that'd be frustrating. If I hadn't known already, I don't know that I'd have thought 'alias' at first. I just happened to know from the article and 'cause I use it from time to time.
 
Thanks KGill for the heads up on .bash_aliases. On reading your link I can see that that was probably the source for this alias.
Thanks for the welcome wizardfromoz.
 
After all the hunting through directories and being perplexed, I found the command that does the job:
Code:
[dav@debl ~]$ type weather
weather is aliased to `curl wttr.in/wellington'
It's the bash builtin "type".
 

Staff online

Members online


Top