kattfisk

joined 10 months ago
[–] kattfisk@lemmy.dbzer0.com 2 points 3 months ago

ls -r actually lists entries in reverse order! It needs -R as well.

cp and rm accept either.

Looking at some man pages the only commands I found where -R didn't work were scp and gzip where it doesn't do anything, and rsync where it's "use relative path names".

(Caveat: BSD utils might be different, who knows what those devils get up to!)

[–] kattfisk@lemmy.dbzer0.com 5 points 3 months ago* (last edited 3 months ago)

Not chmod related, but I've made some other interesting mistakes lately.

Was trying to speed up the boot process on my ancient laptop by changing the startup services. Somehow ended up with nologin never being unset, which means that regular users aren't allowed to log in; and since I hadn't set a root password, no one could log in!

Installed a different version of Python for a project, accidentally removed the wrong version of Python at the end of the day. When I started the computer the next day, all sorts of interesting things were broken!

[–] kattfisk@lemmy.dbzer0.com 6 points 3 months ago (2 children)

Aha! I didn't get that you meant the issue was accidentally using -r instead of -R since both you and OP wrote the upper case one.

I'm a lot more used to -R so I instead get caught off by commands where that means something other than recursive :)

I mostly use symbolic mode and honestly don't get why everyone else seems to use octal all the time.

[–] kattfisk@lemmy.dbzer0.com 4 points 3 months ago (4 children)

That's what -R does in chmod as well? I feel like something here is going completely over my head. Or are you-all using another version of chmod?

[–] kattfisk@lemmy.dbzer0.com 4 points 6 months ago

It was sent on a Wednesday, but then lost in the warp for 800 years

[–] kattfisk@lemmy.dbzer0.com 2 points 8 months ago

You really can't though. For several reasons. Which would have been apparent to you had you bothered to actually create your example link to http://аpple.com or to understand this problem.

[–] kattfisk@lemmy.dbzer0.com 1 points 9 months ago (2 children)

This is likely because docker runs Linux in a VM on MacOS right?

We've had similar problems with stuff that works on the developers Mac but not the server which is case sensitive. It can be quite insidious if it does not cause an immediate "file not found"-error but say falls back to a default config because the provided one has the wrong casing.

[–] kattfisk@lemmy.dbzer0.com 1 points 9 months ago* (last edited 9 months ago)

Well completion-ignore-case is enough to solve this particular problem, the other options are just sugar on top :)

I'm going to add completion-prefix-display-length to these related bonus tips (I have it set to 9). This makes it a lot easier to compare files with long names in your tab completion.

For example if you have a folder with these files:

FoobarSystem-v20.69.11-CrashLog2022-12-22 FoobarSystem-v20.69.11.config FoobarSystem-v20.69.12 FoobarSystem-v20.69.12-CrashLog2023-10-02 FoobarSystem-v20.69.12.config FoobarSystem-v20.69.12.userprofiles

Just type vim TAB to see

 ...1-CrashLog2022-12-22   ...1.config   ...2   ...2-CrashLog2023-10-02   ...2.config   ...2.userprofiles
$vim FoobarSystem-v20.69.1

GNU Readline (which is what Bash uses for input) has a lot of options (e.g. making it behave like vim), and your settings are also used in any other programs that use it for their CLI which is a nice bonus. The config file is ~/.inputrc and you'd enable the above mentioned options like this

$include /etc/inputrc

set completion-ignore-case on
set show-all-if-ambiguous on
set completion-map-case on
set completion-prefix-display-length 9
[–] kattfisk@lemmy.dbzer0.com 2 points 9 months ago (2 children)

I and l also look identical in many fonts. So you already have this problem in ascii. (To say nothing of all the non-printing characters!)

If your security relies on a person being able to tell the difference between two characters controlled by an attacker your security is bad.

[–] kattfisk@lemmy.dbzer0.com 1 points 9 months ago

I believe that type of stuff is specified in your locale, so it's possible that it would do the right thing if you've set your language to Turkish. Please try it and let us know though :)

[–] kattfisk@lemmy.dbzer0.com 1 points 9 months ago

If you did it would likely break something as it's one of only two characters not allowed in a file name (the other being null).

You can do a lot of funky stuff within the rules though, think about control characters, non-printing characters, newlines, homographs, emojis etc. and go forth and make your file system chaos!

view more: next ›