Oct. 5th, 2012

jbanana: Badly drawn banana (Default)
I know that I have an executable, foo. I think that it may have friends that might be useful. They're probably in the same directory, so let's list them.

On Linux, not too hard:
ls "$(dirname "$(which foo)")"

On Windows, it's a bit harder:
for /f "tokens=*" %G in ('which foo') do dir "%~dpG"

...and you still have to supply your own which - several options for that suggested here: http://stackoverflow.com/questions/304319/is-there-an-equivalent-of-which-on-windows

August 2025

M T W T F S S
    123
45678910
11121314151617
1819202122 2324
25262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 26th, 2025 05:23 am
Powered by Dreamwidth Studios