$ z
A great cd alternative
Also $ sudo paru -Syu
I think you can run paru without sudo and it should still do privilege escalation no problem
Seems like an appropriate place to share https://github.com/agarrharr/awesome-cli-apps
I’m a fan of ripgrep and lsd in particular.
Removed by mod
Zoxide, dust, fd, rg, btm, tokei. So many newer Rust tools that are way better than the old stuff.
nmtui. But that’s because my router is trash.
ls -alAnother
lsalias I’m a fan of isls -latrwhich I alias tolt. It gives you a time sorted directory listing with the most recent next to your cursor (helpful for large directories).I learned you can edit .bashrc (in your home dir) and update the alias for ls to include what I like. It has saved me lots of keystrokes. Mine is ‘ls -lha’ in addition to whatever color coding stuff is there by default.
A lot of distros include a .bashrc with common
lsaliases commented out, just waiting for you to activate them if you like.You might like
ezaeven more!You might like lsd even more than that!
Hmm, that’s not working for me. You mean use those as options? ‘ls -eza’?
No,
ezais one of those modern Rust replacement programs. It replacesls.There’s a whole bunch of cool modern replacements. Here’s a handy list: altbox.dev
I personally use
batandrgall the time, and find them much more suitable for everyday tasks.Even better than
rgisrga. Indeed, you have a fine list.The mobile site doesn’t have the list. I was so confused.
Ew, sorry. This list is similar and more accessible:
No, it’s like an ls replacement: https://github.com/eza-community/eza
Aha. Well, I guess I’m not the target audience because I can’t be bothered to go through the installation steps. It’s not in the LMDE repository, but I wish it were!
On my desktop:
df -hto check disk usagehtopto see resource usagelllist directory contentsI recently found btop and am trying to use that instead of htop.
looks up btop ooooo
I really like that
cdcommand. :PHm I wonder, is it really a command? I thought it is just a function of the shell to change the working directory.
A command is anything you execute in the shell.
cdis just a built-in command
You’ll love
zoxidethen.deleted by creator
On arch the command is just
zWhen you set it up you tell it which command you want. Default is “cdi” but I changed it to “cd” immediately.
The command is ‘z’
deleted by creator
It’s in the official docs for zoxide, you are supposed to use the z alias, and many distros just set it up directly like that. I love doing
z notesfrom wherever I am.That doesn’t require a separate package, especially one which uses eval on every new shell. And isn’t messing with my distros or personal aliases (and doesn’t introduce cargo-packaging).
Simply adding one to two (you get the gist) directories and a keybind for
cd ..is more slick. There are cases where you might usepushd .but even then other tooling should already cover your needs.It’s also so easy that you can temporarly append to
$CDPATHfor a specific session. But again, then a second pane or pushd is already available.Now downvote me, lemmy.
I recently learned to use a for loop on the command line to organize hundreds of files in a few seconds.
Example of said Black Magik?
Let’s say, for example, you have a directory of files named x01-001; x01-002; x02-001; x02-002; x03-001… and so on.
I want to create subdirectories for each ‘x’ iteration and move each set to the corresponding subdirectory. My loop would look like this:
for i in {1…3}; do mkdir Data_x0$i && mv x0$i* Data_x0$i; done
I’ve also been using it if I need to rename large batches of files quickly.
Check out
rename$ touch foo{1..5}.txt $ rename -v 's/foo/bar/' foo* foo1.txt renamed as bar1.txt foo2.txt renamed as bar2.txt foo3.txt renamed as bar3.txt foo4.txt renamed as bar4.txt foo5.txt renamed as bar5.txt $ rename -v 's/\.txt/.text/' *.txt bar1.txt renamed as bar1.text bar2.txt renamed as bar2.text bar3.txt renamed as bar3.text bar4.txt renamed as bar4.text bar5.txt renamed as bar5.text $ rename -v 's/(.*).text/1234-$1.txt/' *.text bar1.text renamed as 1234-bar1.txt bar2.text renamed as 1234-bar2.txt bar3.text renamed as 1234-bar3.txt bar4.text renamed as 1234-bar4.txt bar5.text renamed as 1234-bar5.txtIn your second example, it looks like you have an escape character before the first ‘dot’, but not the second one. Is this a typo, or am I misunderstanding the command?
It’s not a typo. The first section of the regex is a matching section, where a dot means “match any character”, and an escaped dot is a literal dot character. The second section is the replacement section, and you don’t have to escape the dot there because that section isn’t matching anything. You can escape it though if it makes the code easier to read.
renameis written in Perl so all Perl regular expression syntaxes are valid.However, your comment did make me realize that I hadn’t escaped a dot in the third example! So I fixed that.
SED combinator, you win 🙌
xargsis also fun, and assuming your for loop doesn’t update anything out of the loop, is highly parallelizableThe equivalent of the same command, that handles 10 tasks concurrently, using
%as a variable placeholder.seq 1 100 | xargs -I'%%' -P 10 sh -c 'mkdir Data_X0%% && mv x0%%* Data_X0%%;'But for mass renaming files,
diredalong with rectangle-select and multicursors within Emacs is my goto.
touch😏I remember
touch
ll
df -h
du -sch
Ctrl+r
ll
Is an alias for
ls -alyea?
I set mine to
ls -lAh
sudo rm -rf /
Very powerful yet helpful command :-)
Someone has to say this. Don’t do it anyone
Instructions unclear, dick now stuck in computer.
Lp0 on fire
Agree. Don’t just copy and paste CLI commands you find on the internet, suggested by a stranger
For reference: https://en.m.wikipedia.org/wiki/Rm_(Unix)
The rm -rf / variant of the command, if run by a superuser, would cause every file accessible from the present file system to be deleted from the machine.
The most deceptive joke I’ve seen on this is
sudo rm -fr /to remove the French language pack
I did this on my personal computer just to prove a point.
After using too much WINE, I type
pwd,whoamisudo
Make me a sandwich.
LambdaRX is not in the sudoers file. This incident will be reported
Eh, guess I won’t get anything for christmas.
pushd and popd to change directory and go back when done there.
Even better when
cdautomatically invokespushd.what’s your alias?
cd -undoes the last cd. Not quite push/popd but still useful. Pro tip, works also: git checkout -Hell yeah. Every one of these threads makes me more inclined to read man pages
You should. These are the actually sources to learn.
- man
- fd
- entr
- rg
- gitui
- nvim
- tee
- cd
- mv
- rm
- ls
- tmux
- htop
- yazi
- du
- xargs
- cat
- less














