3 ms·
> On Linux, you have multiple choices (wouldn’t you know?), but the easiest is to enter this in your terminal app: > hostname -I $ hostname -I hostnam
by ajsnigrutin 5y ago
> On Linux, you have multiple choices (wouldn’t you know?), but the easiest is to enter this in your terminal app:
> hostname -I
$ hostname -I
hostname: invalid option -- 'I'
Usage: hostname [-v] {hostname|-F file} set hostname (from file)
domainname [-v] {nisdomain|-F file} set NIS domainname (from file)
hostname [-v] [-d|-f|-s|-a|-i|-y|-n] display formatted name
hostname [-v] display hostname
- brycewray 5y agoInteresting. I used an alternate source[0] to check this and it says the same thing I had in the article. [0]: https://www.tecmint.com/hostname-command-examples-for-linux/ https://www.tecmint.com/hostname-command-examples-for-linux/
- rascul 5y agoDebian's hostname has -I. Turns out that's the hostname I have here on openSUSE. https://tracker.debian.org/pkg/hostname https://tracker.debian.org/pkg/hostname
- Hello71 5y agothere are at least four common implementations of "hostname" on Linux: debian, coreutils, net-tools, busybox, and arguably toybox. there are also at least four implementations of su (util-linux, shadow, busybox, toybox) and five implementations of kill (coreutils, procps(-ng), util-linux, busybox, toybox).
- ajsnigrutin 5y agoYep, net-tools doesn't have the "-I" option
- BenjiWiebe 5y agoDon't forget that the shell usually has a built-in kill as well.