Skip to content

Comment on Linux Sysadmin/DevOps Interview Questions

Comments

The "simple questions" really reads to me like a proof of the superiority of the gui over terminal. With "how to delete a directory and its content" winning the award.

It could almost read like a wishlist for linux improvments.

Change it to "how to delete the contents of a directory, but keep the directory itself" and it becomes less simple.

But even this can lead to an interesting discussion. From a CLI, there's quite a few things to consider. Do you need sudo? If not, you shouldn't use it, IMO. Is the directory name dangerous? If so, would rm -rf -- help? Does rm support -- as an argument at all? I wouldn't know. And would it always prevent problems, even with truly weird directory names (with spaces, asterisks, slashes, $HOME, unbalanced quotes)? Of course you shell should tab-complete names and correctly escape them, but should you check your shell (brand and version) first if the name is weird, and know what versions have a known problem?

You've just let on that you don't write scripts often. Sysadmins and devops write 'glue'. All sorts of stuff that seems stupid if a human is in direct control becomes quite useful in a script.

For example, what purpose would you have for telling grep not to output the thing you searched for? Not useful for a human operator observing the results, but used all the time in scripts. "if grep -q foo /path/to/target;"...

So, if you're after a person who is going to be writing 'glue', being familiar with how glue 'sticks' is a good thing to look out for.

Are you not a developer? Do you know how to remove a directory and all its contents in, say, Python?

Does it involve a GUI for you?

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.