I admit that of the things rm
could be aliased to do, it is one of the safer ones. It’s still bad practice in my book.
palordrolap
Some middle-aged guy on the Internet. Seen a lot of it, occasionally regurgitating it, trying to be amusing and informative.
Lurked Digg until v4. Commented on Reddit (same username) until it went full Musk.
Was on kbin.social (dying/dead) and kbin.run (mysteriously vanished). Now here on fedia.io.
Really hoping he hasn’t brought the jinx with him.
Other Adjectives: Neurodivergent; Nerd; Broken; British; Ally; Leftish
- 0 Posts
- 66 Comments
This breaks the advice to never alias a standard command to do something radically different from its regular function.
Sure, go ahead and alias
ls
to have extra options like--color
, but don’t aliasrm
to do nothing, or evenrm -i
(-i
is interactive and prompts for each file).Why? Because one day you’ll be logged into a different system that doesn’t have your cushioning alias and whoops, bye-bye files.
Now that you think about it, you thought that
ls
output looked weird, but that didn’t actually break anything.As you suggest, yes, look into your OS’s trash option, but leave
rm
alone.GNOME-derived systems can use
gio trash fileglob
(orgvfs-trash
on older systems) to put things in the actual desktop trash receptacle.KDE’s syntax sucks, but it’s
kioclientX move fileglob trash:/
whereX
may or may not be present and is a version number of some kind.You could set up a shell function or script that fixes that syntax and give it any name you like - as long as it doesn’t collide with a standard one. On that rare foreign system it won’t exist and everything will be fine.
This wouldn’t work.
Well, it kind of would if you did
alias downloads="cd Downloads"
but then you wouldn’tcd downloads
you’d just typedownloads
on its own.As other comments here already point out, you can do it with a symlink if you really want it. i.e.
ln -s Downloads downloads
, then you cancd downloads
.Nowhere near the same as making everything effectively case insensitive, but it works for the odd one that you always mistype.
There are ways to patch command completion and/or write a variant
cd
that does the job intelligently too, but those are harder work.Day-late edit that no-one will see: The answer is
bind "set completion-ignore-case on"
. It’s embarrassing how simple this is and how long it took me to find it. I may have been trying to emulate this feature in other ways for a long time.
Surely someone has used the built-in Lisp interpreter to emulate a feature exact
nano
.
palordrolap@fedia.ioto linuxmemes@lemmy.world•You've been formally invited to laugh at me troubleshooting my first issue in Linux.7·22 days agoThis. Way back in the day, I had a sound card that would absolutely not work in one OS unless I’d already booted into a different one and “activated” it with the driver there.
It might have been Win9x and WinNT, but it could just as easily have been Win9x and some early-ish version of RedHat.
But anyway, it would not surprise me to learn that the same sort of thing still happens with some hardware.
Which is the fifth bit? Sticky or setuid?
And either way, with this reckoning
chattr
is somewhere below this picture, and SELinux is bothering the upper mantle.
Also: Ctrl+r then type the part of the command you remember.
MAN: command not found
Don’t shout. He’s shy.
From the man manual page:
man -t name-of-command | lpr -Pps
This dumps the manual page, along with relevant formatting, to the default Postscript-capable printer attached to the system.
There are ways to print all manual pages this way, but you’re gonna need a lot of paper. Bash’s manual page is getting towards 100 pages* and ffmpeg’s runs to nearly 700.
By comparing compressed sizes in
/usr/share/man/man1
and the equivalent page count of those two commands, I reckon my system’s full complement of manuals would be on the order of 35- to 40,000 pages.* Figures obtained by using
man -t name-of-command | ps2pdf - outputname.pdf
to create PDFs instead, then scrolling to the end. I neither have a printer nor want to actually print anything.
I usually set up a completely separate partition on a different drive for Timeshift. That way it doesn’t gradually eat away at system space on the main drive. And even if it was on there, it would have already eaten all that space in readiness, so to speak.
Also, I don’t have it backing up my home directory. I do that separately.
But that said, this post has given me the reminder to see if there are any old snapshots that could do with deleting. And there were a few. It’s now back down to roughly the same size as my main OS install again, which is about as big as it needs to be if you think about it.
palordrolap@fedia.ioto Linux@lemmy.world•Some of the most fun I've had lately: Commodore OS Vision41·1 month agopeople are getting into the old 16/64k OS’es
The operative word is not in that sentence. It’s mostly people getting back into the old systems. i.e. middle aged guys wanting to relive their youth.
There’ll be a handful of curious young people, I’m sure, but it’s mostly old men with disposable income wearing their rose-tinted spectacles. Perifractic is no exception.
LOAD"NOSTALGIA",8,1
Unfortunately, school networks are often set up by people better qualified for teaching other subjects and as such they often leave things open for enterprising, morally undeveloped, children to get their metaphorical tendrils into.
This is how I ultimately ended up being banned from all computers in my school except one. It took them a while to figure out how to do that but I guess it became a priority what with all the “scary” things I was doing.
As I understand it, I was still getting the blame for things after I left.
Whoa. What distro is it that puts everything in /bin, or at least, practically nothing in /usr/bin?
I use a Debian that actually symlinks /bin to /usr/bin so that they’re one and the same (annoying some purists), but even on systems where they are (or were) used for separate purposes, I thought that each had a significant number of commands in them.
(To paraphrase
man hier
, /bin is for necessary tools and /usr/bin is for those that are nice to have.)
Dangit. I always forget about
env
. Yes, that ought to work.
I know you’re joking but:
\sl
orcommand sl
.I’d say “check your shell documentation” but they’re both almost impossible to search for. They both work in Bash. Both skip aliases and shell functions and go straight to shell builtins or things in the
$PATH
.There’s also
/usr/bin/sl
but you knew that.
Using a Debian is like being able to stay in bed in the morning. Heck, someone might even come by and change the sheets while you’re in REM and you’ll hardly even notice.
Everyone else is up and running about like headless chickens fighting dependency wars and system vulnerabilities and cutting themselves on that bleeding edge and you’re hugging xteddy in blissful slumber.
Speaking of which, has he been ported to Wayland?
bind 'set completion-ignore-case on'
might be your friend in Bash. It won’t help in scripts and GUIs though, so you’d still have to deal with that.There are ways to write functions that pick the right option intelligently, but that’s asking for trouble. One day something will create a better match for your guess and then things will go wrong, e.g. your script intelligently turns
downloads
intoDownloads
but then something actually goes and createsdownloads
. Your script chooses the impostor because it’s a better match. Oops.And then there’s always
ln -s Downloads downloads
. That might be enough to confuse that helpful thing that would otherwise createdownloads
. It’s already there, ready for use. And it works in custom scripts and things too. Until you move your script to a different user or machine, anyway.