20

How would you test a developer that claims to have *nix shell experience (just to be clear, we don't want to test if someone can develop on *nix, only that they know their way around the command line).

I was thinking about making them solve a problem of getting information out of log files, which would involve some basics like cat, grep, cut, ... combined with piping.

What other basic knowledge would you ask for? Once again, this isn't for interviewing someone who will develop for *nix systems, and also not for *nix system admins, but just for regular developers that sometimes need to do some work on a *nix system.

  • That kind of shell training is cake for any person who already knows a programming language. Since when do people care if interviewees make the truth seem a bit more pleasing in their resumes? It happens all the time. Sounds petty to me. – Yam Marcovic Sep 29 '11 at 00:07
  • @YamMarcovic - When you say "make th etruth seem a bit more pleasing", are you saying "claiming levels of skill they do not have"? If you are, I'd say that's pretty relevant to find out during the interview. If they lie to get through the door, how can one trust them once inside? – Vatine Nov 23 '11 at 17:25
  • @Vatine Because at least from my experience, everybody over-exaggerates their skill-levels in resumes. If you disqualified those people, you're narrowed down to hiring dogmatically honest, or naive people. That's a lot less options. – Yam Marcovic Nov 23 '11 at 17:44

12 Answers12

14

From my personal experience developer working on an *nix system needs to know:

  • shell variables (how to set/get + knowledge about special ones like PATH)
  • shell redirection (capturing output of an program)
  • pipes (extracting some information from log file is an excelent example)
  • process control (ps, nice/renice, kill)
  • file access rights (ls/chmod/chown/chattr)
  • users (but mostly in context of files/processes, ie: is this process able to access this file? why it can/can't?)

...and as a bonus:

  • starting/stopping system services

Such a skill set allows to do most developer related tasks with ease.

Jacek Prucia
  • 2,264
  • 1
  • 17
  • 15
11

From my experience with my numerous colleagues since I started to work, nobody wants to fake Unix knowledge: either they "know their way around the command line" or they simply say "no way!".

Just ask if the candidate is willing to work on a Unix workstation and let him tell you how far he can go through bash. He will eventually name some commands; the most obvious ones are cd, cat, more or less, vi or emacs, grep, awk, sed. Listen carefully whether he mentions man.

If it is for developing, he should be familiar with make and Makefiles, and some source control command line interface (svn, git, cleartool, hg, cvs...)

mouviciel
  • 15,473
  • 1
  • 37
  • 64
  • 5
    I know about `man` and I use it whenever Google doesn't help, but I'd never bring it up on my list of commands... – user541686 Sep 28 '11 at 09:44
  • 3
    `man` is the most efficient way to learn about unix command line and C libraries when you are offline. By the way, I learned Unix when the most advanced tool for searching internet was `telnet archie.cs.mcgill.ca` – mouviciel Sep 28 '11 at 09:51
  • 1
    Obligatory http://xkcd.com/293/ http://xkcd.com/456/ http://xkcd.com/434/ – user541686 Sep 28 '11 at 09:56
  • @mouviciel: It's also the most efficient learn to way about the unix command line when you are *online*, since most forums will 'helpfully' tell you to rtfm if you ask them details about the commands. This should be okay if the man pages weren't incredibly convoluted and hard to navigate documentation. Luckily there's stackoverflow! – Joren Sep 28 '11 at 11:22
  • I don't know about that. I use man pages excessively and I've never had any problems with it once I got used to it. It's a piece of cake to find what you're looking for. You have sections, you have "See Also"'s, and you can search the whole thing with the click of a button. You get a man page for every command and every syscall, and quite a few library calls. I'd say man pages are what makes me love UNIX so freakin' much. – Yam Marcovic Sep 28 '11 at 23:57
  • Also, instead of Googling straight away, try "man -k" or "apropos" with a keyword. – Yam Marcovic Sep 28 '11 at 23:58
  • About `man`, may I suggest to check that question: [Tricks and tips for finding information in man pages](http://unix.stackexchange.com/q/1841/1383)? – mouviciel Sep 29 '11 at 07:36
  • funnily enough on my windows machine i'll often google "man x" to find help on cross platform program e.g. man hg – jk. Sep 29 '11 at 11:19
10

Why do this?

The *nix shells (and other OS shells, fwiw) are very deep and broad working environments. It's possible for somebody to spend years working there and use only a very small % of the shells' capacity.

If you don't expect the person to a) shell program, or b) administer the system from the shell, then why does it matter? Anything that gets done will be at such a basic level that a handy *nix cheat sheet will more than compensate for the "lack of skills".

Joe Internet
  • 944
  • 1
  • 6
  • 11
  • It's an honesty check. If someone puts unix experience on their resume (which we don't really require), I want to be able to check what those claimed skills are. If you're just able to use cd and ls, you shouldn't be claiming unix experience imo. – Christophe Vanfleteren Sep 28 '11 at 14:53
  • Well, I'd then ask them what Unix systems they used and have them list differences between Unix systems and probably Linux/Mac – johannes Sep 28 '11 at 15:11
  • 1
    @Christophe - Well, here's the deal... it doesn't matter, because they probably won't work for you. It's a major red flag for an interviewee when the potential employer starts pulling silly stunts like this because they don't trust what's on the resume. Your "test", and your justification for it, is basically saying that you're trying to hire somebody to work a shit job at a shit company. I may be wrong, but I'm guessing that I'm not. However, if I am wrong, I suggest that you re-evaluate your "expectations". – Joe Internet Sep 28 '11 at 23:12
  • Um, how does it say that? I would actually say it's a waste of time for the interviewer and against his interests. Learning how to interact with the shell at that level is at most a month's practice. But anyway, it doesn't say anything about the nature of the job or the company, except that it relies on UNIX for at least some of its projects, and it expects its developers to be able to.. well, develop properly on that environment. – Yam Marcovic Sep 29 '11 at 00:04
  • 1
    @Yam - It says it like this... if you're hiring and somebody sends you a resume that you believe is contrived, you just don't interview that person. What you _don't_ do is create some silly test that a) you admit has no bearing on the position's requirements, and b) admit that is only designed to test the "honesty" of somebody's claimed experience. If somebody can't even get an interview at OP's company without having their "honesty" questioned because they said that they've used the *nix shell, what does that say about the company? To me, it says shit job at shit company. YMMV. – Joe Internet Sep 29 '11 at 01:54
  • @Joe: I can assure you, shitty jobs at shitty companies have nothing to do with this. Actually when interviewing I'm much more cautious with a company that doesn't feel the need to test you before hiring than one that doesn't. And as a circus director, would you hire a juggler without seeing them juggle? See Reg Braithwaite at http://weblog.raganwald.com/2006/07/hiring-juggler_02.html. – Christophe Vanfleteren Sep 29 '11 at 05:34
  • 1
    @Christophe - If you're hiring capable *nix programmers, IMO it's fair to assume that they "that they know their way around the command line". If you're hiring capable other-OS developers, IMO it fair to assume that their *nix command lines skills are minimal. Group A doesn't need to be tested, group B gets an automatic fail, so why bother testing them, either? If your criteria for hiring a software developer is based on how well they use the command line, well, I think that your hiring process is flawed. It would be different if shell scripting was the main responsibility of the position. – Joe Internet Sep 29 '11 at 09:57
  • @Joe - No, hiring is partially based on how honest someone is with the skills they list on their resume. I just want to be able to assess someones claimed skills. I'm not going to fail/not hire someone because they don't have the unix skills that they don't claim to have (and I wouldn't be testing for them anyway), but I wouldn't want to hire someone that fails on a test for skills they *do* claim to have. – Christophe Vanfleteren Sep 29 '11 at 11:11
  • @JoeInternet You need to be able to make the distinction here. Just because the interviewer might be wasting his time, doesn't necessarily mean anything about the nature of the job itself. You're exaggerating. – Yam Marcovic Sep 29 '11 at 12:28
3

Out of the top of my head I would probably ask them two things:

  1. When you used the *nix commandline before, did you encounter a case, in which a well thought-out command saved you a lot of time? If so, elaborate.

  2. Please explain the major differences between the *nix commandline and a standard Windows desktop. What are advantages and disadvantages of each?

Clearly, the first will give you an indication of how deep the applicant's knowledge about the commandline goes. If he worked for years on a *nix, he won't just tell you that he was proud to have run a grep. Don't expect them to remember the exact commands of course (there's always manpages for that), but the general idea of what they did.

The second question instead checks if they understand what the commandline is really good at and for what it's not a suitable tool. It's easy to learn to use a hammer, but much harder to switch to another tool in case the hammer is unsuitable. So this question gives you a good indication of the applicant's view outside of the *nix box, plus it is open enough so that he can (and should) score with his knowledge. (Nothing worse than answering something like "uh.. windows has those windows")

Frank
  • 14,407
  • 3
  • 41
  • 66
2

Depends of what you want them to do.

For getting information out of log files your suggestion for cat+grep makes perfect sense. I'd add ls, cd and less/more to that.

If you expect them also to do some minor edits (say, in config files), then it would make sense to add testing for vi and/or emacs and for stuff like cp/mv/rm/mkdir.

gnat
  • 21,442
  • 29
  • 112
  • 288
  • 1
    testing of vi commands, sheesh, I'd be more worried if they knew them all – NimChimpsky Sep 28 '11 at 07:08
  • 1
    well if the guy reaches for Google and starts typing in search field stuff like "[vi Editor commands](http://www.cs.rit.edu/~cslab/vi.html)" then I'd consider testing passed 90% :) – gnat Sep 28 '11 at 08:09
1

I'd recommend that they know emacs or vi/m, tar, sed, e/f/grep, the various compilers, some shell scripting. Perhaps run a test where they have to use these tools to grab some code from one file without opening it, insert it into another program; then compile the program which will break on some trivial error. They then need to use a text editor to go in and find the error, get the code working and archive the binary. Then mail it somewhere whilst giving permissions to the recipient to run it.

1

I don't know about you, but I'd get kind of annoyed if my interviewer asked me and I didn't know how to work on Linux.

You shouldn't really care about what they know right now, but what they can learn if given the chance. Learning *nix tools isn't too hard but it takes a little bit of determination -- you should really test for the ability rather than the knowledge.

user541686
  • 8,074
  • 8
  • 38
  • 49
1

It depends on what level of experience you want them to have. IF this isn't for someone who will develop for *nix systems, and also not for *nix system admins, but just for regular developers that sometimes need to do some work on a *nix system, how much experience do they actually need?

Anything such a developer might need in *nix shells (ls, chmod, cat etc.) could probably be written on a single page cheat sheet. If so, requiring *nix shell knowledge where it is not required might eliminate some good candidates.

0

I usually pick a simple task and ask the person to write a shell script on a whiteboard.

"You have a directory "foo" and a backup directory "foo_backup". Write a shell script to see what has changed in "foo" since "foo_backup" has changed.

Scott C Wilson
  • 3,908
  • 20
  • 25
0

'Explain the login process in Linux, with as much detail as you feel comfortable' is a good question. The login process happens to involve switching users, permissions and ownerships, and lots of general Unix philosophy. If they can clearly explain the how and the why there's a /etc/passwd and /etc/shadow, and how a non-prived user can change their own password but not others', that means they 'get' Unix.

Another good one is anything with log parsing, or quick security audits. If they can add up total bandwidth served out for a particular vhost out of an Apache log, or find if there are any other users in the system with a uid of 0, they're handy on the commandline.

And one thing to NOT do to them: do not make them do it on paper/whiteboard. Give them a live system (but no internet because that's almost cheating), and watch them go. If they know their way around man pages and can build multi-pipe expressions on the fly, that's a good sign. If they need google for everything, then their skillset is questionable.

Marcin
  • 181
  • 5
0

why make them write a functional program ? what's wrong with saying "tell me the difference between grep and sed, or what does X command do ? etc . that way, you can lead them around a little.

if they fumble on the specific assignment you give them, you might not think they're smart. but if you ask general questions, you give them the chance to show you what they do know, which may be substantial but in a different way than what you were wondering.

Timmah
  • 345
  • 1
  • 3
-1

Unix gurus have core commandline commands such as sed, grep etc. in one finger and can easily use them to achieve what they want, using all kinds of quotes, advanced regular expressions etc., so sometimes you see the script and think it would be easier to understand beeing written in Chinese ;)

You can expect that, independently from shell programming, they will know at least one additional scripting language, such as Perl.

They would know configuration internals of Unix system, so if you ask them to change keyboard layout (f.g. add some binding to right alt + ) they wouldn't be confused.

Managing installed packages also would be no problem. Installing Oracle, running 4 application servers, each with other JVM - also no problem. Virtual network configuration, advanced routing and port filtering, virtual machines etc., managing security - also goes there.

  • 2
    The question is about testing whether a developer has general Unix skills, not identifying guru sysadmins who have a particular focus on Oracle and Java. – Peter Taylor Sep 28 '11 at 12:41
  • **JVN?** What's the Jewish Volunteer Network got to do with this? – ocodo Sep 29 '11 at 01:36