this post was submitted on 23 May 2025
33 points (86.7% liked)

Linux

8409 readers
320 users here now

A community for everything relating to the GNU/Linux operating system (except the memes!)

Also, check out:

Original icon base courtesy of lewing@isc.tamu.edu and The GIMP

founded 2 years ago
MODERATORS
top 19 comments
sorted by: hot top controversial new old
[–] ObsidianZed@lemmy.world 11 points 1 month ago

"Advanced Linux Commands You've Probably Never Used"

ping
[–] DmMacniel@feddit.org 10 points 1 month ago (1 children)

^foo^bar Command – Quick Text Substitution

doesn't work for me (using fish) and is apparantly only available in bash; would you call that then a command?

at Command – Schedule One-Time Tasks

at is also not a built-in but an external tool you have to install first; but its an interesting one.

[–] thingsiplay@beehaw.org 4 points 1 month ago (1 children)

doesn’t work for me (using fish) and is apparantly only available in bash; would you call that then a command?

Right, the ^search^replace is a Bash feature. It is a builtin command, like echo or cd in example. Just because a command is not available to any other shell or if its not an independent program, does not make it not a command (in my opinion).

However I agree its a little bit out of place here. A note that its a builtin and not universally available to every shell would have been nice in such a listing.

[–] DmMacniel@feddit.org 7 points 1 month ago (2 children)

just for the sake of being pedantic: echo is actually a program (just like ls) cd though is indeed a command. And I agree with your last statement.

[–] elmicha@feddit.org 6 points 1 month ago (1 children)

echo is a program, but some shells like Bash and zsh also have a built-in echo. You can run type echo to verify that.

[–] DmMacniel@feddit.org 5 points 1 month ago

whelp... i tried to be pedantic and then got schooled. Thanks :D

[–] thingsiplay@beehaw.org 5 points 1 month ago (1 children)

In Bash echo is a builtin command. The external indipendent /usr/bin/echo is only used by non Bash shells.

[–] DmMacniel@feddit.org 4 points 1 month ago (1 children)

whelp... i tried to be pedantic and then got schooled. Thanks :D

[–] thingsiplay@beehaw.org 4 points 1 month ago (1 children)

Well, you was not wrong though. Because it is both. I just forgot it, so you schooled me too. :-) We can have it all! :D

[–] DmMacniel@feddit.org 4 points 1 month ago* (last edited 1 month ago)

very sympathetic of you <3

[–] thingsiplay@beehaw.org 8 points 1 month ago (1 children)

These lists are always nice. But how does following even fit into the topic of this post at all? These are not underrated hidden gems and most who use the terminal used it already:

  1. > file.txt Command – Overwrite a File

Routing the stdout to a file is one of the most common used "commands" in Linux. And one to learn at the very beginning.

  1. ping -i 60 -a IP_address Command – Ping with a Custom Interval

Probably not that useful in day to day usage, but I assume this is one of the most basic commands lot of people used it in the past to test if they have internet access. ping google.com is common, or so I thought.

Otherwise there are some nice listings, such as at (I really should use that one too), du (actually not that hidden, but its probably underrated and people install lot of tools doing same instead) or yes (useful for certain automation, where you know the answer is to proceed). A solid list, but a little bit short and with a few questionable entries.

[–] kbal@fedia.io 4 points 1 month ago (1 children)

There's someone out there to whom the existence of ping -i 30 is news.

The idea of using >file instead of touch file — or cp /dev/null file if it already exists — is new to me, though it doesn't seem all that useful.

[–] caseyweederman@lemmy.ca 2 points 1 month ago

I've been doing echo "" > file
Useless Use of Echo I guess.

[–] sxan@midwest.social 5 points 1 month ago

Mine you, this page is clearly targeted at an audience who've never opened a shell before; they're all quite common, and it's almost impossible to have spent any time in bash, zsh, or any bash-ish shell without encountering or using these. Also, a couple are not going to work at all in non-standard shells like fish, nushell, or even more common shells like ash, BusyBox, or the venerable csh, because they're bash built-ins. There's dependency on the GNU toolset, too; some of these commands won't work on FreeBSD, even when running bash, because the SysV tools have different argument lists.

[–] kbal@fedia.io 5 points 1 month ago (1 children)

du -sh * | sort -h is a thing I type frequently.

[–] TwilightKiddy@programming.dev 4 points 1 month ago (1 children)

Yea, I love du -hd 1 | sort -h when cleaning up. I absolutely love that I don't need any extra software to quickly locate whatever takes up space. I can do this on any machine without installing anything extra.

[–] caseyweederman@lemmy.ca 1 points 1 month ago (1 children)
[–] TwilightKiddy@programming.dev 2 points 1 month ago

That's a completely different tool, though, no? I just do this for determining when I need to clean up:

df -hx tmpfs

Gives me enough information for this purpose and, again, does not require any additional software, df is part of coreutils.

[–] Eyedust@lemmy.dbzer0.com 3 points 1 month ago

Just thinking of commands I need to learn, and I think chroot is up there. Iirc, you can recover from some extremely bad system states with an ISO and chroot.

I understand the basics of what it does from it's description, I just haven't really dived deep enough to feel comfortable with it.