Linux provides tons of command-line utilities to perform various tasks. However, with the passage of time, some of these tools have become outdated and replaced by other alternative command-line tools.
In this guide, we will highlight 6 deprecated Linux commands and alternative tools that you should be using instead. Most of these commands are networking utilities that are provided by the net-tools package which has not been under active maintenance for quite a while now.
Table of Contents
1. ifconfig Command
The Linux ifconfig command is a networking command that views and changes the configuration of a network interface. It displays details about the network interface such as the interface name, ip address configuration, MTU, and hardware address to mention a few. It can also be used to bring down or activate an interface.
The ifconfig command has since been replaced by the ip command, which takes the following forms.
$ ip address OR $ ip addr OR $ ip a OR $ ip link
2. netstat Command
The Linux netstat command is a command-line tool for monitoring a wide array of network statistics. It monitors active network connections, incoming and outgoing connections, routing tables, and listening ports alongside the PIDs of services associated with the listening ports.
The command has since been replaced by the ss command which performs similar tasks.
$ ss -t OR $ ss -l
3. scp Command
The scp command, short for secure copy, has long been used to securely transfer files from one Linux system to another. However, the scp has since been deprecated by RHEL 9 due to a myriad of security challenges. In fact, modern Red Hat distributions are not shipping with scp anymore.
In its place, scp has been replaced by other alternatives such as rsync and sftp.
$ rsync -zvh backup.tar.bz2 /tmp/backups/ OR $ sftp [email protected]
4. route Command
The route command-line tool allows you to view and make changes to the routing table of your Linux system.
The tool has since been replaced by the ip route command.
$ ip route show
5. egrep and fgrep Commands
The egrep and fgrep commands belong to the family of grep functions.
Here is a brief expression of what each command does.
- The egrep command is a pattern-searching utility that prints out lines in a file that match a specific string or pattern.
- The fgrep command searches for fixed character strings in a file or multiple files.
The egrep command has since been replaced by grep -E
while fgrep has been replaced by grep -F
.
6. arp, route, iptunnel, and nameif Commands
Nearly all the networking command-line tools in the net-tools package have been deprecated or replaced by new ones. The arp, route, iptunnel, and nameif have been deprecated and better tools have taken their place.
The commands have been replaced as follows.
- arp – Has been replaced by the ip neighbor (ip n) command.
- route – Relaced by the ip route (ip r) command.
- iptunnel – Replaced by ip tunnel command.
- nameif – Replaced by ip link command.
Conclusion
That was a round-up of some of the commands that have been deprecated and replaced by modern alternatives. It’s worth pointing out that although some of these commands have been deprecated, or are considered outdated, they still work when executed.
Deprecated networking tools such as ifconfig, route, and netstat still provide the desired information when executed. Ultimately, the decision on which command-line tool to use entirely rests with the user.
I am involved with an upgrade from RHEL 7 to RHEL 9.3. We have many ksh scripts that use egrep. I have read the articles saying that “egrep” is deprecated and use “grep -E” instead. However I have done numerous tests under 9.3 and “grep -E” does not behave the same as “egrep” on RHEL 7.
On RHEL 7, for example: egrep “text1 text2” works
--
the string including a space character is successfully matched. But with RHEL 9.3 I cannot get “egrep” or “grep -E” to match that string.@Ron,
I understand your concern about the difference in behavior between egrep and grep -E when matching strings with spaces in RHEL 7 and RHEL 9.3. You’re correct that the deprecated egrep command in RHEL 7 treats spaces as part of the pattern, while grep -E in RHEL 9.3 does not.
Here’s a breakdown of the situation:
In RHEL 7, the following command will match the string “text1 text2” because egrep considers spaces within the quoted pattern as part of the pattern itself.
In RHEL 9.3, the following command is deprecated and might behave differently depending on the specific implementation.
The following command uses the extended regular expressions mode but does not consider spaces inside the quoted pattern as part of the pattern. Therefore, it won’t match the string “text1 text2“.