|

Deprecated Linux Commands You Should Not Use Anymore (And Their Alternatives)

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!

deprecated linux commands

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.

Suggested alternative: rsync and sftp commands.

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.

Suggested alternative: grep -E for egrep and grep -F for fgrep.

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.

Suggested alternative: Use ss 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?

iwconfig

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.

Suggested alternative: Use the iw command.

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.

Suggested alternative: Use the nftables command.

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.

Similar Posts

  • Replacing top, instead using htop. Unless specifically needed (or forced to use it, i.e. Android terminals and embedded/small-footprint installs), htop is much nicer.

  • The commands are not deprecated in the least. They are common commands that are still in use for both Linux and UNIX. Some developers preferred a less traditional method and created IP, but those developers where at best exercising their artistic rights and at worst were ignorant of the UNIX command compatibility that they were breaking. This article sounds like Ubuntu propaganda. Ubuntu has made several severe mistakes in the past when shuttleworth decided on unity and continues to make mistakes with netplan and snapd

    To the author, please do not be misled by those individuals who call these entirely valid commands, “deprecated.” They are not. I encourage you to expand your own horizons and start using the many flavors of UNIX, as well as Linux. Once you start venturing into the larger world, you’ll see that the new commands are poorly suited for the text-based traditions that made Linux and UNIX so successful. A simple comparison between ip and ifconfig output should be enough to show you how broken the “ip” developers thinking was. The scp (and rsync) commands are industry standards for simplicity, reliability, and security.

    A great book on the subject is, “The Art of UNIX Programming,” by Eric Raymond. This book will help the Windows gamers of today understand why the UNIX and Linux scientists of the past, present, and future use the *nixes the way we do.

    And plainly, please stop with the command deprecation propaganda – it’s ridiculous. For this reason, I can’t join the newsletter, as this article is the opposite of a “better, informed desktop Linux user…”

    If anyone needs help on their *nix journey or wants to comment on this post, please join me, The Expat Professor for video training on the “tube”. For over 21 years I have exclusively used Linux as my desktop OS, even when working as a MSFT trainer and MacOS artist. (I believe my first Linux release was kernel version .97alpha, I’ll have to find my dot-matrix printout from the early 90’s)

  • Somehow it is my impression, only systemd is considered linux. What about the users of system v, for example devuan, who do not want swiss army knifes?