Believe it or not, you might be using a deprecated Linux command.
Or at least try to use it.
Itβs not really your fault. You are either habitual of using those commands or learned them through old, obsolete tutorials on the web.
This is especially true for networking commands as several of them have been replaced or going to be replaced with newer commands.
In this article, I am going to list a few such Linux commands. You may still find a few of them in your distribution. Itβs possible that your distribution is still providing it for backward compatibility or has created a new implementation underneath or plans to remove it in the newer versions.
But itβs good to know them as an informed Linux user. Here we go!
scp β potentially deprecated
The scp command, short for secure copy, uses the SSH protocol to copy files between two Linux machines. Its biggest USP is that it strongly follows the normal cp command syntax.
This is why scp is hugely popular among Linux users. You know the cp command for copying files from one location to another in the local machine. You use a similar syntax for copying files between machines.
However, the scp command seems to be problematic. The SCP protocol is decades old, hasnβt been updated and has many security vulnerabilities, complained OpenSSH.
This is why distributions are advocating to deprecate it for another command like rsync or create a new version of scp that uses sftp protocol underneath. Red Hat and Fedora have already created a new implementation of scp.
For other distributions, the use of scp remains debatable. Considering the looming uncertainty, it will be wise to start moving to rsync.
egrep and fgrep β Replaced by grep flags
grep, egrep and fgrep. They all sound similar, right? Because they are similar to each other.
The grep is the first and oldest of the lot and it was created decades ago.
egrep and fgrep commands were created a little later to extend the functionality of the grep command.
- The egrep command allows the use of extended regex.
- The fgrep command works on fixed strings instead of regex (default grep behavior).
But why have separate commands when they can be options under the original commands.
And thatβs exactly what happened. The grep command was modified to add new options that provided the same functionalities as egrep (with grep -E) and fgrep (with grep -F).
But the legacy of egrep and fgrep continues even today, unfortunately. Many tutorials, websites and books still mention them. Distributions still include these commands.
netstat β Use other tools for network statistics
The netstat command was an excellent tool for network analytics, both high level and low level.
You could use it to monitor TCP/UDP packets, sockets, see network interfaces and more.
It was part of the net-tools package. Since the net-tools package was deprecated around 2010, distributions stopped adding netstat command.
ifconfig β It will be missed
Truly. This was the go-to command for checking the IP address in Linux systems and other information about the network interfaces.
Youβll still see it mentioned in old forum posts and tutorials. The command got deprecated with the net-tools command.
Itβs functionalities are now found in the ip command. In fact, many of the popular networking Linux commands that were part of the net-tools package were deprecated.
arp, route, iptunnel, nameif β They all went down with net-tools
If you read an old Linux book from before 2010, youβll find the arp, route and other such networking commands that do not exist in your Linux system anymore. You cannot even install them.
Most of them are now replaced by various options of the ip command:
- arp β replaced by ip n
- iptunnel β replaced by ip tunnel
- nameif β replaced by ip link
- route β replaced by ip route
iwconfig β Does it still exist?
Though not part of the net-tools package, iwconfig was similar to ifconfig command but just for the wireless interface.
I can still see it in Ubuntu 22.04 but I have been reading about its deprecation for some time now. Itβs been removed from Red Hat and many other distributions.
iptables β Being replaced by its own developer
The iptables command is the go-to command when you are configuring the routes for NAT and packet filtering for firewalls.
It is still in practice by many Linux users. However, its origin project, netfilter, has created a replacement command called nftables.
Why? because βiptables framework has become a little convoluted with iptables, ip6tables, arptables, and ebtables all providing different but similar functions.β
And thus a new tool to combine them all under nftables. You can read this comparison of iptables and nftables command.
Youβll still find iptables in almost all Linux distributions. But considering that its own developers have created its replacement, it would be wise to start moving to the new tool.
Conclusion
I am not saying to drop the still available but soon-to-be deprecated Linux commands right away. You have learned them through effort and they are part of your muscle memory now.
But since they might be going away soon (or have already gone), itβs better to keep yourself future-proof and look into your custom scripts and notes and update them when you have enough free time.
Since we are discussing replacement commands, let me share an interesting article I wrote last month. Itβs about modern alternatives to the popular legacy Linux commands. bat for cat, duf for du and df and more.
Now itβs your turn.
Tell me which of the above-mentioned old Linux commands you are still using?
Or which ones you have already ditched and moved to their replacements?
The comment section is all yours.