Over the years, several Linux commands have been deprecated, either because they are no longer relevant, have security problems, or have ceased to be maintained. You might still be able to use these common commands, but you probably shouldn’t. Instead, try alternatives that are less prone to bugs and offer more features too.
cron: use systemd or launchd instead
One of my favorite commands that I learned about long ago, cron was nevertheless a frustrating tool to get to grips with. Its awkward syntax and tricky-to-debug environment made it a challenge to work with, so it’s no surprise that modern alternatives are available. On Linux, the systemd software performs many startup-related tasks, including the handling of timers.
If you have access to a recent Linux distro, [try using…
Over the years, several Linux commands have been deprecated, either because they are no longer relevant, have security problems, or have ceased to be maintained. You might still be able to use these common commands, but you probably shouldn’t. Instead, try alternatives that are less prone to bugs and offer more features too.
cron: use systemd or launchd instead
One of my favorite commands that I learned about long ago, cron was nevertheless a frustrating tool to get to grips with. Its awkward syntax and tricky-to-debug environment made it a challenge to work with, so it’s no surprise that modern alternatives are available. On Linux, the systemd software performs many startup-related tasks, including the handling of timers.
If you have access to a recent Linux distro, try using the systemctl command to show all systemd timers:
systemctl list-timers
You can then get more information about a timer with the status sub-command:
systemctl status motd-news.service
The output includes a “Process” line which lists the actual command this timer runs:
On macOS, cron is also deprecated, but its replacement is launchd instead of systemd. Again, launchd does a lot more than just scheduling tasks, but it does act as a cron upgrade, with features like better handling of tasks that may need to run when your computer is powered off.
ifconfig: ip replaces it
The ip command tells you anything you might need to know about your network connection, including its IP address, route to the public internet, and network devices. It’s a low-level tool whose full power you’ll only really unlock if you’re a network or system administrator. For most users, it replaces the old ifconfig tool for one purpose: discovering your public IP address:
ip address
Of course, you can get the same information from a website like ifconfig.me, which reports the IP address you send it, along with other diagnostics. You can even access it from the command line to see your IP in plain text:
But if you’re debugging a network problem, these options may be unavailable, and a local tool will always be more reliable than a remote website that may one day be deprecated too.
nslookup: dig is more powerful
The “ns” in “nslookup” stands for name server, so this tool provides an interface to query DNS. dig is the same thing, with more features and better formatting. Although nslookup’s status has flipped a couple of times, to deprecated and back again, dig is a useful replacement.
In practice, dig is a drop-in replacement for nslookup: pass it a domain name and you’ll get back the IP address (or addresses) that domain maps to:
If you need a really simple tool, nslookup will do the job. But as soon as you want detailed debugging info or more advanced record querying, dig should be your first choice.
neofetch: many successors are available
Some commands are so popular that, when deprecated, they spawn a slew of replacements. The Neofetch program was responsible for all those colorful ASCII logos you see brightening up Linux terminal screenshots:
Sadly, the tool was retired in 2024, but fortunately, there are many alternatives. It seems as if every programming language has its own version of this utility, from Bash scripts to C and Rust.
Fastfetch is the leading contender, presenting a colorful logo alongside detailed system specs and stats. You can configure everything about its output, from the layout to the precise information it reports, and how it presents it:
Although many options exist, fastfetch is probably the best, not least because it is actively maintained. Other alternatives, like ufetch or pfetch, have been archived or are no longer being updated. And some other tools may clearly be inspired by fastfetch’s design, but they perform different functions; onefetch, for example, displays summary info about a git project:
scp: rsync can be much faster
scp—for “secure copy”—is a quick and easy command that securely copies files over a network, using an SSH connection. It was an upgrade to FTP, but is now deprecated in favor of rsync, depending on your required use.
In the simple case, you can use either tool in the same way to upload a file to a remote computer:
rsync foo.txt user@some-computer:/path/to/remote/foo.txtscp foo.txt user@some-computer:/path/to/remote/foo.txt
While scp works perfectly fine to upload files, rsync is better for more complex directory structures that you may want to upload (or download) more than once. As its name suggests, rsync ensures that a remote set of files and a local set are in sync. If there are differences, it intelligently transfers a set of deltas, rather than complete files, making it much more efficient than scp.
netstat: ss is the upgrade to reach for
The netstat tool—short for “network status”—is yet another networking tool that is now deprecated because it was part of the net-tools package. The modern equivalent is ss.
netstat shows open network sockets, routing tables, and other networking statistics. It’s useful for troubleshooting network problems and checking the performance of network traffic.
ss, which belongs to the iproute2 collection, shows various networking statistics. It’s similar to ip route, but is available as a standalone command.
which: type is a better option
Another aspect of Linux that can be tricky to get your head around is exactly what happens when you run a command. For example, running a command seems fairly straightforward:
ls
However, behind the scenes, one of several things could happen, including:
- Running a builtin command.
- Running a shell function.
- Running an executable program.
- Running an alias, causing the process to repeat.
There are several commands to help you discover exactly what’s going on. These include the following, with descriptions from their man or tldr pages:
- which: locate a program file in the user’s path.
- whence: a Zsh builtin to indicate how a command would be interpreted.
- where: reports all known instances of a command.
- whereis: locate programs.
- command -v: display the path to the executable or the alias definition of a specific command.
The whatis command is yet another one that’s related to the task, but with a slight difference. whatis -d keyword will show you detailed information about a command (and related commands) by searching man pages for keyword.
These all do pretty much the same kind of thing, with slight differences in their output. But the recommended replacement for which is another program altogether: type.
On macOS, the which command is a shell built-in, but my Ubuntu 24 system only has an executable program, at /usr/bin/which. This program cannot give as much information as a shell built-in because it doesn’t have access to that data. So running “which cd” on Ubuntu gives me no output at all, while macOS tells me “cd: shell built-in command”.
The type command, meanwhile, is a builtin. On both macOS and Ubuntu (and any other Linux distro), it should tell you exactly what a command is, and where it is, if appropriate:
Note that type also supports the same useful -a option that which does, to show all instances of a command, not just the first:
If the presence of cd as an executable, in addition to a builtin, seems weird to you—it should! On macOS, the program is simply a shell script that calls the cd builtin, so it’s just a dummy wrapper. This is for POSIX compliance, and you’ll probably never need to use it.