Through the years, a number of Linux instructions have been deprecated, both as a result of they’re now not related, have safety issues, or have ceased to be maintained. You may nonetheless have the ability to use these widespread instructions, however you in all probability shouldn’t. As a substitute, attempt alternate options which can be much less susceptible to bugs and supply extra options too.
cron: use systemd or launchd as an alternative
Considered one of my favourite instructions that I realized about way back, cron was nonetheless a irritating device to familiarize yourself with. Its awkward syntax and tricky-to-debug atmosphere made it a problem to work with, so it’s no shock that fashionable alternate options can be found. On Linux, the systemd software program performs many startup-related duties, together with the dealing with of timers.
If in case you have entry to a latest Linux distro, try using the systemctl command to point out all systemd timers:
systemctl list-timers
You may then get extra details about a timer with the standing sub-command:
systemctl standing motd-news.service
The output features a “Course of” line which lists the precise command this timer runs:
On macOS, cron can be deprecated, however its alternative is launchd as an alternative of systemd. Once more, launchd does much more than simply scheduling duties, but it surely does act as a cron improve, with options like higher dealing with of duties that will have to run when your pc is powered off.
ifconfig: ip replaces it
The ip command tells you something you may have to learn about your community connection, together with its IP tackle, path to the general public web, and community gadgets. It’s a low-level device whose full energy you’ll solely actually unlock in case you’re a community or system administrator. For many customers, it replaces the outdated ifconfig device for one goal: discovering your public IP tackle:
ip tackle
After all, you will get the identical data from a website like ifconfig.me, which reviews the IP tackle you ship it, together with different diagnostics. You may even entry it from the command line to see your IP in plain textual content:
However in case you’re debugging a community downside, these choices could also be unavailable, and an area device will all the time be extra dependable than a distant web site that will sooner or later be deprecated too.
nslookup: dig is extra highly effective
The “ns” in “nslookup” stands for identify server, so this device offers an interface to question DNS. dig is similar factor, with extra options and higher formatting. Though nslookup’s standing has flipped a few occasions, to deprecated and again once more, dig is a helpful alternative.
In follow, dig is a drop-in alternative for nslookup: move it a site identify and also you’ll get again the IP tackle (or addresses) that area maps to:
In case you want a very easy device, nslookup will do the job. However as quickly as you need detailed debugging information or extra superior report querying, dig ought to be your first alternative.
neofetch: many successors can be found
Some instructions are so common that, when deprecated, they spawn a slew of replacements. The Neofetch program was answerable for all these colourful ASCII logos you see brightening up Linux terminal screenshots:
Sadly, the tool was retired in 2024, however luckily, there are lots of alternate options. It appears as if each programming language has its personal model of this utility, from Bash scripts to C and Rust.
Fastfetch is the leading contender, presenting a colourful emblem alongside detailed system specs and stats. You may configure the whole lot about its output, from the format to the exact data it reviews, and the way it presents it:
Though many choices exist, fastfetch might be the most effective, not least as a result of it’s actively maintained. Different alternate options, like ufetch or pfetch, have been archived or are now not being up to date. And another instruments might clearly be impressed by fastfetch’s design, however they carry out totally different capabilities; onefetch, for instance, shows abstract information a few git undertaking:
scp: rsync might be a lot sooner
scp—for “safe copy”—is a fast and straightforward command that securely copies files over a network, utilizing an SSH connection. It was an improve to FTP, however is now deprecated in favor of rsync, relying in your required use.
Within the easy case, you should use both device in the identical option to add a file to a distant pc:
rsync foo.txt consumer@some-computer:/path/to/distant/foo.txtscp foo.txt consumer@some-computer:/path/to/distant/foo.txt
Whereas scp works completely tremendous to add recordsdata, rsync is healthier for extra advanced listing constructions that you could be need to add (or obtain) greater than as soon as. As its identify suggests, rsync ensures {that a} distant set of recordsdata and an area set are in sync. If there are variations, it intelligently transfers a set of deltas, slightly than full recordsdata, making it far more environment friendly than scp.
netstat: ss is the improve to succeed in for
The netstat device—brief for “community standing”—is yet one more networking device that’s now deprecated as a result of it was a part of the net-tools bundle. The trendy equal is ss.
netstat reveals open community sockets, routing tables, and different networking statistics. It’s helpful for troubleshooting community issues and checking the efficiency of community visitors.
ss, which belongs to the iproute2 assortment, reveals varied networking statistics. It’s much like ip route, however is out there as a standalone command.
which: sort is a greater possibility
One other facet of Linux that may be tough to get your head round is strictly what occurs once you run a command. For instance, working a command appears pretty easy:
ls
Nevertheless, behind the scenes, one of several things could happen, together with:
- Operating a builtin command.
- Operating a shell operate.
- Operating an executable program.
- Operating an alias, inflicting the method to repeat.
There are a number of instructions that can assist you uncover precisely what’s happening. These embody the next, with descriptions from their man or tldr pages:
- which: find a program file within the consumer’s path.
- whence: a Zsh builtin to point how a command could be interpreted.
- the place: reviews all identified cases of a command.
- whereis: find applications.
- command -v: show the trail to the executable or the alias definition of a particular command.
The whatis command is yet one more one which’s associated to the duty, however with a slight distinction. whatis -d key phrase will present you detailed details about a command (and associated instructions) by looking man pages for key phrase.
These all do just about the identical sort of factor, with slight variations of their output. However the really helpful alternative for which is one other program altogether: sort.
On macOS, the which command is a shell built-in, however my Ubuntu 24 system solely has an executable program, at /usr/bin/which. This program can’t give as a lot data as a shell built-in as a result of it doesn’t have entry to that knowledge. So working “which cd” on Ubuntu offers me no output in any respect, whereas macOS tells me “cd: shell built-in command”.
The sort command, in the meantime, is a builtin. On each macOS and Ubuntu (and some other Linux distro), it ought to let you know precisely what a command is, and the place it’s, if acceptable:
Word that sort additionally helps the identical helpful -a possibility that which does, to point out all cases of a command, not simply the primary:
If the presence of cd as an executable, along with a builtin, appears bizarre to you—it ought to! On macOS, this system is just a shell script that calls the cd builtin, so it’s only a dummy wrapper. That is for POSIX compliance, and also you’ll in all probability by no means want to make use of it.
Source link

