I just installed Debian Stable
I was looking to use "ifconfig" instead of "ip a" and according to instructions from various web-pages all I need to do is to install "net-tools" in order for to use "ifconfig".
So I installed "net-tools" but "ifconfig" is not working: command not found.
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
installed "net-tools" but still no "ifconfig"
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: installed "net-tools" but still no "ifconfig"
http://forums.debian.net/viewtopic.php?f=16&t=142973
EDIT: to clarify:
So add /usr/sbin & /sbin to your user's $PATH.
For example:
Or just call the full path to the command.
EDIT: to clarify:
Code: Select all
~$ ifconfig
oksh: ifconfig: not found
127~$ sudo which ifconfig
/usr/sbin/ifconfig
~$ /usr/sbin/ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 11782 bytes 1386305 (1.3 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 11782 bytes 1386305 (1.3 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.176 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::2279:18ff:fee7:4069 prefixlen 64 scopeid 0x20<link>
ether 20:79:18:e7:40:69 txqueuelen 1000 (Ethernet)
RX packets 344694 bytes 456190746 (435.0 MiB)
RX errors 0 dropped 1 overruns 0 frame 0
TX packets 104238 bytes 16408037 (15.6 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
~$
For example:
Code: Select all
echo 'export PATH="/sbin:/usr/sbin:$PATH"' >> ~/.xsessionrc
Last edited by Head_on_a_Stick on 2020-10-24 19:05, edited 1 time in total.
Reason: Added clarification.
Reason: Added clarification.
deadbang
Re: installed "net-tools" but still no "ifconfig"
The command "ifconfig" now works from command line at the terminal but if I login over "ssh", "ifconfig" is not working only "/sbin/ifconfig"
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: installed "net-tools" but still no "ifconfig"
~/.xsessionrc only applies to X sessions (hence the name), for SSH you will need to edit $PATH via ~/.profile
To prevent $PATH being bloated out by multiple entries steal Arch's append_path() function and add this to the end of ~/.profile:
EDIT: or just use a simple alias in your shell configuration file (~/.bashrc if you're using bash):
To prevent $PATH being bloated out by multiple entries steal Arch's append_path() function and add this to the end of ~/.profile:
Code: Select all
append_path () {
case ":$PATH:" in
*:"$1":*)
;;
*)
PATH="${PATH:+$PATH:}$1"
esac
}
append_path /usr/sbin
append_path /sbin
export PATH
Code: Select all
alias ifconfig=/sbin/ifconfig
deadbang