下面的題目都是我在進行模擬考時,
覺得自己比較沒把握解答,擷取下來的!
打算日後做成答題參考用的筆記。
將會慢慢把答案和解題心得補上,
如有錯誤請網路上的高手們給予指正,謝謝!
要討論的話,我的電子信箱是bullock0425@gmail.com
OK,進入主題吧!
+------------------------------------------------------------------------+
Question 001
You want to install a RPM packet file foobar.rpm on a debian system. What
command would you use to convert the rpm-file into debian deb format?
Choose the best answer.
a.alien --to-deb foobar.rpm
b.rpmtodeb foobar.rpm
c.rpm2deb foobar.rpm
d.pcktconv --to-deb foobar.rpm
e.pcktconv -o foobar.deb foobar.rpm
answer:a
LPIC考試不再分什麼RPM和DEB套件管理系統了!
兩個都要會,在deb套件管理上,要把rpm融入,就要利用alien指令。
但還有更進階的方式和相關know-how,再找吧!
+------------------------------------------------------------------------+
Question 002
Which command would you use to check the signature of a rpm packet?
Choose the best answer.
a.rpmcheck filename
b.rpm -c filename
c.rpm --checksig filename
d.rpm -q --checksig filename
e.rpm --pgpcheck filename
answer:c
RPM檢查認證key
+------------------------------------------------------------------------+
Question 003
What command is used to reconfigure a formerly installed debian packet.
Enter just the name without path and options.
Type the answer.
answer:dpkg-reconfigure
+------------------------------------------------------------------------+
Question 004
Many server-processes allow the root-user to force them to read their
configfiles while running. How is this done?
Choose the best answer.
a.Use the reconf command
b.Send them the SIGPIPE signal
c.Send them the SIGCONF signal
d.Send them the SIGHUP signal
e.Use the ps command
answer:d
出個進階的題目,當我修改/etc/syslog.conf之後,如何重啓syslogd這個daemon?
#killall -SIGHUP syslogd
或是用kill
#kill -SIGHUP `cat /var/run/syslogd.pid`
倒斜線裡的cat指令,意義是要找出syslogd的pid(Process ID)。
killall 給daemon名稱,而kill要給process-ID或是job-ID,就這麼簡單!
+------------------------------------------------------------------------+
Question 005
Which statements concerning the tool renice are true?
Choose every correct answer.
a.A normal user may only change the nice values of his own processes.
b.A normal user can decrease the nice value of his own processes.
c.Once a nice value is increased, a normal user may not decrease it, even if it is his own process.
d.root can change the nice-values of all processes of one user with a single command.
e.renice allows a normal user to fasten his processes.
answer:a c d
nice的使用邏輯,我把它拿來和把目錄設Sticky Bit的概念比較,
同樣是root最大,能任意改任意user的file,process。而一般user只能對自己的file,process動手腳。
nice命令,一般user只能改大value值,nice值愈大,執行權愈後面!
root可以指定nice值從-20到19。預設值是10。
如何看nice值?當你執行top或`ps -l`時,NI那一欄(第八欄)就是了!
`ps -l | grep command_file_name`
若是以上那個方式擷取出來的資訊,則要看第七個空白之後的那個欄位(第八欄)!
我來出個題目:
用root來執行以下命令,
`nice --60 vi &`
會有什麼結果?
因為nice命令也可以讓一般使用帳號執行,
所以用root執行和用非root執行,結果是有差別的!
以一般非root帳號執行的話,是會有錯誤訊息的,因為一般帳號只能給正值(從0開始)。
只有root才能給-20到19,值愈小執行的優先等級愈高!
但,不是只能給-20到19嗎?給-60也行嗎?
嘿嘿,命令的確可以執行!但不能指定到-60,它還是給最高的執行權-20,OK。
談到nice命令,就不能略過renice命令了。
看一下renice的man-page,renice是重新指定nice value的指令,
令我困惑的是,renice居然能重新指定的nice value,是從-20到20!
可是經我實機操作的結果,`renice 20 process-ID`還是只能給到19,而不是20。
奇也怪哉!到底是-20到20?還是-20到19?
還望善心人士解我疑惑!善哉!善哉!
+------------------------------------------------------------------------+
Question 006
In the directory /home/foo exists a file named bar which is a symbolic link
to the file foobar in the same directory, created with the command
ln -s foobar bar
If you would copy the link to /tmp using the command
cp -d /home/foo/bar /tmp
what would happen?
Choose the best answer.
a.The destination /tmp/bar is a symbolic link to /tmp/foobar
b.The destination /tmp/bar is a symbolic link to /home/foo/foobar
c.The destination /tmp/bar is a regular file with the same content as /home/foo/foobar
d.The destination /tmp/bar is a hardlink using the same inode as /home/foo/foobar
e.The destination /tmp/bar is a hardlink using the same inode as /home/foo/bar
answer:a
這題有陷阱,有人會選b,中招!
因為`ln -s foobar bar`,是以相對路徑的方法來建symbolic link,
你如果用`ln -s /home/foo/bar /home/foo/foobar`,用絶對路徑來建立,
再以`ls -l`,可以看出和題目出題的那個連結的差異。
`cp -d`的用法,是不會修正你原始的連結路徑的,
所以這題會產生一個失效的連結!
+------------------------------------------------------------------------+
Question 29/34
In the directory /home/foo exists a file named bar which is a symbolic link
to /etc/services. If you would copy the link to /tmp using the command
cp -d /home/foo/bar /tmp
what would happen?
Choose the best answer.
a.The destination /tmp/bar is a symbolic link to /home/foo/bar
b.The destination /tmp/bar is a symbolic link to /etc/services
c.The destination /tmp/bar is a regular file with the same content as /etc/services
d.The cp command would ask you whether to create a link or a file
e.Nothing. The cp-command is not made for copying links.
answer:b
同上題的解題觀念,
所以當我們要建symbolic link時,最好以絶對路徑來建!
以避免日後變成失效的連結。
而cp指令的用法,以及option的使用時機,最好不要等閒視之。像-r,-s等意義!
+------------------------------------------------------------------------+
Question 007
What is a X-client
Choose the best answer.
a.a computer which uses the X11 Protocol to communicate
b.a computer which uses a super-computer to run applications which are displayed on the local screen
c.a program which is dispayed on a graphical screen of an X Server
d.a computer which offers displaying on its screen
e.a computer with a graphical user interface using X11
answer:c
我對X-window一直沒輒,但有個重要觀念一定要有,
什麼是X-server?什麼是X-client?
X-server是指掌管秀出執行程式,軟體的電腦。
主要是硬體的設定,xf86config(CLI模式)和XF86Setup(GUI模式),
都是要搞定一個叫XF86config的設定檔!
而X-client是指一個程式,或軟體,成功執行時會在X-server秀出來。
所以只要提到X-server,就和硬體聯想在一起;X-client就往軟體,程式聯想就八九不離十 了!
+------------------------------------------------------------------------+
Question 008
In which file will you find a listing of all used DMA-channels of
your computer?
Type the answer.
answer:/proc/dma
+------------------------------------------------------------------------+
Question 009
What is the meaning of the SCSI-Address 1,5,0 ?
Choose the best answer.
a.The fifth device on the first SCSI-cable is deactivated
b.The device with SCSI-ID 5 on the second SCSI-Bus, LUN 0
c.A SCSI-1 device on Bus 0 with the SCSI ID 5
d.The first device on the fifth bus with LUN 0
e.This isn't a valid SCSI address
answer:b
這題比較怪,我找幾本書都沒提到這樣的標示方式!
但總算是出現有良心的linux同好,挖了答案出來。
那三個數字分別是channel,ID,LUN。
回答b應該錯不了!
+------------------------------------------------------------------------+
Question 010
Which of the following commands could be used to detect the kind of USB
controler of your computer?
Choose the best answer.
a.getusbinfo
b.usbinfo
c.usb-info
d.usb_info
e.lspci
answer:e
嘿嘿!我說任何考試總是會有幾題是設陷阱給人跳,不給考滿分的!
沒有usb,info什麼什麼的,但是有scsi_info這個指令,
而比較常令人迷惑的是,USB這種東東,居然是和pci扯上關係!
據我實作經驗,/proc/pci這個檔案在比較新的linux版本上,己經不見了,但是有lsusb這個指令。
很糟!其實像XFree86之類的設定方法,也都不常見了,
但考試還是會提到,感覺怪怪的!
+------------------------------------------------------------------------+
Question 011
Which statements concerning the program gunzip are true?
Choose every correct answer.
a.After decompressing a file with gunzip, the compressed file is removed
b.gunzip is a replacement for tar
c.gunzip is a replacement for cpio
d.gunzip is just a link to gzip
e.gunzip is used to extract files from a zip archive
answer:a d e
gzip和gunzip到底算不算孿生兄弟?
原本是不干我的事的,只要會用來壓、解檔案,就可以了。
但遇到考試要考!那可就意義不同了!
基本上,他們的man-page是同一個,而有的linux版本,你可以用`ls -il /bin/gzip /bin/gunzip`,
得出他們的inode根本就是同一個,也就是說這兩個指令是hard-link的檔案!
也有一些版本,gunzip是gzip的soft-link。
但也有的linux版本不是同inode,但檔案大小一樣!
而你可以用 `gzip -d` 來代替gunzip。
種種跡象顯示,他們應該是孿生兄弟沒錯!甚至於我懷疑,連zcat也和他們是一夥的。
所以,選d應該是錯不了吧。
還有,gzip和gunzip只能對檔案處理。
不能對目錄,但是可以針對一個目錄,做裡頭所有檔案的處理。`gzip -r dir_name`就會把dir_name目錄下所有檔案壓成.gz。
而指令處理完,會把原來的檔案刪除掉。除非是用重新導向的方式,才有可能保留原始檔案。`cat file_name | gzip > file_name.gz`
有些考題會考tar和gzip的合併使用,如:
`tar cf - file1 file2 | gzip > tar_file.gz`
`gzip -d tar_file.gz | tar xf -`
上面那個減號是有意義的,不可省略,要注意!
+------------------------------------------------------------------------+
Question 012
You want to deinstall a deb packet foobar from your system. What would be a
proper command?
Choose every correct answer.
a.remove foobar
b.remove foobar.deb
c.dpkg -r foobar
d.dselect foobar
e.apt-get remove foobar
answer:c e
在debian套件管理中,dpkg是最主要的程式,其他什麼apt-get,dselect...都是由dpkg再發展出來的。
dselect是要啓動文字介面的套件管理模式, 是不能直接指定套件名稱的。aptitue己經取代dselect了!
+------------------------------------------------------------------------+
Question 013
Which command would you use to get a list of all files inside the rpm-packet
foobar.rpm in /home/bob?
Choose the best answer.
a.rpm -ql /home/bob/foobar.rpm
b.rpm -ql -p /home/bob/foobar.rpm
c.rpm -l /home/bob/foobar.rpm
d.rpm -l -p /home/bob/foobar.rpm
answer:b
rpm是RED-HAT Package Manager的簡稱,目前linux的套件管理,主要分兩大流派,有debian系列和redhat系列。
rpm有-i install模式,-e erase移除模式,-q query查詢模式,-U Upgrade昇級模式,-V or-y驗證模式。
本題的題意是要針對foobar.rpm做套件內容的查詢,
因為是查詢模式,所以-q一定少不了,選項c和d一定不能選。
而題目指定了單一套件,所以也一定會有-p這個option,再加個l就是詳細列出囉!
總之,rpm和deb的套件管理,都是變化很多很雜的指令,多操作才能熟悉,
不過,幸運的是,LPIC101目前的考古題,好像還不會考太複雜。希望實地考也是如此!
+------------------------------------------------------------------------+
Question 014
Which command is NOT usable to install debian packages?
Choose the best answer.
a.dpkg
b.dselect
c.apt-get
d.dinst
answer:d
沒這個指令的!用bash指令的tab補全方式去查就能確定了!
+------------------------------------------------------------------------+
Question 11/34
How can you describe the function of the following commands?
foo | bar >> foobar
Choose the best answer.
a.The command foo redirects its output to the command bar, which writes its output to foobar. If foobar exists, it will be overwritten.
b.The command foo redirects its output to the command bar, which writes its output to foobar. If foobar exists, the results will be appended.
c.The command bar gets its input from the file foo and writes its output to foobar. If foobar exists, it will be overwritten.
d.The command bar gets its input from the file foo and writes its output to foobar. If foobar exists, the results will be appended.
e.The command foo writes its output to the file bar. If this file exists foo writes into the file foobar instead.
answer:d
在一堆亂七八糟的符號中,搞清楚那個是command,那個是file,
而什麼狀況是會create file,什麼狀況是append file!
遇到tee和xargs這樣特殊處理standard input(就是本來會秀在螢幕的訊息)的指令,要小心哪!
+------------------------------------------------------------------------+
Question 13/34
What would the following command result in?
echo $(date +%H:%M) > file
Choose the best answer.
a.The string "date +%H:%M" will be written into the file
b.The content of the variable named "date +%H:%M" will be written into the file
c.The content of the variable named after the current time (Hours:Minutes) will be written into the file
d.The current time (Hours:Minutes) will be written into the file
e.This isn't a valid command
answer:d
這題很冷門,考的是命令代換的技巧!
$(command --option arguments) = `command --option arguments`
是倒引號哦,一般鍵盤的位置會在Esc鍵的下方,注意!我重申一次,不是單引號,是倒引號!
題目若是出成:
echo `date +%H:%M` > file
會是相同的結果!
+------------------------------------------------------------------------+
Question 15/34
What command allows you to extract particular columns out of a textfile (just the command - no options)?
Type the answer.
answer:cut?
這題英文好的人就很容易答題了,但是LPIC就是這樣,因為linux是外國人發明的東東,所以要搞懂,就一定要會英文!
我的英文好像也是因為學linux才變得比較好的,因為man-page大部份是英文,沒得商量。
不過我很疑惑,linux不是芬蘭人Linus Torvalds發明的嗎?為什麼不是什麼芬蘭文,德文?
還好不是,不然,我們就慘了!芬蘭文?聽都沒聽過?怎麼玩linux啊!
+------------------------------------------------------------------------+
Question 16/34
What would be the result of the following command?
cp *.* /tmp
Choose the best answer.
a.All files in the current directory would be copied to /tmp
b.All files in the current directory, which have exactly one dot (.) inside their names would be copied to /tmp
c.All files in the current directory, which have one or more dots (.) anywhere inside their names but not at the beginning would be copied to /tmp
d.All files in the current directory, which have one or more dots (.) inside their names
- but neither at the begining nor at the end of the name would be copied to /tmp
e.This is a DOS-command - it has no meaning under Linux
answer:c
萬用字元和常規表示式,是兩種類似但不完全相同的東西!
找檔案是用萬用字元,而找檔案內容就用常規表示式,這是我個人的心得,不知道對不對?
*.*是M$-DOS的東西,因為M$-DOS才有副檔名的命名規定,unix-like沒有副檔名這種硬性的命名規定,
你有時會看到.tar .gz .bz ...之類的檔案,是方便判斷檔案的內容,好方便去使用對應的指令來處理它!
不然,你用file這個指令也可以判斷檔案性質的。
在M$-DOS系統下,cp *.*會拷貝當前目錄的所有檔案,但對unix-like系統則否!
因為以萬用字元的定義來看,*.*會處理到所有檔名中間至少要有一個dot(.)的檔案,
但*.*應該包括.*啊,為什麼我還是要選c?
我說過,LPIC總是會有幾題是埋伏陷阱的,這題我就認為是。
因為就unix-like系統來說,dot(.)開頭的檔案,通常代表的是應該被隱藏起來的設定檔,
cp命令是不會拷貝到隱藏檔的!嘿!沒蓋你,我真的有實機操作過,就是這樣!
+------------------------------------------------------------------------+
Question 18/34
What command sends signals to processes (just the command - no options)?
Type the answer.
answer:kill
很多人考過真正的LPIC101後,都覺得和模擬考差很多!
因為摸擬考很少考指令的option,但真的考試會出含option的題目。
所以那些以為把模擬考作熟背熟就會過的LPIC101的人,就掛在一些option不熟的題目上。
kill指令可以送SIGNAL給process,但是SIGNAL有幾種,怎麼送?
嘿!有些難度了吧!
`kill -l`可以檢視可用的訊號有幾種,真要殺掉一個行程的作法有好幾種。
`kill -s 9 process-ID`
`kill -9 process-ID`
`kill -s SIGKILL process-ID`
`kill -SIGKILL process-ID`
`kill -sigkill process-ID`
`kill -KILL process-ID`
怎樣,眼花撩亂了吧!我也快搞不清楚了。
小心那個減號,是有意義的,要是數字9前沒有減號,那是代表行程9而不是訊號KILL 9,小心小心!
還有,kill和killall是用法很相似的指令!也要注意一下!雖然大部份考題是針對kill來出。
+------------------------------------------------------------------------+
Question 19/34
Which statements concerning the tool renice are true?
Choose every correct answer.
a.A normal user may only change the nice values of his own processes.
b.A normal user can decrease the nice value of his own processes.
c.Once a nice value is increased, a normal user may not decrease it, even if it is his own process.
d.root can change the nice-values of all processes of one user with a single command.
e.renice allows a normal user to fasten his processes.
answer:a c d
這題好像重複了,我得篩選一下這個筆記內容了。找一下前面吧。
Question 20/34
What means the following construct inside a regular expression?
[^A-Z][!A-Z]
Choose the best answer.
a.The starting of a line, followed by an uppercase letter, followed by a non uppercase letter.
b.Either the starting of a line or an uppercase letter followed by a non uppercase letter.
c.A non uppercase letter followed by either an ! or an uppercase letter
d.A non uppercase letter at the beginning of a word followed by a non uppercase letter.
e.An uppercase letter at the beginning of a word followed by a non uppercase letter.
answer:c
什麼時候用萬用字元,什麼時候用常規表示式?
是很多考LPIC101的人,會搞混的部份。
我簡單給一個規則,有錯的話,請糾正我!
「萬用字元用在找檔案名稱,常規表示式用在處理檔案的內容。」
所以find指令會配合的是萬用字元,而grep和sed是配合常規表示式。
小心!「^」「*」「?」「.」「!」,這些符號在兩套規則中的意義差很多。一定要區分清楚!
Question 25/34
How could you generate a report of the user quota of /home?
Choose the best answer.
a.repquota /home
b.quotarep /home
c.quota --report /home
d.edquota /home
e.quotaed /home
answer:a
Question 31/34
What is a X-client
Choose the best answer.
a.a computer which uses the X11 Protocol to communicate
b.a computer which uses a super-computer to run applications which are displayed on the local screen
c.a program which is dispayed on a graphical screen of an X Server
d.a computer which offers displaying on its screen
e.a computer with a graphical user interface using X11
answer:c
Question 32/34
Most linux systems offer a display manager runlevel. What statement about
this runlevel is true?
Choose the best answer.
a.X11 can be started using startx in this runlevel
b.X11 can be started using xinit in this runlevel
c.X11 is started automaticly for user root
d.X11 is started automaticly an offers a login window
e.This runlevel has nothing to do with X11
answer:d
Question 1/34
Which of the following statements are true?
Choose every correct answer.
a.The LBA-mode of a harddisk is used to turn on DMA or UDMA
b.A harddisk with more than 1024 cylinders should be used in LBA-mode
c.A harddisk with more than 1.2 GByte capacity can only be used in LBA-mode
d.LBA-mode does not change the capacity of a harddisk
e.A harddisk with more than 1024 cylinders can't be mounted without LBA-mode
answer:b d
Question 3/34
You detect a VIA USB controler in your computer. Which USB module would you
load to use this controler?
Choose the best answer.
a.usb-via
b.usb-ohci
c.usb-uhci
d.usb-intel
e.usb-compaq
answer:c
Question 7/34
You have just installed the new program foobar manually. This program uses
shared libraries, which are installed to /usr/local/foobar/lib.
What is neccesary to do after the installation so that the libraries can be
used?
Choose the best answer.
a.restart your computer
b.run ldconfig
c.edit /etc/ld.so.conf to add the new library path and then run ldconfig
d.edit /etc/ld.so.conf to add the new library path and then run ld.so
e.create symbolic links from every library in /usr/local/foobar/lib to /usr/lib
answer:c
有一個檔案叫ld.so.cache!
是執行完ldconfig之後,才把lo.so.conf的設定更新至ld.so.cache。
還有一個指令叫ldd。什麼時候用得到?
且讓我屁一下,同樣的,有錯請各位大德,來信糾正!請一定要糾正我,OK!
因為我的理想是要推廣linux給學校、家庭、小企業等...使用。
要是我搞錯了,也許將來我教出來的使用者的觀念也會跟著錯,
所以一定要糾正我,不然,後果不堪設想啊!
ldd指令是用來查詢你現在所用的函式庫有那些。
Question 8/34
You want to deinstall a rpm packet foobar from your system. What would be a
proper command?
Choose the best answer.
a.remove foobar
b.remove foobar.rpm
c.rpm remove foobar
d.rpm -e foobar
e.deinstall foobar
Question 9/34
Which command would you use to list all rpm-packets installed on your
system?
Choose the best answer.
a.rpm --all
b.rpm --show-all
c.rpm -q all
d.rpm -qa
e.rpm -la
Question 12/34
How could you describe the following commandline?
foo & bar & foobar
Choose the best answer.
a.The commands foo, bar and foobar are started in the background.
b.The command foo is processed. If it results without error, then bar and foobar are processed.
c.The command foo is processed. If it results without error, then bar will be processed. If bar results without error, foobar will be processed.
d.The commands foo, bar and foobar are processed one after another.
e.The commands foo and bar are started in the background, foobar is started in the foreground
Question 14/34
The textfile foo has got 30 lines of text. How could you extract the lines
11 to 20 to STDOUT?
Choose every correct answer.
a.tail -n 20 | head -n 10 foo
b.tail -n 20 foo | head -n 10
c.head -n 20 foo | tail -n 10
d.head -n 20 | tail -n 10 foo
e.extract -l 11-20 foo
Question 16/34
What would the following command result in?
cp /home/foo/bar /home/bar/foo /foo
Choose the best answer.
a.The files /home/foo/bar, /home/bar/foo, and /foo are copied into the current directory
b.The file /home/foo/bar is copied into the directorys /home/bar/foo and /foo
c.The files /home/foo/bar and /home/bar/foo are copied together in the file /foo
d.The files /home/foo/bar and /home/bar/foo are copied into the directory /foo
e.This isn't a valid commandline
Question 18/34
How could you try to stop a hung process which refuses to accept keyboard input?
Choose every correct answer.
a.Ctrl-C
b.Ctrl-S
c.kill -9 PID
d.kill PID
e.ipcsend SIGKILL PID
Question 19/34
What tool could you use to change the nice value of a running process?
Choose every correct answer.
a.ps
b.top
c.nice
d.renice
e.setpriority
Question 20/34
Which of the following regular expressions fits all words, starting with an
uppercase letter and ending with an d (using grep)?
Choose the best answer.
a.[A-Z]*d
b.[A-Z].*d
c.[A-Z]..d
d.\b[A-Z]*d\b
e.\b[A-Z].*d\b
Question 21/34
What statement concerning the following wildcard is correct?
[A-Z]\*
Choose the best answer.
a.All files beginning with an uppercase letter followed by one *
b.All files beginning with an non numeric letter
c.All files beginning with an uppercase letter followed by the backslash
d.All files without numbers in their names
e.All files beginning with one of the letters A, Z or -
Question 22/34
How many extended partitions could you create on one physical harddisk?
Choose the best answer.
a.1
b.3
c.4
d.16
e.64
Question 23/34
Which command shows you, how much space in Kilobytes is available on all mounted
partitions?
Choose the best answer.
a.df --free_space
b.du
c.df -k
d.free
e.fdisk
Question 24/34
You want your users to be able to mount the CD-Rom on /dev/hdc. What is the
right way to enable them?
Choose the best answer.
a.Change the file permissions of /dev/hdc so that all users can write to this file.
b.Add the SUID-Bit to the /bin/mount command
c.Add the appropriate usernames to /etc/mountusers
d.Add the entry "user,noauto" to the options of the filesystem in /etc/fstab
e.Add the entry "may_mount(/dev/hdc)" into the users line inside /etc/passwd
Question 25/34
How could you get the information, what kind of quota is activated for user
foo?
Choose the best answer.
a.repquota foo
b.repquota --user foo
c.quota foo
d.quota --user foo
e.quotainfo foo
Question 26/34
What is the meaning of the sticky bit applied to a directory?
Choose the best answer.
a.Everybody may read the content of the directory
b.A user with write permission in this directory may not create any file there.
c.A user with write permission in this directory may not remove any file inside the directory if he is not the owner of the file to remove.
d.Any user may remove files inside this directory, even if he is not the owner of the file to remove.
e.Nothing. The sticky bit is only used for regular files.
Question 27/34
What would be the default file permission modes for new files
if you set umask to 027 ?
Choose the best answer.
a.755
b.640
c.720
d.027
e.750
Question 29/34
Which of the following statements are true?
Choose every correct answer.
a.A hardlink uses the same inode than it's original file.
b.Hardlinks may be used for files and directories on the same partition
c.Hardlinks can't point to directories
d.A hardlink has to be in the same directory than it's original file
e.A hardlink may reference any file on the whole system
Question 30/34
Which directory contains the essential commands needed on bootup?
Choose the best answer.
a./usr/bin
b./bin
c./etc
d./boot
e./lib
Question 31/34
What is a X-client
Choose the best answer.
a.a computer which uses the X11 Protocol to communicate
b.a computer which uses a super-computer to run applications which are displayed on the local screen
c.a program which is dispayed on a graphical screen of an X Server
d.a computer which offers displaying on its screen
e.a computer with a graphical user interface using X11
Question 32/34
You want to connect a X11-Terminal to your Server. But everytime you try to
connect, your terminal screen keeps black. What files on the server would you
edit to solve the problem?
Choose every correct answer.
a./etc/X11/XF86Config
b./etc/X11/xdm/x-terminals
c./etc/X11/xdm/xdm-config
d./etc/X11/xdm/Xwilling
e./etc/X11/xdm/Xaccess
Question 1/34
Which harddisks should be used in LBA-mode?
Choose the best answer.
a.Harddisks with more than 1024 cylinders
b.Harddisks with more than 1.2 GByte
c.Harddisks capable of UDMA66
d.IDE-harddisks which are used as master
e.IDE-harddisks which are used as slave
Question 2/34
You want to install a ISA-Plug and Play Card into your computer. Which step is
necessary to use this card with Linux?
Choose the best answer.
a.Nothing, Linux is able to use such cards without any configuration
b.Enter the hardware parameters in /etc/pnp
c.Use isapnp and pnpdump
d.Enter the correct settings in /etc/pnp.conf
e.Linux is not able to use Plug and Play Cards
Question 6/34
You want to compile and install a GNU software package, but you want to
change the default installation target. Which file would you edit?
Choose the best answer.
a.config.h
b.targets
c.configure
d.Makefile
e..config
Question 7/34
You have just installed the new program foobar manually. This program uses
shared libraries, which are installed to /usr/local/foobar/lib.
What is neccesary to do after the installation so that the libraries can be
used?
Choose the best answer.
a.restart your computer
b.run ldconfig
c.edit /etc/ld.so.conf to add the new library path and then run ldconfig
d.edit /etc/ld.so.conf to add the new library path and then run ld.so
e.create symbolic links from every library in /usr/local/foobar/lib to /usr/lib
Question 10/34
What set of scripts is included in a debian packet?
Choose the best answer.
a.install,configure,deinstall,deconfigure
b.preinst,postinst,prerm,postrm
c.install,configure,libinst,libconf
d.checklib,checkdep,checkfree,checkspace
Question 13/34
What would the following command result in?
cp $(find . -size -12k) /tmp
Choose the best answer.
a.The file with the name stored in the variable "find . -size -12k" will be copied to /tmp
b.All files in the current directory which are smaller than 12 KByte will be copied to /tmp
c.All files in the current directory and in all included subdirectories
which are smaller than 12 KByte will be copied to /tmp.
d.All files in the current directory and in all included subdirectories
which are smaller than 12 KByte will be copied to /tmp.
The directorie structure will be copied, too.
e.This isn't a valid command
Question 16/34
You have to move the whole directory-tree /home/foo to /oldusers. What
command would you use?
Choose the best answer.
a.move /home/foo /oldusers
b.mv /home/foo /oldusers
c.mv -r /home/foo /oldusers
d.mv -R /home/foo /oldusers
e.cp --move /home/foo /oldusers
Question 18/34
How could you get a list of all running processes?
Choose every correct answer.
a.ps
b.ps ax
c.getprocess
d.top
e.down
Question 19/34
Which statements are true?
Choose every correct answer.
a.A nice value reaches from 0 to 20
b.Only root can use negative nice values
c.A less nice value means higher priority
d.Nice-values can be changed with the ps-command
e.An even nice-value means high, an odd value low priority
Question 20/34
The user bertha has marked an important line of one of her textfiles with an
asterix (*). But now she forgot the name of the file. How could you find
this file, assuming it is located in berthas home directory?
Choose the best answer.
a.grep * /home/bertha/*
b.grep \* /home/bertha/*
c.grep "/*" /home/bertha/*
d.grep --key=asterix /home/bertha/*
e.grep 0x2A /home/bertha/*
Question 24/34
Consider a unmounted partition /dev/hdc7 should be mounted on /usr/local.
The following entry in /etc/fstab exists:
/dev/hdc7 /usr/local ext2 defaults 1 2
Which command could you use to mount the filesystem?
Choose every correct answer.
a.mount -l /dev/hdc7
b.mount /dev/hdc7
c.mount /dev/hdc7 /usr/local
d.mount /usr/local
e.mount -V /usr/local
Question 25/34
You want to enable all of your users to use about 20 megabyte of diskspace
in their home-directories and about 5 megabyte in /tmp. What action
concerning the partitioning is necessary?
Choose every correct answer.
a./home and /tmp each have to be on a own partition
b.Use qfdisk instead of fdisk to create disk-quota partitions
c.One partition for /home is enough. You can symlink /tmp to /home later
d.Every partition with userquotas have to have the file quota.user on their root
e.Every partition with userquotas need the entry usrquota in the options-field in /etc/fstab
Question 32/34
You want to connect a X11-Terminal to your Server. But everytime you try to
connect, your terminal screen keeps black. What files on the server would you
edit to solve the problem?
Choose every correct answer.
a./etc/X11/XF86Config
b./etc/X11/xdm/x-terminals
c./etc/X11/xdm/xdm-config
d./etc/X11/xdm/Xwilling
e./etc/X11/xdm/Xaccess
Question 3/34
Which command would you use to set the speed of a serial interface?
Choose the best answer.
a.setbaud
b.setspeed
c.setserial
d.setcom
e.set_comport
Question 6/34
You want to install the tarball foobar.tar.bz2. What command would unpack the
achive?
Choose every correct answer.
a.tar x foobar.tar.bz2
b.untar foobar.tar.bz2
c.tar tzvf foobar.tar.bz2
d.tar xjf foobar.tar.bz2
e.bzcat foobar.tar.bz2 | tar xf -
Question 9/34
You are the system administrator of a RedHat box. After checking your
system, you found a file named foobar. What command would you use to get the
information from which rpm packet this file was installed?
Choose the best answer.
a.rpm -qf foobar
b.rpm -f foobar
c.rpm -l foobar
d.rpm -ql foobar
e.rpm -qL foobar
Question 11/34
How can you describe the function of the following commands?
foo < bar | foobar
Choose the best answer.
a.The command foobar gets its input from the command bar
b.The command foo redirects its output to foobar
c.The command bar writes its output into the file foo
d.The command foo gets its input from the file bar and if its exitcode is not 0, the command foobar will be executed
e.The file foo is written by the command "bar | foobar"
Question 14/34
How could you format the textfile foo so that the max. line-length would be
40 characters?
Choose the best answer.
a.format --width=40 foo
b.fmt -w 40 foo
c.chll 40 foo
d.print --line_length=40 foo
e.cat -width 40 foo
Question 16/34
What would be the result of the following command?
cp *.* /tmp
Choose the best answer.
a.All files in the current directory would be copied to /tmp
b.All files in the current directory, which have exactly one dot (.) inside their names would be copied to /tmp
c.All files in the current directory, which have one or more dots (.) anywhere inside their names
but not at the beginning would be copied to /tmp
d.All files in the current directory, which have one or more dots (.) inside their names -
but neither at the begining nor at the end of the name would be copied to /tmp
e.This is a DOS-command - it has no meaning under Linux
Question 17/34
What is the best way to get a running foreground-job in the background?
Choose the best answer.
a.Kill the job using Ctrl-C and restart it in the background using &
b.Suspend the job using Ctrl-Z and restart it in the background using &
c.Suspend the job using Ctrl-Z and restart it in the background using bg
d.Start another shell from another console (or xterm) and send the job a STBG-signal
e.Simply press Ctrl-&
Question 19/34
The __-command starts processes with less priority.
Choose the best answer.
a.less
b.more
c.nice
d.prior
e.startproc
Question 20/34
The user bertha has marked an important line of one of her textfiles with an
asterix (*). But now she forgot the name of the file. How could you find
this file, assuming it is located in berthas home directory?
Choose the best answer.
a.grep * /home/bertha/*
b.grep \* /home/bertha/*
c.grep "/*" /home/bertha/*
d.grep --key=asterix /home/bertha/*
e.grep 0x2A /home/bertha/*
Question 25/34
How could you generate a report of the user quota of /home?
Choose the best answer.
a.repquota /home
b.quotarep /home
c.quota --report /home
d.edquota /home
e.quotaed /home
Question 27/34
How could you help users to create files with serious file permissions?
Choose the best answer.
a.Teach users how to use chmod
b.Use a serious umask setting in the user's profile
c.Change the user's directory permissions
d.Use cron to change the file permissions of the users files once a day
e.Use replacements for the standard unix tools which create secure files
Question 29/34
How could you detect if the file foo and bar are hardlinked together or not?
Choose the best answer.
a.The command "ls --link foo" shows a list of all files which are hardlinked to foo.
b.The command "ls -i foo bar" shows the used inodes of foo and bar. If they are the same, they are linked together.
c.The command "islink foo bar" shows "yes" if the files are linked together, "no" if not.
d.The command "find . --hardlink foo" shows a list of all files which are hardlinked to foo.
e.There is no way to detect this.
Question 31/34
What program is used to tune the screen settings after installing X11?
Choose the best answer.
a.tuneX
b.xvidtune
c.video
d.vconfig
e.vtune
Question 32/34
Most linux systems offer a display manager runlevel. What statement about
this runlevel is true?
Choose the best answer.
a.X11 can be started using startx in this runlevel
b.X11 can be started using xinit in this runlevel
c.X11 is started automaticly for user root
d.X11 is started automaticly an offers a login window
e.This runlevel has nothing to do with X11
Question 2/34
You create a isapnp.conf file using the pnpdump command. When do you have to
call isapnp to read this file?
Choose the best answer.
a.The first time after you have installed the new card
b.Every time you want to access the card
c.Once a day, using cron
d.Every time you start the computer
e.Never
Question 3/34
Which flag would you use with setserial to enable 115 KBit for a serial port?
Choose the best answer.
a.spd_hi
b.spd_vhi
c.spd_shi
d.spd_warp
e.spd_115
Question 14/34
Which of the following commands could be used to search for a particular
term inside a textfile without opening the file?
Choose every correct answer.
a.grep
b.vi
c.ex
d.less
e.sed
answer:a e
Question 21/34
What command would you use to copy all files inside the current directory
which names end with a number to /tmp
Choose the best answer.
a.cp *[:num:] /tmp
b.cp *[0-9] /tmp
c.cp *.[0-9] /tmp
d.cp [*0-9] /tmp
e.cp ?[0-9] /tmp
Question 23/34
While monitoring the integrity of the filesystems, you detect, that there
are no more free inodes left on the /home partition although there are many
megabytes free space. What could be the reason?
Choose the best answer.
a.This is a typical filesystem error on ext2 partitions.
b.A user has created lots of very small files.
c.The inode table is corrupted.
d.There are lots of cross-linked files.
e.The report of many megabytes free space is wrong due to an overflow of the 32 Bit Free-Space-Variable.
Question 24/34
Consider a mounted partition /dev/hdc7 is mounted on /mnt. Which command
could be used to unmount this filesystem?
Choose every correct answer.
a.umount /dev/hdc7
b.unmount /dev/hdc7
c.umount /mnt
d.unmount /mnt
e.mount -u /dev/hdc7
Question 25/34
You want to enable all of your users to use about 20 megabyte of diskspace
in their home-directories and about 5 megabyte in /tmp. What action
concerning the partitioning is necessary?
Choose every correct answer.
a./home and /tmp each have to be on a own partition
b.Use qfdisk instead of fdisk to create disk-quota partitions
c.One partition for /home is enough. You can symlink /tmp to /home later
d.Every partition with userquotas have to have the file quota.user on their root
e.Every partition with userquotas need the entry usrquota in the options-field in /etc/fstab
Question 29/34
In the directory /home/foo exists a file named bar which is a symbolic link
to /etc/services. If you would copy the link to /tmp using the command
cp -d /home/foo/bar /tmp
what would happen?
Choose the best answer.
a.The destination /tmp/bar is a symbolic link to /home/foo/bar
b.The destination /tmp/bar is a symbolic link to /etc/services
c.The destination /tmp/bar is a regular file with the same content as /etc/services
d.The cp command would ask you whether to create a link or a file
e.Nothing. The cp-command is not made for copying links.
Question 30/34
What would the following command search for?
find . -size 25k
Choose the best answer.
a.All files inside the current directory, which are bigger than 25 KBytes
b.All files inside the current directory, which are smaller than 25 KBytes
c.All files inside the current directory and all included subdirectories, which are bigger than 25 KBytes
d.All files inside the current directory and all included subdirectories, which are smaller than 25 KBytes
e.All files inside the current directory and all included subdirectories, which are exactly 25 KBytes big
Question 32/34
Which file would you edit so that the displaymanager ist started automaticly at boottime?
Choose the best answer.
a./etc/inittab
b./etc/X11/XF86Config
c./etc/X11/xdm/xdm-config
d./etc/X11/xdm/Xsession
e./etc/X11/xdm/Xstartup
Question 3/34
Which command would you use to set the speed of a serial interface?
Choose the best answer.
a.setbaud
b.setspeed
c.setserial
d.setcom
e.set_comport
Question 6/34
Which statements concerning the program gunzip are true?
Choose every correct answer.
a.After decompressing a file with gunzip, the compressed file is removed
b.gunzip is a replacement for tar
c.gunzip is a replacement for cpio
d.gunzip is just a link to gzip
e.gunzip is used to extract files from a zip archive
Question 8/34
You want to install the RPM package file foobar.rpm. This file is located
in /home/bob. Which command would you use to install this file?
Choose the best answer.
a.install /home/bob/foobar.rpm
b.rpminst /home/bob/foobar.rpm
c.rpm -i /home/bob/foobar.rpm
d.rpm -e /home/bob/foobar.rpm
e.instrpm /home/bob/foobar.rpm
Question 10/34
What command would you use to get a list of all installed files coming from
a debian packet named foobar?
Choose the best answer.
a.dpkg -l foobar
b.dpkg -L foobar
c.dpkg -ql foobar
d.dpkg -qL foobar
e.dpkg -q --allfiles foobar
Question 14/34
You want to transport a file named foo from one computer to another. The
only media available for transport are floppy-disks. Unfortunately
the size of the file is about 10 Megabytes. Which of the following commands
could you use to solve the problem?
Choose the best answer.
a.cat --split 1.4M foo
b.splitf 1440k foo
c.split -b 1440k foo
d.cut -b1440k foo
e.chunk --size=1440k -f foo
Question 15/34
What command changes tabs to spaces (just the command - no options)?
Type the answer.
answer:expand
Question 18/34
What command offers you a snapshot of the current processes (just the
command - no options)?
Type the answer.
answer:ps? top?
Question 18/34
What command offers you an ongoing look at processor activity in real
time (just the command - no options)?
Type the answer.
answer:top
Question 23/34
What statement about the du-command is true?
Choose the best answer.
a.Dump User - backups all files owned by the named user.
b.Dos Utility - provides different features to handle DOS-filesystems.
c.Dir User - shows the directorys owned by the named user.
d.Disk Usage - shows the amount of diskspace used by the named directories.
e.DOS to Unix - changes the named DOS cr/lf textfile architecture into the cr Unix architecture
Question 24/34
You want your users to be able to mount the CD-Rom on /dev/hdc. What is the
right way to enable them?
Choose the best answer.
a.Change the file permissions of /dev/hdc so that all users can write to this file.
b.Add the SUID-Bit to the /bin/mount command
c.Add the appropriate usernames to /etc/mountusers
d.Add the entry "user,noauto" to the options of the filesystem in /etc/fstab
e.Add the entry "may_mount(/dev/hdc)" into the users line inside /etc/passwd
Question 26/34
The file foo has a permission mode of -rw-------, is owned by user bar and
belongs to group foobar. Which of the following commands would allow members
of the group foobar to read the file?
Choose every correct answer.
a.chmod o+r foo
b.chmod g+r foo
c.chmod +r foo
d.chmod a+r foo
e.chmod 604 foo
Question 31/34
What is a X-server
Choose the best answer.
a.a computer which offers X11-applications
b.a computer which offers the ability to run X11-applications
c.the program which administrates the graphical IO using the X11 protocol
d.any X11 application
e.the program which manages the window borders/colors
answer:b
Question 33/34
You started an X-application with the parameter -display foo:0 but you get
the message "Can't open display". What is the reason?
Choose the best answer.
a.foo is not known, try it with it's IP-address
b.you have to use foo:1 instead of foo:0
c.you must run the command "xhost foo" before the above command
d.you must run "xhost yourcomputer" on foo before the above command
e.you must be root to display something on other computer's screen
Question 11/34
How can you describe the function of the following commands?
foo | tee bar | foobar
Choose the best answer.
a.The command foo redirects its output to the command tee. After that the command bar redirects its output to the command foobar
b.The command foo writes its output to the file tee; the command bar writes its output to the file foobar
c.The command foo redirects its output to the command tee which writes it into the file bar and sends the same further to the command foobar
d.The command foobar gets its input from the command bar which gets its input from the command foo
e.This isn't a valid commandline
Question 20/34
Which of the following tools could be used to search a textfile for a
particular searchstring without opening it with an interactive editor?
Choose every correct answer.
a.vi
b.sed
c.ed
d.grep
e.find
Question 22/34
What is the Partition System ID of a regular Linux Partition? (just the two digits)
answer:83
Question 25/34
How could you get the information, what kind of quota is activated for user foo?
Choose the best answer.
a.repquota foo
b.repquota --user foo
c.quota foo
d.quota --user foo
e.quotainfo foo
Question 29/34
What would be the result of the following command?
ln /bin /bin2
Choose the best answer.
a.A hardlink /bin2 would be created, referencing the directory /bin
b.A symbolic link /bin2 would be created, referencing the directory /bin
c.A directory /bin2 would be created, which contains hardlinks to every file in /bin
d.A directory /bin2 would be created, which contains symbolic links to every file and subdirectory in /bin
e.Nothing, but an error message
Question 2/34
You create a isapnp.conf file using the pnpdump command. When do you have to
call isapnp to read this file?
Choose the best answer.
a.The first time after you have installed the new card
b.Every time you want to access the card
c.Once a day, using cron
d.Every time you start the computer
e.Never
Question 3/34
Which flag would you use with setserial to enable 115 KBit for a serial port?
Choose the best answer.
a.spd_hi
b.spd_vhi
c.spd_shi
d.spd_warp
e.spd_115
Question 5/34
When do you need to rerun the grub-install command?
Choose every correct answer.
a.After every boot
b.After every modification of the grub configuration file
c.After installing a new kernel with a new name in /boot
d.After overwriting the old kernel in /boot with a new one
e.Only the first time after installing GRUB
Question 7/34
Which programm is used to maintain the file /etc/ld.so.cache?
Choose the best answer.
a.ld.so
b.ldcache
c.ldd
d.ldconfig
e.libconf
Question 8/34
You want to deinstall a deb packet foobar from your system. What would be a proper command?
Choose every correct answer.
a.remove foobar
b.remove foobar.deb
c.dpkg -r foobar
d.dselect foobar
e.apt-get remove foobar
Question 9/34
You are the system administrator of a RedHat box. After checking your
system, you found a file named foobar. What command would you use to get the
information from which rpm packet this file was installed?
Choose the best answer.
a.rpm -qf foobar
b.rpm -f foobar
c.rpm -l foobar
d.rpm -ql foobar
e.rpm -qL foobar
Question 14/34
Which of the following commands could be used to turn all characters inside a
textfile into uppercase without opening the file in an editor?
Choose every correct answer.
a.upcase
b.recode
c.sed
d.tr
e.vi
Question 15/34
What command sorts its input stream in alphabetic order (just the command - no options)?
Type the answer.
Question 18/34
How could you try to stop a hung process which refuses to accept keyboard input?
Choose every correct answer.
a.Ctrl-C
b.Ctrl-S
c.kill -9 PID
d.kill PID
e.ipcsend SIGKILL PID
Question 19/34
What command starts processes with higher or lower priority?
Type the answer.
Question 20/34
Which of the following tools could be used to search a textfile for a
particular searchstring without opening it with an interactive editor?
Choose every correct answer.
a.vi
b.sed
c.ed
d.grep
e.find
Question 22/34
/dev/____ ist the first logical partition of the slave on the second
IDE-channel.
Type the answer.
Question 23/34
Which command shows you, how much space is available on all mounted
partitions?
Choose the best answer.
a.df
b.df --free_space
c.du
d.free
e.fdisk
Question 24/34
You've bought a new harddisk and installed it in your Linux box as master on
the second IDE-channel. After partitioning it into two primary partitions
and creating filesystems on both partitions, you want to ensure, that both
new partitions will be mounted automatically on bootup. What is to do?
Choose the best answer.
a.Add an entry for /dev/hdc1 and /dev/hdc2 to /etc/mtab
b.Add an entry for /dev/hdc to /etc/mtab
c.Add an entry for /dev/hdc1 and /dev/hdc2 to /etc/fstab
d.Add an entry for /dev/hdc to /etc/fstab
e.Nothing. The system looks up all partitions at bootup
Question 25/34
The user foo has got a userquota of 20 megabyte in his home directory. Now
you want to give him 40 megabyte instead. What is to do?
Choose the best answer.
a.Edit the file /home/quota.user with an editor
b.Edit the entry for /home in /etc/fstab
c.Use the command repquota foo
d.Use the command edquota foo
e.Use the command addquota foo 20M
Question 26/34
What is the meaning of the Substitute Group ID Bit applied to a directory?
Choose the best answer.
a.Every file created inside this directory will be owned by the group of the directory instead of the group of the creating user.
b.Every user inside the directory has the rights of the group of the directory.
c.Only members of the group of the directory can create files inside the directory,
even if they otherwise would have the right to write inside the directory.
d.A user with write permission in this directory may not remove any file inside.
e.Nothing. The SGID bit is only used for regular files.
Question 29/34
In the directory /home/foo exists a file named bar which is a symbolic link
to the file foobar in the same directory, created with the command
ln -s foobar bar
If you would copy the link to /tmp using the command
cp -d /home/foo/bar /tmp
what would happen?
Choose the best answer.
a.The destination /tmp/bar is a symbolic link to /tmp/foobar
b.The destination /tmp/bar is a symbolic link to /home/foo/foobar
c.The destination /tmp/bar is a regular file with the same content as /home/foo/foobar
d.The destination /tmp/bar is a hardlink using the same inode as /home/foo/foobar
e.The destination /tmp/bar is a hardlink using the same inode as /home/foo/bar
Question 31/34
Which of the following programs can be used to configure your X-Server?
Choose every correct answer.
a.xconfig
b.xf86config
c.XF86Setup
d.XConfig
e.X11Config
Question 33/34
You started an X-application with the parameter -display foo:0 but you get
the message "Can't open display". What is the reason?
Choose the best answer.
a.foo is not known, try it with it's IP-address
b.you have to use foo:1 instead of foo:0
c.you must run the command "xhost foo" before the above command
d.you must run "xhost yourcomputer" on foo before the above command
e.you must be root to display something on other computer's screen
Question 2/34
You create a isapnp.conf file using the pnpdump command. When do you have to
call isapnp to read this file?
Choose the best answer.
a.The first time after you have installed the new card
b.Every time you want to access the card
c.Once a day, using cron
d.Every time you start the computer
e.Never
Question 3/34
Which flag would you use with setserial to enable 115 KBit for a serial port?
Choose the best answer.
a.spd_hi
b.spd_vhi
c.spd_shi
d.spd_warp
e.spd_115
Question 5/34
When do you need to rerun the grub-install command?
Choose every correct answer.
a.After every boot
b.After every modification of the grub configuration file
c.After installing a new kernel with a new name in /boot
d.After overwriting the old kernel in /boot with a new one
e.Only the first time after installing GRUB
Question 7/34
Which programm is used to maintain the file /etc/ld.so.cache?
Choose the best answer.
a.ld.so
b.ldcache
c.ldd
d.ldconfig
e.libconf
Question 8/34
You want to deinstall a deb packet foobar from your system. What would be a proper command?
Choose every correct answer.
a.remove foobar
b.remove foobar.deb
c.dpkg -r foobar
d.dselect foobar
e.apt-get remove foobar
Question 9/34
You are the system administrator of a RedHat box. After checking your
system, you found a file named foobar. What command would you use to get the
information from which rpm packet this file was installed?
Choose the best answer.
a.rpm -qf foobar
b.rpm -f foobar
c.rpm -l foobar
d.rpm -ql foobar
e.rpm -qL foobar
Question 10/34
What command is used to reconfigure a formerly installed debian packet.
Enter just the name without path and options.
Type the answer.
Question 13/34
What would the following command result in?
cp `find . -size -12k` /tmp
Choose the best answer.
a.The file with the name "find . -size -12k" will be copied to /tmp
b.All files in the current directory which are smaller than 12 KByte will be copied to /tmp
c.All files in the current directory and in all included subdirectories which are smaller than 12 KByte will be copied to /tmp.
d.All files in the current directory and in all included subdirectories which are smaller than 12 KByte will be copied to /tmp.
The directory structure will be copied, too.
e.This isn't a valid command
Question 14/34
Which of the following commands could be used to turn all characters inside a
textfile into uppercase without opening the file in an editor?
Choose every correct answer.
a.upcase
b.recode
c.sed
d.tr
e.vi
Question 15/34
What command sorts its input stream in alphabetic order (just the command - no options)?
Type the answer.
Question 18/34
How could you try to stop a hung process which refuses to accept keyboard input?
Choose every correct answer.
a.Ctrl-C
b.Ctrl-S
c.kill -9 PID
d.kill PID
e.ipcsend SIGKILL PID
Question 19/34
What command starts processes with higher or lower priority?
Type the answer.
Question 20/34
Which of the following tools could be used to search a textfile for a
particular searchstring without opening it with an interactive editor?
Choose every correct answer.
a.vi
b.sed
c.ed
d.grep
e.find
Question 22/34
/dev/____ ist the first logical partition of the slave on the second
IDE-channel.
Type the answer.
Question 23/34
Which command shows you, how much space is available on all mounted
partitions?
Choose the best answer.
a.df
b.df --free_space
c.du
d.free
e.fdisk
Question 24/34
You've bought a new harddisk and installed it in your Linux box as master on
the second IDE-channel. After partitioning it into two primary partitions
and creating filesystems on both partitions, you want to ensure, that both
new partitions will be mounted automatically on bootup. What is to do?
Choose the best answer.
a.Add an entry for /dev/hdc1 and /dev/hdc2 to /etc/mtab
b.Add an entry for /dev/hdc to /etc/mtab
c.Add an entry for /dev/hdc1 and /dev/hdc2 to /etc/fstab
d.Add an entry for /dev/hdc to /etc/fstab
e.Nothing. The system looks up all partitions at bootup
Question 25/34
The user foo has got a userquota of 20 megabyte in his home directory. Now
you want to give him 40 megabyte instead. What is to do?
Choose the best answer.
a.Edit the file /home/quota.user with an editor
b.Edit the entry for /home in /etc/fstab
c.Use the command repquota foo
d.Use the command edquota foo
e.Use the command addquota foo 20M
Question 26/34
What is the meaning of the Substitute Group ID Bit applied to a directory?
Choose the best answer.
a.Every file created inside this directory will be owned by the group of the directory instead of the group of the creating user.
b.Every user inside the directory has the rights of the group of the directory.
c.Only members of the group of the directory can create files inside the directory,
even if they otherwise would have the right to write inside the directory.
d.A user with write permission in this directory may not remove any file inside.
e.Nothing. The SGID bit is only used for regular files.
Question 29/34
In the directory /home/foo exists a file named bar which is a symbolic link
to the file foobar in the same directory, created with the command
ln -s foobar bar
If you would copy the link to /tmp using the command
cp -d /home/foo/bar /tmp
what would happen?
Choose the best answer.
a.The destination /tmp/bar is a symbolic link to /tmp/foobar
b.The destination /tmp/bar is a symbolic link to /home/foo/foobar
c.The destination /tmp/bar is a regular file with the same content as /home/foo/foobar
d.The destination /tmp/bar is a hardlink using the same inode as /home/foo/foobar
e.The destination /tmp/bar is a hardlink using the same inode as /home/foo/bar
Question 31/34
Which of the following programs can be used to configure your X-Server?
Choose every correct answer.
a.xconfig
b.xf86config
c.XF86Setup
d.XConfig
e.X11Config
Question 33/34
You started an X-application with the parameter -display foo:0 but you get
the message "Can't open display". What is the reason?
Choose the best answer.
a.foo is not known, try it with it's IP-address
b.you have to use foo:1 instead of foo:0
c.you must run the command "xhost foo" before the above command
d.you must run "xhost yourcomputer" on foo before the above command
e.you must be root to display something on other computer's screen
Question 3/34
Which flag would you use with setserial to enable 115 KBit for a serial port?
Choose the best answer.
a.spd_hi
b.spd_vhi
c.spd_shi
d.spd_warp
e.spd_115
answer:b
Question 6/34
You want to compile and install a GNU software package, but you want to
change the default installation target. Which file would you edit?
Choose the best answer.
a.config.h
b.targets
c.configure
d.Makefile
e..config
answer:d
Question 7/34
Which programm is used to maintain the file /etc/ld.so.cache?
Choose the best answer.
a.ld.so
b.ldcache
c.ldd
d.ldconfig
e.libconf
answer:d
Question 11/34
How can you describe the function of the following commands?
foo | bar > foobar
Choose every correct answer.
a.The command foobar gets its input from the command bar
b.The command bar writes its output to the file foobar
c.The command foo writes its output to the file bar
d.The command foo redirects its output to the command bar
e.STDIN of foo is connected to STDOUT of bar
answer:b d
Question 12/34
How could you describe the following commandline?
foo || bar
Choose the best answer.
a.The command foo redirect its output to the command bar.
b.The command foo writes its output into the file bar.
c.The command bar is only processed if the command foo leaves without error.
d.The command bar is only processed if the command foo leaves with an error.
e.This isn't a valid commandline
answer:d
Question 14/34
How could you get the number of all accounts on your system, including
administrative and system accounts?
Choose the best answer.
a.numusers -r
b.wc -l /etc/passwd
c.count --lines /etc/passwd
d.userinfo -n
e.userinfo --get_num
answer:b
Question 17/34
How would you suspend a running foreground-job?
Choose the best answer.
a.Ctrl-Z
b.Ctrl-C
c.Ctrl-X
d.Ctrl-S
e.Ctrl-D
answer:a
Question 20/34
How could you display all lines of text from the file foo which are not
empty?
Choose the best answer.
a.grep ".*" foo
b.grep -v ^$ foo
c.grep -v ^\r\n foo
d.grep -v \r\n foo
e.grep -v "[]" foo
answer:b
Question 23/34
What statement about the du-command is true?
Choose the best answer.
a.Dump User - backups all files owned by the named user.
b.Dos Utility - provides different features to handle DOS-filesystems.
c.Dir User - shows the directorys owned by the named user.
d.Disk Usage - shows the amount of diskspace used by the named directories.
e.DOS to Unix - changes the named DOS cr/lf textfile architecture into the cr Unix architecture
answer:d
Question 25/34
How could you generate a report of the user quota of /home?
Choose the best answer.
a.repquota /home
b.quotarep /home
c.quota --report /home
d.edquota /home
e.quotaed /home
answer:a
Question 26/34
What ist the numeric value of the permission mode drwxr-xr-T
Type the answer.
answer: 1754
小心SUID,SGID和Sticky Bit的設定意義!
s,t的大小寫也是有差異的,在我實機操作的心得,
像這一題,o沒給x,卻設定了Sticky Bit,所以`ls -l`的結果,會出現大寫的T。
如果o有給x,那麼會出現t,差異是看得出來的。
所以,我認為如果題目有出現S或T,就是沒有給對應的x權限。
也就是你說,雖然設定了SUID,SGID或是Sticky Bit,但是...無效!
對!你沒看錯,本人宣判無效!
我舉例來說明,你要給一個目錄執行權限o+x,別的使用者才能進入該目錄進行開檔或開子目錄,
沒給x卻設Sticky Bit,別人沒法進去開檔或開子目錄,那不是沒用嗎?
Do you know what I mean?
老師在講,你有沒有在聽!有!Good!那你就有「可能」過了?哈哈!
還有,再強調一下,SUID只對執行檔有效,而Sticky Bit只對目錄有用!
但SGID,是對檔案(執行檔)以及目錄都可以用。切記!切記!
Question 26/34
What permissions need the files /etc/passwd and /etc/shadow?
Choose the best answer.
a.-rw-r--r--/-rw-r--r--
b.-rw-r--r--/-rw-------
c.-rw-rw-rw-/-rw-rw-r--
d.-rwsr--r--/-rw-------
e.-rwxr--r--/-rw------t
answer:b
你有沒發現,玩linux的人,大都知道root是神聖不可「濫用」的!
但為了玩linux,還是「濫用」了root這個身份。因為用root才能玩得比較爽吧!
linux有SUID這個檔案屬性,就是為了不讓root被濫用而產生。
你可以用一般的身份,執行passwd指令來變更你自己的密碼,
就是因為passwd這個命令,它是個可被執行的檔案,
透過設定了SUID,讓它有被非root卻能以root身份來執行的效果。
可是,注意!
題目是問/etc/passwd 和/etc/shadow兩個檔案的權限屬性,應該是長什麼樣子?
和使用passwd命令有啥關係?
哈,我或許是離題了,但我一定會給大家一個交代的,放心。
回歸正題,/etc/passwd是放所有帳號資料的,
而/etc/shadow是把/etc/passwd的密碼欄位再加密而產生的檔案。
在用途上來說,這兩個檔案肯定是給root用(擁有者,群組),當然有給root讀寫的權限。
但要讓一般使用帳號也能查一下帳號資訊,所以/etc/passwd也是要給o+r權限的,
至於/etc/shadow就不必讓一般使用帳號查看了!
看看選項,就b和d能選而己了。
但是,就是有人會自做聰明,像我一開始就是這樣!
把SUID的觀念拿來這個題目用,選了d,大錯特錯!
等我稍微冷靜下來,仔細一瞧...
哇考!/etc/passwd可不是什麼執行檔耶,/usr/bin/passwd才是!
那個小s看起來,好像很誘人,但卻是陷阱一個。
人客啊!你懂了我要強調什麼嗎?
有時出題的人就是賤,挖洞給人跳!愛注意哦!
`ls -l /etc/passwd /etc/shadow /usr/bin/passwd`看看權限的設定,
不一定要背,但root身份的使用觀念,和SUID,SGID,Sticky Bit使用時機,要注意!
Question 27/34
What would be the default file permission modes for new files
if you set umask to 022 ?
Choose the best answer.
a.755
b.644
c.022
d.220
e.550
answer:b
這題在考檔案和目錄的開立基本權限觀念,
檔案是666,目錄是777,經過umask計算,得出你要的解答。
根據很多考試的經驗談,用二進位的算法,要比十進位的算法來得準確。
以下說明:
十進位表示法 = 二進位表示法
1=001
2=010
3=011
4=100
5=101
6=110
7=111
十進位的算法,很簡單就是用減法!
這一題用十進位來算還OK,666-022=644,結束。
但若是用二進位來算,會比較複雜些,但是只要搞懂,
連網路IP的相關運算也可以舉一反三,融會通哦!
二進位的運算,會先做umask值的NOT運算,
於是022即000:010:010,NOT成111:101:101,
然後再和檔案的基本權限666即110:110:110,AND成110:100:100。
而110:100:100再換回十進位表示,即644!嘿,和十進位算法結果同。
乍看之下,好像二進位的運算反而容易讓人迷惑,難解。
但要知道,電腦的運作,就是101010,1和0訊號的組成,
所以二進位這種電腦的語言,是我們這種想要駕馭電腦的人,必須搞懂的。
不然考認證是要幹嘛?用電腦!只要會開機關機,然後會打打字,
動動滑鼠,出問題就叫人來修,不就好了!
會用二進位計算檔案或目錄的權限屬性,絶對是必要的!
若是有個題目是要算umask 033產生的檔案權限,而你是直接以十進位的方式算,得出633就大錯特錯了!
因為033換成二進位是000:011:011,那麼666(110:110:110)去做遮罩運算的結果,
111:100:100 AND 110:110:110 = 110:100:100
換成十進位,還是644!不會是633的!
一定要懂哦!不然你LPIC102別玩了...
Question 30/34
You (as a normal user) have created a new file named foo inside /tmp. But if you try to find
this file using the command
locate foo
there is no result. What is the reason?
Choose the best answer.
a.The /tmp directory is not searched by locate
b.locate only looks for commands inside the searchpath of the shell (PATH)
c.Only the superuser (root) may use locate in /tmp
d.locate only searches the system-database. The command will work after the next run of updatedb.
e.You have no search-permission for /tmp
answer:d
這題在考搜尋檔案的技巧!
主要是強調locate和updatedb這兩個指令的關係。
像whereis指令和which指令這兩個是由PATH來找執行檔,其中whereis還可以找到man-page等文件。
而locate指令是由updatedb程式來控制,決定要去把那些路徑的檔案,建成像資料庫一樣,好方便找檔案。
locate有個觀念!就是你剛新增好一個檔案,用locate是找不到的,
非要執行過updatedb後,才能找到你剛新增的檔案!
而updatedb指令,通常在你的unik-like OS中,己內建排程了,每天都會定時更新一次!
還有,updatedb對soft link的檔案無效!
Question 32/34
Which of the following programs are valid display managers for X11?
Choose every correct answer.
a.xdisplaymanager
b.xdm
c.gtkm
d.gdm
e.kdm
f.fdm
answer: b d e
我看了不少文件,才知道Window Manager(wm)和Display Manager(dm)的差異!
像twm,fvwm,enlightment...是Window Manager(wm),而像KDE以及GNOME是Display Manager(dm)。
KDE和GNOME整合了許多X-client軟體,建構成一套完整的X-window系統,可比美M$ windows、Apple MAC...
而Window Manager(wm)就想成是讓你的X-client AP執行得比較「好看」的一個套件。
相對於Display Manager,Window Manager的層級比較小一些,算是個小套件吧!
目前除了KDE(KDM)和GNOME(GDM)外,還有比較陽春,發展最早最原始的XDM。
所以這題的答案就是xdm,gdm,kdm。這三個。
我再進一步說明,KDM(Display Manager)本身是配合kwm來管理X-client,當然也可以用twm或fvwm等Window Manager。
他們的層次不同,你有概念了嗎!
Question 33/34
You want to run an X-application on your local machine but it should display
itself on the first display-server of foo. The command is
"xapplication -display __________"
(Don't use screennumbers)
Type the answer.
在鳥哥的書中(基礎第二版),有提到X-window的相關技術,以相當陽春的方式來跑X-window。
我簡單說明,我的測試步驟。
首先,我在我己經執行的GNOME中,開啓一個xterm。
用來執行我要在另一個Virtual Console跑的X-window,
因為己經可以跑GNOME,所以在xfree86或是xorg等的設定檔,可以確信是沒問題的!
#X :1 2> /dev/zero &
讓X-server跑起來,如果有錯誤,先把它導不見,不管。
因為我己經有GNOME這個X-window了,
大部份的linux把它跑在tty7(Ctrl+Alt+F7),用的port是6000。
所以我若是跑第二個X-window,可能是tty8(Ctrl+Alt+F8)或tty9(Ctrl+Alt+F9),
甚至是之後的Virtual Console。要看你的linux設計架構!
我是用Ubuntu 7.04 ,而鳥哥是用Fedora Core4。
嗯!確定在tty9,port6001。
看到一個醜醜的畫面,中間一個叉叉,表示有正確套用螢幕和顯示,滑鼠等驅動設定。
因為什麼也沒有,所以我們要切回tty7(Ctrl+Alt+F7)!
繼續...
#xterm -display :1 &
哈,有X-server之後,當然要來個X-client執行看看!
回tty9(Ctrl+Alt+F9),看看執行結果。
嘿嘿,成功跑出一個真的很簡單的terminal畫面。
不過,它就是死板板的,不能移動,也不能變更大小。
OK!回到tty7(Ctrl+Alt+F7),繼續往下走...
#twm -display :1 2> /dev/zero &
給它一個Window Manager,要是有錯誤,也先別管它。
我們用最陽春的twm就好,太複雜的WM套件,反而錯誤更多。
其實這個指令可以在tty9執行,只要別把 -display 參數省略了就好。
有了Window Manager之後,我們總算可以變更xterm的大小了。
這個xterm和其他Virtual Console的效果是同樣的哦!
執行一些指令看看,就和在GNOME環境一模一樣。
按Ctrl+Alt+Backspace就能把這個X-server幹掉,
當然,你幹掉了X-server,X-client也跟著沒有了!
以上三個指令,一定要丢背景執行,不然你的terminal就掛在那裡,沒辦法往下玩了。
說了一大堆,答案到底是什麼?
answer: :0(冒號然後零)
驚!真的嗎?
有人會說,為什麼沒有用foo!Why?
我沒搞懂前,本來是寫 foo :0 (foo空一格再來才是冒號然後零)。
但看過一些文件後,尢其是鳥哥這個範例,我認為是 :0 (冒號然後零)就可以。
細心的人可能有注意到,鳥哥的範例就是在local machine跑的。
而用local machine是不用打主機名稱的。了嗎?