5 Apr, 2007
Unix/Linux Interview Questions
- List some Hot Keys for bash shell ? - Ctrl+l – Clears the Screen. Ctrl+r – Does a search in previously given commands in shell. Ctrl+u - Clears the typing before the hotkey. Ctrl+a – Places cursor at the beginning of the command at shell. Ctrl+e – Places cursor at the end of the command at shell. Ctrl+d – Kills the shell. Ctrl+z – Places the currently running process into background.
- Display the files in the directory by file size ? - ls –ltr | sort –nr –k 5
- How to save man pages to a file ? - man <command> | col –b > <output-file>Example : man top | col –b > top_help.txt
- How to know the date & time for – when script is executed ? - Add the following script line in shell script.eval echo “Script is executed at `date`” >> timeinfo.infHere, “timeinfo.inf” contains date & time details ie., when script is executed and history related to execution.
- How do you find out drive statistics ? - iostat -E
- Display disk usage in Kilobytes ? - du -k
- Display top ten largest files/directories ? - du -sk * | sort -nr | head
- How much space is used for users in kilobytes ? - quot -af
- How to create null file ? - cat /dev/null > filename1
- Access common commands quicker ? - ps -ef | grep -i $@