Some basic Questions in Linux
Hi, might someone help me with some basic questions in Linux?
1.How can I fetch line number 7 from file ‘f1’ ? a. tail -7 f1 | head -1 b. tail +7 f1 | head -1 c. head -7 f1 | tail -1 d. answers b & c are correct. 2.What’s the outcome of ‘ls 2>&1’ ? a. regular ls. b. all the errors will go to /dev/null. c. all the errors will go to &1, which is the first Shell I open. d. search for the file ‘2>&1’. 3.How can I find all the directories under ‘/etc’ and dispose all the errors? a. find –type dir |& /dev/null. b. ls –R /etc | find –type d > /dev/null c. find /etc –type d 2> /dev/null. d. find /etc –type d -noerr 4.What’s the use of ‘/dev/null’? a. It’s a block device file. b. It’s a device file for writing errors to. c. It’s a device file for writing special logs to. d. It’s a device file. What ever you send it, the system deletes. 5.How can I redirect a process output to a log file, and also see it on screen? a. someproc > pipefile | logfile. b. someproc | tee logfile screen c. tee someproc | logfile d. someproc |tee logfile 6.What’s the purpose of ‘X’ permission on a directory? a. run the directory as a special process. b. load the directory to the ram (memory). c. enables to enter the directory and all of the dirs below it. d. If a directory doesn’t have it, you can’t access it and all it’s sub-dirs. 7.Default router (or Gateway) is a must on a LAN enabled machine: a. yes. b. no. c. yes, but only when I want to exit the LAN. d. no, if I use real IP addresses for all my machines, but it’s rare. 8.How do I know the process status? a. looking at ‘/proc/sys’. b. by using ‘ps -ef’. c. look at his ‘status’ field at the process table, using some command. d. non of the above. 9. what is a: shell, terminal/console/pts, telnet, ftp basics, ssh, basic man. Xwindows, Window manager 10.What those commands does: ls –R / cd ../../.. pwd cp –rf /home/user /tmp mv –f /bin/ls .bashrc rm –rf / (don’t try it…) chmod 764 /home/user chown root:sys /root/f1 ps –ef | grep pts head -5 /etc/passwd tail +3 /etc/passwd rpm –qf /bin/ls grep something /etc/passwd |
Trying to get your homework done, eh? You could find answers for these from man pages and/or Google searches. Read the rules: http://www.linuxquestions.org/rules.php
|
Try the commands and see, except for the `rm -rf /` which it tells you not to try anyway
|
The Rules you signed up to state:
Quote:
|
All times are GMT -5. The time now is 05:48 AM. |