theweaselking: (Work now)
[personal profile] theweaselking
Interview question:  "What command would you use to find a file in Linux?"
A: "Locate"
Q:"What if Locate isn't installed?"
A:"Find."
Q: "What if Find isn't installed?"
A:"Grep"
Q: "What if Grep isn't installed?"
A: "Apt-get".

(no subject)

Date: 2011-07-28 09:57 pm (UTC)
From: [identity profile] rbarclay.livejournal.com
Is that even possible on any current Linux distri?
$ apt-cache show grep
Package: grep
Essential: yes
Priority: required

(no subject)

Date: 2011-07-28 10:07 pm (UTC)
From: [identity profile] theweaselking.livejournal.com
I have no idea. It's a hypothetical!

(no subject)

Date: 2011-07-28 10:14 pm (UTC)
From: [identity profile] theweaselking.livejournal.com
Also: You could probably combine the above tools to get something like "sudo find / -n grep -x rm -rf {} \"

Which would make grep awfully hard to use!

(no subject)

Date: 2011-07-28 11:02 pm (UTC)
From: [identity profile] dglenn.livejournal.com
On further reflection, I don't think any of the situations where I lacked 'ls' had grep either. So it turns into using 'echo' with a clever selection of wildcards.

Am I showing my age?

(no subject)

Date: 2011-07-29 02:55 pm (UTC)
From: [identity profile] en-ki.livejournal.com
grep is before ls alphabetically, so you would generally lose it first in the traditional "runaway rm" situation.

Fortunately, /usr/bin/ruby is *way* later.

(no subject)

Date: 2011-07-29 03:17 pm (UTC)
From: [identity profile] dglenn.livejournal.com
Oh, it wasn't a runaway 'rm'. It was a "the boot medium is really too small for the tools" situation. (Not so common with (what's it called, busybox?) on compressed HD floppies like "tomsrtbt", and a lot of systems being able to boot a liveCD instead anyhow, but once upon a time you sometimes had to wade in with little more than sh, fsck, dd, and mount. Or you were booting from a non-random-access device and had too little memory to pre-load all the commands you wanted into a RAMdisk. Fortunate that there's a shell builtin for 'echo'. (If you could successfully mount the partition with /bin on it, you could get grep and ls that way, but if that was the partition, or the drive, that was too screwed up to mount, or if you were seeing what was on which partition to find the one containing /bin, sometimes it was just 'echo' wildcards, and the spooky sound of the desert wind pushing tumbleweeds around in /dev ...

Y'know, I hadn't really thought about those adventures much lately. Suddenly I find myself appreciating CD drives and larger RAM sizes ever so much more, in light of those memories.

(At least I never had to toggle in the bootstrap loader via front-panel switches.)

Profile

theweaselking: (Default)theweaselking
Page generated Jul. 30th, 2025 12:29 am