4 ms·
Doesn’t command completion cause a disk scan? Which can be a problem if the system is failing in some way and you’re trying to recover.
by bombcar 5y ago
Doesn’t command completion cause a disk scan? Which can be a problem if the system is failing in some way and you’re trying to recover.
- jmclnx 5y agoMaybe in sh type shells. In csh/tcsh commands are hashed, so command completion is in memory. Thus the need for rehash. There is a new setting in tcsh to allow for automatic rehash, but I have it disabled.
- mst 5y agohash -r in bash. No idea if there's a setting, I'm too used to doing the rehash as required to've noticed if there was.
- jl6 5y agoCan you not just avoid activating a completion attempt if you are in that scenario?
- forgotmypw17 5y agoI think it is not as easy as you imply, especially if it is bound to muscle memory. Side note: https://www.google.com/search?q=don%27t+say+just https://www.google.com/search?q=don%27t+say+just
- ed25519FUUU 5y agoWhat percentage of your time do you spend on a shell on a host where the disk is failing and tabbing could cause a catastrophic disk read vs being on a perfectly healthy system where tab complete is a nice feature?
- bombcar 5y agoWhat percentage of your time do you spend logged in as root? ;)
- Hello71 5y agounless you're exclusively running shell built-ins, doesn't running any command at all potentially cause a disk scan
- nyuszika7h 5y agoUsually the shell creates a cache of commands on start, which can be refreshed with `hash -r`.
- yissp 5y agoAs far as I can tell the hash table is initially empty after you first start the shell. At least, that's the case for bash. $ hash hash: hash table empty
- xtracto 5y agoReminds me of the times I've had run out of space in a Linux system. When you SSH to the system and press TAB for command completion, all you get is some message regarding "the system running out of space".