(no subject)
Jul. 28th, 2011 01:04 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
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".
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 05:21 pm (UTC)(no subject)
Date: 2011-07-28 05:32 pm (UTC)(no subject)
Date: 2011-07-28 09:57 pm (UTC)(no subject)
Date: 2011-07-28 10:07 pm (UTC)(no subject)
Date: 2011-07-28 10:14 pm (UTC)Which would make grep awfully hard to use!
(no subject)
Date: 2011-07-28 11:02 pm (UTC)Am I showing my age?
(no subject)
Date: 2011-07-29 02:55 pm (UTC)Fortunately, /usr/bin/ruby is *way* later.
(no subject)
Date: 2011-07-29 03:17 pm (UTC)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.)
(no subject)
Date: 2011-07-28 05:46 pm (UTC)(no subject)
Date: 2011-07-28 05:53 pm (UTC)(no subject)
Date: 2011-07-28 07:26 pm (UTC)And that last answer? Hilarious.
(I was neither the interviewer nor the candidate on this one.)
PS: interviewer and I were having fun:
"ls -R / > list.txt" and then use the built-in search of your editor of choice once the file has been created.
What if you have no text editors?
rsync the entire tree over to a machine that has them.
No rsync?
SFTP.
No network connection?
Boot the machine to a liveCD, and nobody's going to care because no network connection.
No CD drive?
USB.
No USB?
"What is this, a car's engine controller?" followed by "I really hope the file system is small, because it looks like ls -R / |more".
"What if you don't have more?"
"yank the disc and put it in a different computer."
"There's no disk!"
"You're pushing it. Why not just say 'no keyboard'?"
"No keyboard, then!"
"Smartphone emulates keyboard via bluetooth."
"...why is there bluetooth but no keyboard?"
"I don't know, man, this is YOUR system!"
(no subject)
Date: 2011-07-29 02:59 pm (UTC)(no subject)
Date: 2011-07-28 10:55 pm (UTC)[*] Why yes, I have operated in Linux/Xenix/Unix environments where 'ls' was not installed. Though this has become less likely to come up again now that "live CDs" have largely replaced boot floppies.
(no subject)
Date: 2011-07-28 08:22 pm (UTC)(no subject)
Date: 2011-07-28 09:42 pm (UTC)(no subject)
Date: 2011-07-28 10:19 pm (UTC)(no subject)
Date: 2011-07-29 03:04 am (UTC)(no subject)
Date: 2011-07-29 05:21 am (UTC)(no subject)
Date: 2011-07-29 06:27 am (UTC)(no subject)
Date: 2011-07-29 12:46 pm (UTC)(Ouch. Athe, never, ever do that again.)
(no subject)
Date: 2011-07-29 07:52 pm (UTC)findf()
{
local d=$1
local f=$2
local opwd=$PWD
cd $d
if [ 1 = $? ]; then
return
fi
for x in *; do
if [ $x = "." ] || [ $x = ".." ]; then
continue
fi
if [ $x = $f ]; then
echo "$d/$f"
fi
if [ -d $x ]; then
findf $d/$x $f
fi
done
cd $opwd
}
findf / foo
(Yes, this is full of bashisms, but it could be done with any shell.)
(no subject)
Date: 2011-07-30 03:26 pm (UTC)But also wonders what situation you got yourself into that required you to come up with this...
(no subject)
Date: 2011-08-01 04:29 am (UTC)