模 擬 測 驗 二

1. How can you describe the function of the following commands? foo | xargs bar
(1) The command foo redirects its output to the command xargs. xargs writes its output to bar
(2) The command foo redirects its output to the command xargs. After that the command bar is started
(3) The command xargs gets its input by the file foo and writes its output to the file bar
(4) The command bar is started with the output of the command foo as parameters
(5) The command foo is started with the output of the command bar as parameters

2. 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.
(1) upcase
(2) recode
(3) sed
(4) tr
(5) vi

3. What would the following command result in? cp /home/foo/bar /home/bar/foo /foo
Choose the best answer.
(1) The files /home/foo/bar, /home/bar/foo, and /foo are copied into the current directory
(2) The file /home/foo/bar is copied into the directorys /home/bar/foo and /foo
(3) The files /home/foo/bar and /home/bar/foo are copied together in the file /foo
(4) The files /home/foo/bar and /home/bar/foo are copied into the directory /foo
(5) This isn't a valid commandline

4. What set of files would be affected by the following wildcard? foo.*bar
Choose every correct answer.
(1) foo.bar foo.1bar foo.2bar
(2) foobar foo.2bar foo.34bar
(3) foo.1bar foo.2bar foo.Fbar
(4) foo.1bar foo.2bar Foo.3.bar
(5) foobar foo1bar foo2bar

5. 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.
(1) chmod o+r foo
(2) chmod g+r foo
(3) chmod +r foo
(4) chmod a+r foo
(5) chmod 604 foo

6.How could you change the group membership of the file foobar to group foo?
Choose the best answer.
(1) chown foo foobar
(2) chgrp foo foobar
(3) chgroup foo foobar
(4) chgrp foobar foo

7. What command sorts its input stream in alphabetic order (just the command - no options)?

8. /dev/____ ist the first logical partition of the slave on the second IDE-channel.

9. What command is used to display a textfile in reversed order?just the command,no options .

10. How can you describe the function of the following commands?複選
foo | bar >foobar
(1) The command foobar gets its input from the command bar
(2) The command bar writes its output to the file foobar
(3) The command foo writes its output to the file bar
(4) The command foo redirects its output to the command bar
(5) STDIN of foo is connected to STDOUT of bar

11. What would be the default file permission modes for new files if you set umask to 022?
(1) 755
(2) 644
(3) 664
(4) 220
(5) 550

12. Which of the following directorys have to be placed on the root partition?
複選
(1) /tmp
(2) /etc
(3) /var
(4) /bin
(5) /boot


1. What would the following command result in?
echo $(date +%H:%M)>file
(1) The string “date +%H:%M” will be written into the file.
(2) The content of the variable named “date +%H:%M” will be written into the file.
(3) The current time will be written into the file.
(4) This isn’t a valid command.

2. How would you get the number of all accounts on your system,including administrative and system accounts?
(1) numusers –r
(2) wc –l /etc/passwd
(3) count --lines /etc/passwd
(4) userinfo –n
(5) userinfo --get_num

3. What would be the result of the following command?
cp *.* /tmp
(1) All files in the current directory would be copied to /tmp
(2) All files in the current directory,which have exactly one dot inside their names would be copied to /tmp
(3) 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
(4) All files in the current directory,which have one or more dots inside their names – but neither at the beginning nor at the end of the name would be copied to /tmp

4. Which command is not usable to install debian packages?
(1) dpkg
(2) dselect
(3) apt-get
(4) dinst

5. What tool could you use to change the nice value of a running processes?複選
(1) ps
(2) top
(3) nice
(4) renice
(5) setpriority

6. Which of the following statements are true?複選
(1) The LBA-mode of a harddisk is used to turn on DMA or UDMA
(2) A harddisk with more than 1024 cylinders should be used in LBA-mode
(3) A harddisk with more than 1.2 GByte capacity can only be used in LBA-mode
(4) LBA-mode does not change the capacity of a harddisk
(5) A harddisk with more than 1024 cylinders can't be mounted without LBA-mode

7. Which of the following commands copies the contents of all files in the current directory into the “allfiles”?複選
(1) cp * allfiles
(2) cat * > allfiles
(3) cp * >allfiles
(4) cat * >> allfiles
(5) cat * allfiles

8. You want to install the tarball foobar.tar.gz,what command would unpack the archive? 複選
(1) tar x foobar.tar.gz
(2) untar foobar.tar.gz
(3) tar tzvf foobar.tar.gz
(4) tar xzf foobar.tar.gz
(5) zcat foobar.tar.gz | tar xf –

9. What command starts processes with higher or lower priority?

10. 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?
(1) This is a typical filesystem error on ext2 partitions
(2) A user has created lots of very small files.
(3) The inode table is corrupted
(4) There are lots of cross-linked files.
(5) The report of many megabytes free space is wrong due to an overflow of the 32 Bit Free-Space-Variable.

11. How could you generate a report of the user quota of /home?
(1) repquota /home
(2) quotarep /home
(3) quota --report /home
(4) edquota /home
(5) quotaed /home

12. User Bertha is member of different groups. How could you ensure, that her default group is foobar?
(1) Add the line "chgrp foobar" inside her startup script
(2) Ensure that the groupname foobar is the first entry in her /etc/group line
(3) Ensure that the GID of foobar is placed in her /etc/passwd entry
(4) Ensure that the GID of foobar is the lowest GID of all her GIDs
(5) Ensure that the GID of foobar is the highest GID of all her GIDs

13. What would the following command search for?
find . -size 25k
(1) All files inside the current directory, which are bigger than 25 KBytes
(2) All files inside the current directory, which are smaller than 25 KBytes
(3) All files inside the current directory and all included subdirectories, which are bigger than 25 KBytes
(4) All files inside the current directory and all included subdirectories, which are smaller than 25 KBytes
(5) All files inside the current directory and all included subdirectories, which are exactly 25 KBytes big

14. When do you need to run the lilo command?複選
(1) After every boot
(2) After every modification of the lilo configuration file
(3) After installing a new kernel with a new name in /boot
(4) After overwriting the old kernel in /boot with a new one
(5) Only the first time after installing LILO

15. What device is described by the following special file? /dev/hdb2
(1) The slave on the second IDE-channel
(2) The second logical partition of the master on the first IDE-channel
(3) The second primary partition of the slave on the first IDE-channel
(4) The second bootsector of the master on the first IDE-channel
(5) The second primary partition of the master on the second IDE-channel

16. 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 /home/foo/bar /tmp
what would happen?
(1) The destination /tmp/bar is a symbolic link to /home/foo/bar
(2) The destination /tmp/bar is a symbolic link to /etc/services
(3) The destination /tmp/bar is a regular file with the same content as /etc/services
(4) The cp command would ask you whether to create a link or a file
(5) Nothing. The cp-command is not made for copying links.

17.What file includes the information about all currently mounted filesystems?
(give the whole path and filename)

18.You want to install the debian package file foobar.deb. This file is located in /home/bob. Which command would you use to install this file?
Choose the best answer.
1. install /home/bob/foobar.deb
2. apt-get install /home/bob/foobar.deb
3. debinst -f /home/bob/foobar.deb
4. dpkg -i /home/bob/foobar.deb
5. dselect /home/bob/foobar.deb

19.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.
1. rpm -ql /home/bob/foobar.rpm
2. rpm -ql -p /home/bob/foobar.rpm
3. rpm -l /home/bob/foobar.rpm
4. rpm -l -p /home/bob/foobar.rpm

20.How could you describe the following commandline?
foo; bar; foobar
Choose the best answer.
1. The commands foo, bar and foobar are processed at the same time.
2. The commands foo, bar and foobar are processed one after another.
3. The command foo is processed. If it results without error, then bar and foobar are processed.
4. The command foo is processed. If it results without error, then bar will be processed. If bar results without error, foobar will be processed.
5. This isn't a valid commandline

21.What statement describes the following command?
kill 9 1234
Choose the best answer.
1. The processes with the PID 9 and 1234 are killed
2. The TERM signal is sent to the processes with the PID 9 and 1234
3. The KILL signal is sent to the process with PID 1234
4. All processes of the user with the UID 1234 are killed
5. The process with the PID 1234 receives the TERM-signal nine times

22.What statement about the du-command is true?
Choose the best answer.
1. Dump User - backups all files owned by the named user.
2. Dos Utility - provides different features to handle DOS-filesystems.
3. Dir User - shows the directorys owned by the named user.
4. Disk Usage - shows the amount of diskspace used by the named directories.
5. DOS to Unix - changes the named DOS cr/lf textfile architecture into the cr Unix architecture

23.The user foo has reported problems creating files in his home directory. He has got a user quota of 40 megabyte but a quick check of his directory shows only 20 megabyte in use. What may be the reason?
Choose the best answer.
1. He has hidden 60 megabytes inside a hush directory.
2. The quota file is corrupt
3. Quotas are counted in 512-blocks. So he has really only 20 megabyte quota
4. He has probably many small files and his file limit is exceeded
5. He has too many symbolic links to big files

24.How could you read the current umask setting?
Choose the best answer.
1. umask --show
2. echo $UMASK
3. echo $umask
4. umask

25.You create a symbolic link bar which points to the file foo. If you remove
the file foo, what happens?
Choose the best answer.
1. The link is automaticly removed, too
2. The link exists but any access would lead to an error
3. The link exists and it is possible to have access to it's content
4. The link is automaticly changed into a regular file with the content of foo.
5. The link but not the file was removed.

26.Which of the following statements concerning locate is true?
Choose the best answer.
1. locate can find any file in the system which was created before the last call of updatedb
2. locate can find only program files inside the searchpath (PATH)
3. locate is used to locate manpages inside the MANPATH
4. locate can find any file in the system which was created after the last call of updatedb
5. locate is used to find the original file of a hard or symbolic link

27. 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
1. config.h
2. targets
3. configure
4. Makefile
5. .config

28. Which program is used to determine which shared libraries are used by a particular other program?

29. How would you suspend a running foreground-job?
Choose the best answer.
1. Ctrl-Z
2. Ctrl-C
3. Ctrl-X
4. Ctrl-S
5. Ctrl-D

30.Which statements concerning the tool renice are true?
Choose every correct answer.
1.A normal user may only change the nice values of his own processes.
2.A normal user can decrease the nice value of his own processes.
3.Once a nice value is increased, a normal user may not decrease it, even if it is his own process.
4.root can change the nice-values of all processes of one user with a single command.
5.renice allows a normal user to fasten his processes.