1. How do you list the files in an UNIX directory while also showing hidden files?
Answer:
ls -ltra
2. How do you execute a UNIX command in the background?
Answer:
Use the “&”.
3. What UNIX command will control the default file permissions when files are created?
Answer:
umask
4. Explain the read, write, and execute permissions on a UNIX directory.
Answer:
5. What is the difference between a soft link and a hard link?
Answer:
6. Give the command to display space usage on the UNIX file system.
Answer:
df -lk
7. Explain iostat, vmstat and netstat.
Answer:
8. How would you change all occurrences of a value using VI?
Answer:
%s/(old value)/(new value)/g
9. Give two UNIX kernel parameters that effect an Oracle install.
Answer:
SHMMAX & SHMMNI
10. Briefly, how do you install Oracle software on UNIX?
Answer:
Basically, set up disks, kernel parameters, and run orainst.
Answer:
ls -ltra
2. How do you execute a UNIX command in the background?
Answer:
Use the “&”.
3. What UNIX command will control the default file permissions when files are created?
Answer:
umask
4. Explain the read, write, and execute permissions on a UNIX directory.
Answer:
Read allows you to see and list the directory contents. Write allows you to create, edit and delete files and subdirectories in the directory. Execute gives you the permissions to run programs or shells from the directory.
5. What is the difference between a soft link and a hard link?
Answer:
A symbolic (soft) linked file and the targeted file can be located on the same or different file system while for a hard link they must be located on the same file system.
6. Give the command to display space usage on the UNIX file system.
Answer:
df -lk
7. Explain iostat, vmstat and netstat.
Answer:
iostat reports on terminal, disk and tape I/O activity. vmstat reports on virtual memory statistics for processes, disk, tape and CPU activity. netstat reports on the contents of network data structures.
8. How would you change all occurrences of a value using VI?
Answer:
%s/(old value)/(new value)/g
9. Give two UNIX kernel parameters that effect an Oracle install.
Answer:
SHMMAX & SHMMNI
10. Briefly, how do you install Oracle software on UNIX?
Answer:
Basically, set up disks, kernel parameters, and run orainst.
11. List the files in current directory sorted by size?
Answer:
ls -l | grep ^- | sort -nr
12. List the hidden files in current directory?
Answer:
ls -a1 | grep "^\."
13. Delete blank lines in a file?
Answer:
cat sample.txt | grep -v ‘^$’ > new_sample.txt
14. Search for a sample string in particular files?
Answer:
grep “Debug” *.conf
15. Display the last newly appending lines of a file during appendingdata to the same file by some processes?
Answer:
tail –f Debug.log
- Here tail shows the newly appended data into Debug.log by some processes/user.
16. Display the Disk Usage of file sizes under each directory in currentDirectory?
Answer:
du -k * | sort –nr (or) du –k . | sort -nr
17. Change to a directory, which is having very long name?
Answer:
cd CDMA_3X_GEN*Here original directory name is – “CDMA_3X_GENERATION_DATA”.
18. Display the all files recursively with path under current directory?
Answer:
find . -depth -print
19. Set the Display automatically for the current new user?
Answer:
export DISPLAY=`eval ‘who am i | cut -d"(" -f2 | cut -d")" -f1′`
20. Display the processes, which are running under yourusername?
Answer:
ps –aef | grep Maheshvj
- Here, Maheshvj is the username.
21. List some Hot Keys for bash shell?
Answer:
Ctrl+l - Clears the Screen.
Ctrl+r - Does a search in previously given commands in shell.
Ctrl+u - Clears the typing before the hot key.
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.
22. Display the files in the directory by file size?
Answer:
ls –ltr | sort –nr –k 5
23. How to save man pages to a file?
Answer:
man | col –b >
- Example : man top | col –b > top_help.txt
24. How to know the date & time for – when script is executed?
Answer:
- Add the following script line in shell script:
eval echo "Script is executed at `date`" >> timeinfo.inf
- Here, “timeinfo.inf” contains date & time details, when script is executed and history related to execution.
25. How do you find out drive statistics?
Answer:
iostat -E
26. Display disk usage in Kilobytes?
Answer:
du -k
27. Display top ten largest files/directories?
Answer:
du -sk * | sort -nr | head
28. How much space is used for users in kilobytes?
Answer:
quot -af
29. How to create null file?
Answer:
cat /dev/null > filename1
30. Access common commands quicker?
Answer:
ps -ef | grep -i $@
31. Display the page size of memory?
Answer:
pagesize -a
32. Display Ethernet Address arp table?
Answer:
arp -a
33. Display the no.of active established connections to localhost?
Answer:
netstat -a | grep EST
34. Display the state of interfaces used for TCP/IP traffice?
Answer:
netstat -i
35. Display the parent/child tree of a process?
Answer:
ptree Example: ptree 1267
36. Show the working directory of a process?
Answer:
pwdx Example: pwdx 1267
37. Display the processes current open files?
Answer:
pfiles Example: pfiles 1267
38. Display the inter-process communication facility status?
Answer:
ipcs
39. Display the top most process utilizing most CPU?
Answer:
top –b 1
40. Alternative for top command?
Answer:
prstat -a
Answer:
ls -l | grep ^- | sort -nr
12. List the hidden files in current directory?
Answer:
ls -a1 | grep "^\."
13. Delete blank lines in a file?
Answer:
cat sample.txt | grep -v ‘^$’ > new_sample.txt
14. Search for a sample string in particular files?
Answer:
grep “Debug” *.conf
- Here grep uses the string “Debug” to search in all files with extension“.conf” under current directory.
15. Display the last newly appending lines of a file during appendingdata to the same file by some processes?
Answer:
tail –f Debug.log
- Here tail shows the newly appended data into Debug.log by some processes/user.
16. Display the Disk Usage of file sizes under each directory in currentDirectory?
Answer:
du -k * | sort –nr (or) du –k . | sort -nr
17. Change to a directory, which is having very long name?
Answer:
cd CDMA_3X_GEN*Here original directory name is – “CDMA_3X_GENERATION_DATA”.
18. Display the all files recursively with path under current directory?
Answer:
find . -depth -print
19. Set the Display automatically for the current new user?
Answer:
export DISPLAY=`eval ‘who am i | cut -d"(" -f2 | cut -d")" -f1′`
- Here in above command, see single quote, double quote, grave ascent is used. Observe carefully.
20. Display the processes, which are running under yourusername?
Answer:
ps –aef | grep Maheshvj
- Here, Maheshvj is the username.
21. List some Hot Keys for bash shell?
Answer:
Ctrl+l - Clears the Screen.
Ctrl+r - Does a search in previously given commands in shell.
Ctrl+u - Clears the typing before the hot key.
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.
22. Display the files in the directory by file size?
Answer:
ls –ltr | sort –nr –k 5
23. How to save man pages to a file?
Answer:
man
- Example : man top | col –b > top_help.txt
24. How to know the date & time for – when script is executed?
Answer:
- Add the following script line in shell script:
eval echo "Script is executed at `date`" >> timeinfo.inf
- Here, “timeinfo.inf” contains date & time details, when script is executed and history related to execution.
25. How do you find out drive statistics?
Answer:
iostat -E
26. Display disk usage in Kilobytes?
Answer:
du -k
27. Display top ten largest files/directories?
Answer:
du -sk * | sort -nr | head
28. How much space is used for users in kilobytes?
Answer:
quot -af
29. How to create null file?
Answer:
cat /dev/null > filename1
30. Access common commands quicker?
Answer:
ps -ef | grep -i $@
31. Display the page size of memory?
Answer:
pagesize -a
32. Display Ethernet Address arp table?
Answer:
arp -a
33. Display the no.of active established connections to localhost?
Answer:
netstat -a | grep EST
34. Display the state of interfaces used for TCP/IP traffice?
Answer:
netstat -i
35. Display the parent/child tree of a process?
Answer:
ptree
36. Show the working directory of a process?
Answer:
pwdx
37. Display the processes current open files?
Answer:
pfiles
38. Display the inter-process communication facility status?
Answer:
ipcs
39. Display the top most process utilizing most CPU?
Answer:
top –b 1
40. Alternative for top command?
Answer:
prstat -a