(no title)
diarrhea | 2 months ago
One of the primary things shells are supposed to excel at is file system navigation and manipulation, but the experience is horrible. I can never get `cp`, `rsync`, `mv`, `find` right without looking them up, despite trying to learn. It's way too easy to mess up irreversibly and destructively.
One example is flattening a directory. You accidentally git-cloned one too deep, into `some/dir/dir/` and want to flatten contents to `some/dir/`, deleting the then-empty `some/dir/dir/`. Trivial and reversible in any file manager, needlessly difficult in a shell. I get it wrong all the time.
Similarly, iterating over a list of files (important yet trivial). `find` is arcane in its invocation, differs between Unix flavors, you will want `xargs` but `{}` substitution is also very error-prone. And don't forget `print0`! And don't you even dare `for f in *.pdf`, it will blow up in more ways than you can count. Also prepare to juggle quotes and escapes and pray you get that right. Further, bash defaults are insane (pray you don't forget `set -euo pipefail`).
How can we be failed by our tools so much, for these use cases? Why aren't these things trivial and safe?
monooso|2 months ago
diarrhea|2 months ago
The wide-spread use of `rm -rf some-ostensibly-empty-dir/` is also super dangerous, when `rm -r` or even `rmdir` would suffice, but you need to remember those exist. I find it strange there's no widely (where applicable) available `rm-to-trash`, which would be wildly safer and is table stakes for Desktop work otherwise.
Then there's `dd`...
I use terminals a lot, but a GUI approach (potentially with feedback pre-operation) plus undo/redo functionality for file system work is just so much easier to work with. As dumb as drag-and-drop with a mouse is, a single typo can't wreck your day.
donkeybeer|2 months ago
I would agree with the rest, I always have to look up find and xargs syntax.
20k|2 months ago
greatgib|2 months ago
I would double down on advising you to go back learning to use the roots before getting IDE or llm assistant...
diarrhea|1 month ago
The things I want to get done on my computer are so much richer than moving files back and forth in a terminal all day. Simple things should be simple. Tools should enable us. Moving files is a means to an end and these commands having so many sharp edges makes me unhappy indeed.
But yes, of course I am an IDE toddler and cannot even tie my shoes without help from an LLM, thanks for reminding me.
abhinai|2 months ago
xigoi|2 months ago
FeloniousHam|2 months ago
/s (I'm a big fan of fish)
eddyg|2 months ago
000ooo000|2 months ago
cp --interactive
rm --interactive
unknown|2 months ago
[deleted]
alecco|2 months ago
morkalork|2 months ago
Or if you are me, you do `history | grep name-of-command` to find the last time you used it and edit that haha