I've found 'list 10 two-letter linux commands and their use'
They don't actually have to think of 10, but their answer can show what they've actually had to do on a *nix system. Its also lets you prod them with questions like 'how might I get disk usage' or if they mention dd, ask them how they use it, what its good for etc.
To be honest, a reason I like it is that if they free-think and say 'what about sed, oh of course thats three characters', shows what they know. Also whether shell-built ins count too.
At which point I'd argue that using -exec with an appropriate command is simpler, in the general case, than using one of find(1)'s many, many, many twiddly little command-line arguments. Granted, -exec spawns a process per file, but processor cycles are cheaper than brain cycles, &c., &c.
You have stumbled squarely into the tripwire implicit in that question; "rm -rf *.mp3" ignores directories whose names don't end in ".mp3", and deletes those whose do.
I'd give half marks for this, because it optimizes (meaninglessly) for processes, at the risk of ending up with "rm: Too many arguments" in a directory tree containing a sufficiently large number of MP3 files.
xargs knows the maximum command line length, and will invoke the program more than once if necessary. One of the points of xargs is to break up invocations of a program into chunks of arguments that fit in one maximum length command line.
xargs reads items
from the standard input, delimited by blanks (which can be protected
with double or single quotes or a backslash) or newlines, and executes
the command (default is /bin/echo) one or more times with any initial-
arguments followed by items read from standard input.
--max-chars=max-chars
-s max-chars
Use at most max-chars characters per command line, including the
command and initial-arguments and the terminating nulls at the
ends of the argument strings. The largest allowed value is sys‐
tem-dependent, and is calculated as the argument length limit
for exec, less the size of your environment, less 2048 bytes of
headroom. If this value is more than 128KiB, 128Kib is used as
the default value; otherwise, the default value is the maximum.
1KiB is 1024 bytes.
Well, how about that! It could be that I formed my opinion regarding xargs before it got that smart, or it could be the old Red Hat boxes on which I mostly learned my craft didn't bother compiling in that capability. Either way, I'm glad to know about it now, and thank you very kindly for pointing it out to me!
I've been a contract sysadmin for a long time. In a former "life" part of my work was doing phone screens and job interviews for contract sysadmin candidates.
If a candidate's answer to a nonspecific troubleshooting scenario didn't begin with (or contain very close to the beginning of the answer) "look at the logs" I'd bump them. Anybody whose problem-solving methodology doesn't including gathering pertinent data early in the process isn't somebody I want "solving" problems for me.
The best question I have is "Describe the power on of a RHEL x86 system in as much detail as possible from beginning to end, each step of what happens". It is open ended but can tell you a lot. You can get very fine grained, down to the hardware signals which take place before FFFF0000 is executed.
1 - How to connect to a server using SSH without a password
2 - How would you check if $DATABASE is running and how would you start it if it wasn't. Bonus points: how do you make it start automatically at next reboot
Is 1. really that trivial? If I recall there's some really weird convention about usernames across both platforms (assuming *nix) having to be identical, in addition to fiddling around with the RSA keys.
Ask about disaster recovery, backups, penetration testing, what to do if a database/webserver breach occurs, or any form of generic networking/routing.
Not sysadmin specifically, but when I was working as a computer technician, questions we would ask to scope out the skills of people were along the lines of:
Q: "Something you have no experience with has broken and won't do a basic function, how will you go about fixing it?"
A: Research, ask someone else etc.
Q: "X is missing their password for a system we have no admin rights on. How are you going to fix this?"
A: Recovery Tools. Format device and set it up again. Use JS/Developer tools to get it in plain text from the browser.