nmtui. But that’s because my router is trash.
ls -al
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
ls
aliases commented out, just waiting for you to activate them if you like.You might like
eza
even 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,
eza
is 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
bat
andrg
all the time, and find them much more suitable for everyday tasks.The mobile site doesn’t have the list. I was so confused.
Ew, sorry. This list is similar and more accessible:
Even better than
rg
isrga
. Indeed, you have a fine list.
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!
Another
ls
alias I’m a fan of isls -latr
which I alias tolt
. It gives you a time sorted directory listing with the most recent next to your cursor (helpful for large directories).
deleted by creator
rsync
I use it to backup important work to an external drive.
Neofetch
let me guess, you either use arch or gentoo
You caught me. (I use arch btw)
sudo pacman -Syu
I just aliased “sudo pacman -Syu && yay -Syu --aur” to “update” cause I got tired of writing it every day.
You can just run
yay
with no arguments and it does exactly what your update script does.Huh, the more you know.
Wouldn’t it make more sense to just yay -Syu to update everything, normal packages and AUR packages?
The reason I did it like this is because:
- I didn’t know yay could invoke pacman
- I didn’t want yay “upgrading” my pacman packages with AUR packages.
But I was just misunderstanding yay. As another comment said before you, one can just run yay without any arguments and it accomplishes the same thing.
Yay doesn’t replace normal packages with AUR packages. Btw It’s not just an AUR helper, it’s a wrapper for Pacman with AUR support built-in. Check out paru btw, it’s a more modern version of yay that basically works the same way: https://github.com/Morganamilo/paru
On my desktop:
df -h
to check disk usagehtop
to see resource usagell
list directory contentsI recently found btop and am trying to use that instead of htop.
looks up btop ooooo
I really like that
cd
command. :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.
cd
is just a built-in command
You’ll love
zoxide
then.deleted by creator
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 notes
from 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
$CDPATH
for a specific session. But again, then a second pane or pushd is already available.Now downvote me, lemmy.
When you set it up you tell it which command you want. Default is “cdi” but I changed it to “cd” immediately.
On arch the command is just
z
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.
xargs
is 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,
dired
along with rectangle-select and multicursors within Emacs is my goto.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.txt
In 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.
rename
is 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 🙌
touch
😏I remember
touch
sudo rm -rf /
Very powerful yet helpful command :-)
The most deceptive joke I’ve seen on this is
sudo rm -fr /
to remove the French language packSomeone has to say this. Don’t do it anyone
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.
Instructions unclear, dick now stuck in computer.
Lp0 on fire
I did this on my personal computer just to prove a point.
pushd and popd to change directory and go back when done there.
Even better when
cd
automatically invokespushd
.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.
what’s your alias?
ll
df -h
du -sch
Ctrl+r
ll
Is an alias for
ls -al
yea?
I set mine to
ls -lAh
sudo
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.
After using too much WINE, I type
pwd
,whoami