├── Resources ├── README.md ├── Linux OS without GUI ├── Regex Learning Resource ├── ADS assn_2 IMP ├── Best of StackExchange ├── grep ├── Commands asked during interview ├── What is GNU, POSIX, Linux and Unix? ├── gdb and Valgrind └── ps -aux /Resources: -------------------------------------------------------------------------------- 1 | http://freevideolectures.com/blog/2012/04/5-websites-learning-linux/ 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Linux-Commands-Interview-Questions 2 | ================================== 3 | -------------------------------------------------------------------------------- /Linux OS without GUI: -------------------------------------------------------------------------------- 1 | Source: http://unix.stackexchange.com/questions/11057/what-is-a-free-small-unix-linux-os 2 | -------------------------------------------------------------------------------- /Regex Learning Resource: -------------------------------------------------------------------------------- 1 | http://www.quora.com/Regular-Expressions-computing/What-are-the-best-resources-for-learning-RegEx 2 | -------------------------------------------------------------------------------- /ADS assn_2 IMP: -------------------------------------------------------------------------------- 1 | Difference between memcpy and memmove (USEFUL when the source and destination buffers are the same) 2 | 3 | http://www.codepolice.org/c/memcpy.html 4 | -------------------------------------------------------------------------------- /Best of StackExchange: -------------------------------------------------------------------------------- 1 | Q1. How are files and folders organized in OS? 2 | Ans. http://superuser.com/questions/839719/why-is-r-recursive-necessary-when-copying-a-directory-in-linux 3 | -------------------------------------------------------------------------------- /grep: -------------------------------------------------------------------------------- 1 | 30 IMP Unix Commands asked in interview 2 | http://javarevisited.blogspot.sg/2011/05/unix-command-interview-questions.html 3 | 4 | grep: 5 | http://en.wikipedia.org/wiki/Grep 6 | http://www.cyberciti.biz/faq/howto-use-grep-command-in-linux-unix/ 7 | -------------------------------------------------------------------------------- /Commands asked during interview: -------------------------------------------------------------------------------- 1 | mount -> to identify and mount a device 2 | find 3 | grep 4 | 5 commands through which I can send a file over a network -> scp, ftp, mail, using google drive services, 5 | cmp and diff command difference 6 | sed, grep commands and other commands 7 | -------------------------------------------------------------------------------- /What is GNU, POSIX, Linux and Unix?: -------------------------------------------------------------------------------- 1 | What is GNU ? 2 | Ans. GNU stands for "Generic Not Unix". 3 | For more info read, https://kb.iu.edu/d/acuo 4 | 5 | What is POSIX ? 6 | Ans. Please read everything about POSIX on http://stackoverflow.com/questions/1780599/i-never-really-understood-what-is-posix 7 | 8 | What is Linux ? 9 | Ans. http://en.wikipedia.org/wiki/Linux 10 | 11 | What is UNIX ? 12 | Ans. http://en.wikipedia.org/wiki/Unix 13 | -------------------------------------------------------------------------------- /gdb and Valgrind: -------------------------------------------------------------------------------- 1 | http://ubuntuforums.org/showthread.php?t=828018 2 | 3 | Setting breakpoint in gdb when variable reaches a specific value: 4 | http://stackoverflow.com/questions/7285529/setting-a-breakpoint-when-variable-reaches-specific-value 5 | 6 | http://stackoverflow.com/questions/2520632/how-do-i-jump-to-a-breakpoint-within-gdb 7 | 8 | 9 | WHEN TO USE free in C: 10 | http://stackoverflow.com/questions/13590812/c-freeing-structs 11 | 12 | 13 | 14 | Complete Command: 15 | valgrind --tool=memcheck --leak-check=full --track-origins=yes --show-reachable=yes ./final --basic input-large.nikhil.bin sort-large.nikhil.bin > SORT-large.txt 16 | 17 | 18 | valgrind --tool=memcheck --leak-check=full --track-origins=yes --show-reachable=yes ./assn_4 index.bin 4 < input-01.txt > output-01.txt 19 | 20 | ./assn_4 index.bin 4 < input-01.txt > output-01.txt 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /ps -aux: -------------------------------------------------------------------------------- 1 | 2 | 3 | In Linux the command: 4 | 5 | ps -aux 6 | 7 | Means show 'all processes for all users'. You might be wondering what the x means? The x is a specifier that means 'any of the users'. So you could type this: 8 | 9 | ps -auroot 10 | 11 | Which displays all the root processes, or 12 | 13 | ps -auel 14 | 15 | which displays all the processes from user el. The technobabble in the 'man ps' page is: "ps -aux prints all processes owned by a user named 'x' as well as printing all processes that would be selected by the -a option. 16 | 17 | 18 | 19 | 20 | $ ps aux 21 | USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND 22 | timothy 29217 0.0 0.0 11916 4560 pts/21 S+ 08:15 0:00 pine 23 | root 29505 0.0 0.0 38196 2728 ? Ss Mar07 0:00 sshd: can [priv] 24 | can 29529 0.0 0.0 38332 1904 ? S Mar07 0:00 sshd: can@notty 25 | 26 | USER = user owning the process 27 | PID = process ID of the process 28 | %CPU = It is the CPU time used divided by the time the process has been running. 29 | %MEM = ratio of the process’s resident set size to the physical memory on the machine 30 | VSZ = virtual memory usage of entire process 31 | RSS = resident set size, the non-swapped physical memory that a task has used 32 | TTY = controlling tty (terminal) 33 | STAT = multi-character process state 34 | START = starting time or date of the process 35 | TIME = cumulative CPU time 36 | COMMAND = command with all its arguments 37 | 38 | See the ps man page for more info. 39 | 40 | More Info -> http://www.cyberciti.biz/faq/kill-process-in-linux-or-terminate-a-process-in-unix-or-linux-systems/ 41 | --------------------------------------------------------------------------------