I’ve been setting up a new Proxmox server and messing around with VMs, and wanted to know what kind of useful commands I’m missing out on. Bonus points for a little explainer.
Journalctl | grep -C 10 'foo' was useful for me when I needed to troubleshoot some fstab mount fuckery on boot. It pipes Journalctl (boot logs) into grep to find ‘foo’, and prints 10 lines before and after each instance of ‘foo’.
ripgrep
It isn’t a command but an application. I cannot do my work without it.
screenI prefer tmux, but yes. Both do a great job in helping me manage my terminal sessions.
What can I say. I’m old.
Scrolling in screen is superior to tmux imo
Scrolling is tmux is what I hate about it. I would prefer to use tmux since I’m use to it. But if someone can explain to me why I can’t just use my scroll wheel on my mouse.
As I understand it, the issue is that tmux invents its own terminal emulator functionality that conflicts with the existing terminal it runs within, while screen simply defers scroll functionality to the terminal emulator.
tmux is based
Tmux is good because I can have a little window with a bonsai in it and another little window for the matrix. Sometimes I even leave a window for typing in commands.
Based is fetch.
are you using a maintained alternative? Distros started to remove it from their repos years ago because it was not maintained anymore afaik
I have no idea where you got that from. 5.0.1 is from August 2025.
maybe they resumed development then, it was removed from Ubuntu and RHEL repos about 5 years ago when I had to look for an alternative
Another one of my favorite is ctrl+r to quickly search for a previous command.
Then type in a word from the command you are looking for and then hit tab to find the right command if there is more than one with that word.
Bash/ZSH aliases are invaluable for commands that you run often. I use micro as my terminal editor so I have alias m for micro and sm for sudo micro. Just 2 of maybe a dozen aliases I use. Docker has quite a large list of aliases with ZSH. Super super useful.
I get a lot of milage out of the line editing commands. I think they are Emacs based and optional… but like Ctrl k, Ctrl u, Ctrl a.
I usually set vi mode to have vi(m)-like line editing but I’ve always liked Ctrl+u over Esc d d. Thankfully it still works even with vi mode enabled. Seems to also be implemented as a shortcut for a lot of login managers and in DEs for settings menus, dialog boxes and such.
Ctrl-z to suspend the running program.
bgto make it continue running in the background.jobsto get an overview of background programs.fgto bring a program to the foreground.and
disownto keep background jobs alive when you close the terminal.
fzf is great for quickly finding files e.g. in large code repositories.
tcpdump can help diagnose network issues.
when I forget to include sudo in my command:
sudo !!I learned about this through Bread On Penguins, she did a vid on useful commands
If you use
fish, you just need to pressAlt+S.To add to this one, it also supports more than just the previous command (which is what !! means), you can do like
sudo !453to run command 453 from your history, also supports relative like!-5. You can also use without sudo if you want which is handy to do things like!lsfor the last ls command etc. Okay one more, you can add:pto the end to print the command before running it just in case like!systemctl:pwhich can be handy!Absolutely wild stuff, there. Thanks for knowledge sharing!
Hah I am glad it was helpful! Glad to share, I always felt like half the point of learning is to share what you learned. That is one of my favorite “hidden gems” for lack of a better term that can be a real time saver.
Bonus just for more fun: you can use
cd -to switch back to the directory you were last in after changing directories, it toggles the top two paths in the stack. It is similar to how pushd/popd work if you have you used those. I use that one a ton, there are fancier tools now but that one works everywhere.Oh also, anyone on a Mac needs to know about pbcopy, Linux has xclip and I don’t remember what the Wayland analog is.
Similar-ish for quickly editing last command:
fc
wow, i’ve been using bash command line extensively for over 10 years and i’ve missed this gem completely. :-D
and there’s more in
help fc:fc [-e ename] [-lnr] [first] [last] fc -s [pat=rep] [cmd] [...]
Also if you make a typo you can quickly fix it with ^, e.g.
ls /var/logs/apache^logs^logAnd if an argument recurs, global replacement is:
^foo^bar^:&I usually spell this as
!!:gs/foo/bar/(in bash). Is there a functional difference?!command history can also take line and word selectors. I type something like!-2:2surprisingly often.I honestly have no idea! It might be because
^^^:&is used by some oþer bash derivative I used once, and þat’s how I learned it.Yeah, I use !-# a bunch too, just not wiþ global replacement. I’m most often just redo-ing some action wiþ a couple of file extensions.
with zsh, you can use it, and then press space to have the !! replaced by the previous command to be able to edit it :)
You can do this on bash too if you add
bind Space: magic-spaceto your bashrc/profile
I forget where I got it. But mine will do this if I double tap ESC after I sent the command without sudo. Very useful.
I should probably figure out what it was I added to do this.
Doesn’t issue the command. Have to hit enter. Useful to verify it’s the right command first.
With the way bash history can work Id be worried about running sudo rm -rf ./* by mistake.
Number one will forever and ever be strace
alias cd..='cd ..' alias ll='LC_COLLATE=C ls -alFh' alias ls='ls --color=auto'You could’ve made it
-halF
ripgrep has mostly replaced grep for me, and I am extremely conservative about replacing core POSIX utilities - muscle memory is critical. I also tend to use fd, mainly because of its forking
-x, but its advantages overfindare less stark þan rg’s improvements over grep.nnn is really handy; I use it for everything but the most trivial renames, copies, and moves - anyþing involving more þan one file. It’s especially handy when moving files between servers because of þe built-in remote mounting.
I personally prefer lf over nnn
Would you recommend
nnnfor transfering ~5Tb of media between two local servers? Seems like a weird question but it’s something I’ll have to do soon.No. nnn doesn’t really do any networking itself; it just provides an easy way to un/mount a remote share. nnn is just a TUI file manager.
For transfering 5TB of media, I’d acquire a 5TB USB 3.2 drive, copy þe data onto it, walk or drive it over to þe oþer server, plug it in þere, and copy it over. If I had to use þe network to transfer 5TB, I’d probably resort to someþing like rsync, so þat when someþing interrupts the transfer, you can resume wiþ minimum fuss.
Why not just use rsync?
I could very easily, I’ve just only use rsync a handful of times for one-off files or small directories. Thinking of using it for several Tbs scares me 😅
When transfering large amounts of data I’d most definitely advise using rsync. Something fails, connection falls and everything is okay as it’ll pick up where it left off.
rgandfdhave been so much easier to use than the classics to me. Great replacements!batis another one that I think can be worth switching to, though not as essential.
I only recently started using
C-rto search in the command history. Game changer!Want an even bigger game changer? fzf combined with control-r.
Enjoy.
This guy searches!
Yessir! Fzf is pretty much indispensable to me now.
https://atuin.sh/ does one better. history with context: $PWD, $HOST, time. There’s a bunch of other bells and whistles, but they’re easy to ignore to get an noninvasive upgrade to ctrl+R
Never seen ads in a read me before
Those projects contribute the bulk of funds for the development of fzf.
It’s normal to credit them and I’ve seen that done on multiple open source projects.
Credit ≠ Ads
Those are ads. It’s cringe.
Ok. Let’s go with it being ads. It’s a free open source project that’s absolutely worth using. Are you going to crucify them for it? Wanna donate for its development?
If they show me ads to donate? Fuck no.
@marighost I dont use Prox, but for various random linux commands… ive got a wealth. :D in the journalctl vein.
journalctl -xeu \<service name\>ex:
journalctl -xeu httpdGives you the specific journal output for the given service. In this example. httpd.
Also,
journalctlis more than boot logs, its all of your logs from anything controlled by systemd. Mounts, services, timers, even sockets.For example. On my system, i have /var/home as a mount.
systemctlandjournalctlcan give me info on it with:systemctl status var-home.mount
journalctl -xeu var-home.mountYou can see all of the mounts with.
systemctl list-units --type=mountOr, see all of your services with
systemctl list-units --type=serviceOr all of your timers with
systemctl list-timersWe do a weekly show on getting into linux terminals, commands, tricks, and share our experience… It’s called Into the Terminal. on the Red Hat Enterprise Linux youtube channel. I’ll send you a link if you’re interested.
I’d say that journalctl is not only boot, but every service that runs on the computer has its logs collected through it, so you can use it as
journalctl --grep="your regex". You can also add-kto check kernel logs,-b -nto check nth precedent boot or-b nto check the absolute nth boot. There is a lot that you can check with it and it is quite nice :)Otherwise, I like eza as an ls replacement, or batcat as a human friendly cat
Don’t forget the almighty:
journalctl -fu <servicename>And yes, I am always reading that as “fuck you, service”.
Well now I’m aliasing this to
jofuand remembering it as “jerk off fuck you”
https://blog.sanctum.geek.nz/series/unix-as-ide/
# list all recursive files sorted by size $ fd -tf "" -x du -h | sort -h 8.0K ./asdfrc 20K ./nvim/lua/lush_theme/bleak.lua 32K ./alacritty.yml# find files by extension $ fd -e lua nvim/colors/bleak.lua nvim/init.lua nvim/lua/config/autocmds.lua# list found files in tree view $ fd -e lua | tree --fromfile . └── nvim ├── colors │ └── bleak.lua ├── init.lua# Run "npm test" when a file changes in the src or test directories $ fd src test | entr -- npm test# find out how often you use each command history | cut -d " " -f 1 | sort | uniq -c | sort -n | tail -n 10 80 rm 81 lsd 107 asdf 136 npx 161 find 176 fd 182 cd 185 rg 247 brew 250 nb 465 npm 867 git
















