Re:There are real reasons for Linux to replace ifconfig, net...
by amyjess on Friday May 25, 2018 @11:38AM
(#17154728)
You may also want 'whereis' instead of 'which'.
I use cope to colorize my output, which makes 'which' useless to me for most common commands, but 'whereis' still works.
Edit for examples:
$ which ip
/usr/share/perl5/vendor_perl/auto/share/dist/Cope/ip
$ whereis ip
ip: /usr/bin/ip /usr/share/perl5/vendor_perl/auto/share/dist/Cope/ip /usr/share/man/man7/ip.7.gz /usr/share/man/man8/ip.8.gz
Re:There are real reasons for Linux to replace ifconfig, net...
by twic on Tuesday May 29, 2018 @01:42PM
(#17181325)
In bash, there's also:
command -V
Which knows about aliases and functions as well: $ command -V ip
ip is /sbin/ip
$ command -V ll
ll is aliased to `ls -AlF --color=auto'
$ command -V command_not_found_handle
command_not_found_handle is a function
command_not_found_handle ()
{
if [ -x /usr/lib/command-not-found ]; then
/usr/lib/command-not-found -- "$1";
return $?;
else
if [ -x /usr/share/command-not-found/command-not-found ]; then
/usr/share/command-not-found/command-not-found -- "$1";
return $?;
else
printf "%s: command not found\n" "$1" 1>&2;
return 127;
fi;
fi
}
Re:There are real reasons for Linux to replace ifconfig, net...
by 8_hours_ago on Friday May 25, 2018 @04:53PM
(#17157879)
> whereis
Thanks for this! After 14+ years of using Linux almost daily, I had never heard of this command. I learned something new today, so now it's time to go home!
Re:There are real reasons for Linux to replace ifconfig, net...
by ssebastianj on Friday May 25, 2018 @06:21PM
(#17158547)
Yeah, I recently "discovered" the commands 'whatis' [0] and 'apropos' [1] and my experience learning Linux improved quite a bit.
Re:There are real reasons for Linux to replace ifconfig, net...
by cjcampbell on Friday May 25, 2018 @10:44PM
(#17159892)
Thanks for passing those on as well!
> $ which ip
> /sbin/ip
> $ dpkg -S /sbin/ip
> iproute2: /sbin/ip