xdg-open FILE
- opens a file with the default GUI app. I use it for example to open PDFs and PNG. I have a one letter alias for that. It can also open a file explorer in the current directoryxdg-open .
. Should work on any compliant desktop environment (gnome/kde).Saving this thread for later, but I use rsync -a a lot.
cd
thenls
thencd
thenls
maybe I’ll throw ala -a
I use -A instead, which doesn’t show “.” and “…”
GNU Parallel
Going to shamelessly plug my custom bashrc setup which has a ton of little scripting helpers and a few useful aliases. Remember to clone recursively if you want to try it out. (Still very much a work in progress, but it’s getting to be pretty robust)
clear
because apparently I am too scatterbrained to comprehend more than one full page of text in the terminalI almost never use clear because i’m afraid if i will need the text later.(just like infinity tab number on firefox)
Uhhh…
sudo su
Don’t be like me
sudo -i
qalc
I went a little overboard and wrote a one-liner to accurately answer this question
history|cut -d " " -f 5|sort|uniq -c|sort -nr|head -5
Note:
history
displays like this for me20622 2023-02-18 16:41:23 ls
I don’t know if that’s because I setHISTTIMEFORMAT='%F %T '
in .bashrc, or if it’s like that for everyone. If it’s different for you change-f 5
to target the command. Use-f 5-7
to include flags and arguments.My top 5 (since last install)
2002 ls 1296 cd 455 hx 427 g 316 find
g
is an alias for gitui. When I include flags and arguments most of the top commands are aliases, often shortcuts to a project directory.Not to ramble, but after doing this I figured I should alias the longest, most-used commands (even aliasing
ls
tol
could have saved 2002 keystrokes :P) So I wrote another one-liner to check for available single characters to alias with:for c in a b c d e f g h i j k l m n o p q r s t u v w x y z; do [[ ! $(command -v $c) ]] && echo $c; done
In .bash_aliases I’ve added
alias b='hx ${HOME}/.bash_aliases'
to quickly edit aliases andalias r='source ${HOME}/.bashrc'
to reload them.Helix?
Yup! Migrated from VSCodium; wanted to learn a modal editor but didn’t have the time or confidence to configure vim or neovim. It’s been my go-to editor for 2+ years now.
I’ve been using vi (just the basics) for ~4 years, I don’t think I could be arsed to pick up the keybindings the other way around lol. I’ve heard very good things about Helix, of course
Holy shit, you’re a madman
Neofetch
let me guess, you either use arch or gentoo
tldr
because I am too impatient to read through man pages or google the exact syntax for what I want to do.There are exactly three kinds of manpages:
- Way too detailed
- Not nearly detailed enough
- There is no manpage
I will take 1 any day over 2 or 3. Sometimes I even need 1, so I’m grateful for them.
But holy goddamn is it awful when I just want to use a command for aguably its most common use case and the flag or option for that is lost in a crowd of 30 other switches or buried under some modal subcommand.
grep
helps if you already know the switch, which isn’t always.You could argue commands like this don’t have “arguably most common usecases”, so manpages should be completely neutral on singling out examples. But I think the existence of tl;dr is the counterargument.
Tangent complaint: I thought the Unix philosophy was “do one thing, and do it well”? Why then do so many of these shell commands have a billion options? Mostly /s but sometimes it’s flustering.
tldr is the first of 4 ways I rtfm. Then -h, man, and then the arch wiki
i never use man at all. It’s just too confusing.
Sudo !!
It reruns the last command as sudo.
Pretty useful since I’m always forgetting.
Most commands soon followed by sudo !!
Btop is an amazing resource monitor
Have you tried glances?
Never heard of it, looks cool but not as pretty as btop. Also has a ton of information I don’t personally care about so for me it doesn’t seem great.
cd
every single day.You haven’t discovered
exa
? Noob/s
du -sh /too/bar
to get size of files/folders.sudo !!
inserts sudo into previous command when forgotten.yay
for full system update if yay is installed.cat
reads files.