LPIC exam 101 trainer

By Pygmalion  
 
These questions are intended to help you train for the LPI exam. Please note that they are not official exam questions. 
 
1. You're processing a file 'allmostempty.txt' with lots of empty lines. You want to get rid of these empty lines as they are totally useless for your purpose. Which command would be your best choice?
 
grep -v '^$' < allmostempty.txt
sed 's/^$//' < allmostempty.txt
grep '.+' < allmostempty.txt
sed -e '.+' < allmostempty.txt
 
2. Which of the following can be used to alter the priority of a running process?
 
top
renice
nice
cprio
kill
 
3. How would you install GRUB (Legacy) on the MBR of the first hard drive in a system?
 
grub-install '(hd1,1)'
grub-install '(hd1)'
grub-install '(hd0,0)'
grub-install '(hd0)'
 
4. You are formatting a single hard disk for a Linux install. What is the maximum number of primary partitions you can create?
 
1
2
4
15
16
 
5. After you connect your usb cd writer, nothing happens. What should you check?
 
See if /proc/bus/usb is mounted
List loaded kernel modules
Check /var/log/messages
All of the above
 
6. What option will cause the tail command to display new lines as the file grows?
 
-n
-f
-l
-r
 
7. You want to list file foo.txt line by line, but in reverse order. What command would you use?
 
ls -r foo.txt | cat
cat -r foo.txt
tac foo.txt
cat foo.txt | ls -r
 
8. In which directory must definition files be placed to add additional repositories to yum?
 
/etc/yum.cache.d
/etc/yum.repos.d
/etc/yum.conf
/etc/yum/sources.list
 
9. Your system is becoming a bit unreponsive due to a program with PID 9519. You don't want to kill it. What other option do you have?
 
nice +10 -p 9519
nice -10 -p 9519
renice +10 -p 9519
renice -10 -p 9519
 
10. In GRUB's configuration file you find the line 'root (hd1,4)'. What is the corresponding device name on a Linux system?
 
/dev/hda4
/dev/hda5
/dev/hdb4
/dev/hdb5