Delete comment from: Javarevisited
Some comments:
Beginner 1: "find directory -maxdepth 1 -type l" is nicer and easily extensible.
Beginner 3: wrong, this only gives kernel version, which in _some_ cases give the distribution (==operating system). "lsb_release -a" would be much preferred, even though a truly universal command does not exist.
Beginner 4: Ctrl+z "bg" is more often used in the context.
Beginner 6: In most shells, up arrow or Ctrl+r is much more useful. "history | grep" is only used in corner cases today.
Beginner 10 and Advanced 9 can just swap places directly.
Intermediate 6: "contains word", I guess you mean that the _filename_ contains the word. As it stands the answer should be "grep -R".
Intermediate 7: Case matters: Unix->UNIX in the answer.
Intermediate 8: "export" is not universal (tcsh, etc).
Advanced 6: Should be "sed -i" (for GNU sed, at least, otherwise use temp files (perhaps follow-up question about making unique temp files (mktemp))).
Advanced 7: There are many more possibilities, e.g. sed, Perl. "cut" is nicest, but change the word "either".
Dec 18, 2014, 8:09:44 AM
Posted to Top 30 UNIX command Interview Questions asked in Investment Banks