LPI 101 Certification Practice Test

1.3/1/1multiple alphabetic

Suppose that you have an application whose behavior depends on the environment variable BAR. Which of the following command lines may be used in a bash shell to configure the application?

1.3/1/2alphabetic

Which of the following commands can be used to assure that a file 'myfile' exists?

1.3/2/1alphabetic

Which of the following command lines can be used to convert a file containing DOS-style CR-LF line endings into Unix-style LF line endings? Assume for this question that the DOS-style file is called 'dosfile', and we want the modified contents in 'unixfile'

1.3/2/2alphabetic

Suppose for this question that you have a file called 'wordlist' that contains a number of words, one per line. You would like to produce an ad-hoc report that contains a numbered list of the first five words, according to alphabetical order. Which of the following command lines can be used to produce this report to the console?

1.3/2/3alphabetic

The command 'ps -A' displays an ordered list of all running processes, with the right-justifed process ID in the first space-separated field. Suppose you would like to display to screen a list of the five most recently launched processes (those with the highest process IDs). Which of the following commands will display the desired items?

1.3/2/4alphabetic

Suppose that a file 'names' contains a list of names in the form, "firstname lastname", one per line. These names are unsorted, and you would like them sorted by lastname; however, the format of names on each line should remain the same. Which ONE of the following commands will NOT output an appropriately sorted list of names to the console?

1.3/3/1alphabetic

Assume that your current working directory is '/tmp' and your home directory is '/home/jane'. Which of the below commands will copy all the content of '/tmp/test/' to a 'test' subdirectory of your home directory?

1.3/4/1multiple alphabetic

Suppose that you have several files matching the filename pattern 'file[0-9]'. You would like to visually compare the contents of all such files, in a side-by-side fashion. Which of the following commands would let you view the desired ad hoc report?

1.3/5/1alphabetic

Which of the following Linux utilities does NOT include the capability to list the process IDs of running applications?

1.3/5/2alphabetic
    # jobs -l
    [1]   5110 Running                 kedit &
    [2]-  5382 Stopped (signal)        pine
    [3]+  5457 Stopped (tty output)    vi

Given the 'jobs' display in the exhibit, which command could you use to switch display focus to the application 'vi'?

1.3/5/3alphabetic
    # jobs -l
    [1]   5110 Running                 kedit &
    [2]-  5382 Stopped (signal)        pine
    [3]+  5457 Stopped (tty output)    vi

Given the 'jobs' display in the exhibit, which command could you use to terminate the application 'vi'?

1.3/6/1alphabetic

Suppose you have a running program called 'myprog', that is a child of the current shell. You would like to decrease the CPU usage of this program. Which of the following command lines can you use to make 'myprog' yield more CPU resources?

1.3/7/1alphabetic
    int double(int n)
    { /* int arg, int return */
       return n*2;
    }
    char hello(int n)
    { /* int arg, char return */
       printf("hello %i\n", n);
    }
    int five()
    { /* no args, int return */
       return 5;
    }
    int        triple(int n, int other, char nonsense)
    { /* int arg, int return */
       return n*3;
    }

Correctly parsing a C source file requires a full-fledged parser (such as that built into a C compiler). Nonetheless, regular expressions can be used to provide a pretty good approximate descriptions of many program constructs. Which of the following searches will locate at least most of the C functions that accept an int as a first argument, and return an int (and will not produce false positives very often). The exhibit contains a fragment of C code with several annotated matching and non-matching functions (for non-C programmers).

1.3/7/2alphabetic

Some tools that use regular expressions support so-called "extended" regular expressions. For example, GNU 'grep' with the '-E' option uses extended regular expressions. Other tools like 'sed' only support "basic" regular expressions. As a consequence, one must be careful in selecting the right regular expression syntax. Which of the following characters have a special meaning in extended regular expressions, but not in basic regular expressions. That is, which of the following is an extended regular expression "meta-character", but only a regular character in basic regular expressions?

2.4/1/1multiple alphabetic

Based on Linux' partition naming system, which of the following device names point to "logical" partitions (assuming the corresponding partitions exist at all on the system in question)?

2.4/1/2alphabetic

Which of the following command lines can (possibly) be used to format a partition? Assume required partitions exist, and also that logical partitioning is used on each hard-disk.

2.4/2/1alphabetic

Which Linux command can be used to repair improperly shutdown, or otherwise potentially corrupt partitions?

2.4/2/2alphabetic

Which of the following command lines will produce an ad hoc report on the total disk space used personally by the current user?

2.4/2/3alphabetic

Which Linux command can be used to determine the available space on local hard-disk partitions?

2.4/3/1alphabetic

Please examine the exhibit for this question which displays the actual '/etc/fstab' file for the system on which this exam was created. Which of the following lines in the file causes a fixed and user-writeable partition to be mounted?

2.4/4/1alphabetic

Which Linux command can be used to limit the disk space usage allowance of a particular user? Assume for this question that quotas are enabled for the filesystem(s) in use on the system in question.

2.4/5/1alphabetic

Suppose you have created a new application 'myapp', and copied it to the directory '/usr/local/bin'. You would like all the users of the system to be able to run your application. Which of the following command lines would allow the appropriate access?

2.4/5/2alphabetic

Proper file security is particularly important for CGI applications invoked over the web, given the diversity of users. Which of the command lines setup reasonable file permissions for a CGI applications? Even though particular web servers may require slightly different configurations, you should be able to rule out all the wrong answers below.

2.4/6/1alphabetic

Which Linux command is used to assign privileges over a particular file to a designated user

2.4/7/1alphabetic

One advantage of hard links over symbolic links is:

2.4/8/1alphabetic

According to the Linux filesystem hierarchy standard, which of the following directories would be an appropriate location for a user to install a shared application to?

2.6/1/1alphabetic

Which of the following Linux command lines can be used to examine kernel bootup messages after boot time?

2.6/1/2alphabetic
    boot=/dev/hda
    map=/boot/map
    install=/boot/boot.b
    vga=791
    default=redhat
    keytable=/boot/us.klt
    lba32
    prompt
    timeout=200
    message=/boot/message
    menu-scheme=wb:bw:wb:bw
    image=/boot/vmlinuz
            label=failsafe
            root=/dev/hda10
            initrd=/boot/initrd.img
            append=" devfs=mount failsafe"
            read-only
    image=/boot/vmlinuz-2.4.16
            label=redhat
            alias=redhat-2.4.16
            root=/dev/hda9
            read-only
    image=/boot/vmlinuz-2.4.8-26mdk
            label=mandrake81
            root=/dev/hda10
            initrd=/boot/initrd.img
            append=" devfs=mount"
            read-only
    other=/dev/hda2
            label=eComStation
            table=/dev/hda
    other=/dev/fd0
            label=floppy
            unsafe

Please examine the exhibit for this question which displays the file '/etc/lilo.conf'. Assume that the 'lilo' command has been run while this configuration file is as listed. Which of the following statements correctly describes what happens when this machine boots up?

2.6/2/1alphabetic

Which command line can be used to restart a running Linux system immediately?

1.8/1/1alphabetic

Suppose that you know that a task deals with the general concept "floozflam", but you are not certain what Linux command(s) are available for working with floozflams. Which of the following Linux command lines would be the BEST first step in finding out about available tools?

1.8/1/2alphabetic

Suppose you know that an application 'someapp' is installed on the current system. You have already examine the man and info pages for 'someapp', but are trying to find additional information about 'someapp'. Which of the following directories is the BEST first place to look for further documentation files?

1.8/1/3alphabetic

Which of the following Linux commands are you likely to use to display hypertextual documentation on a command?

1.8/2/1alphabetic

Which of the following URLs is a BEST first internet site to go to for information about how to perform an unfamiliar Linux task?

1.8/3/1alphabetic

Suppose you have created an application that you wish to distribute to other users and system. Your application archive already contains the necessary executables, source code, and configuration files. But you would like to provide user with a quick explanation of the purpose and requirements of your application. Which of the following filenames BEST matches users' expectations about where first to look for application documentation

2.11/1/1alphabetic

Which of the following Linux commands can be used to set an expiration date for a user's password?

2.11/1/2alphabetic
    jdoe:x:502:1000:John Doe:/home/jdoe:/bin/bash

The exhibit for this question contains a line from the file '/etc/passwd'. Which of the following statements is true, based on the information in the exhibit?

2.11/1/3alphabetic

Which Linux command can be used to create a new user account?

2.11/1/4multiple alphabetic

Which Linux command(s) can be used to modify the list of groups a user belongs to?

2.11/2/1alphabetic

Which Linux file can be used to configure the default bash shell behavior for EVERY users on a system?

2.11/2/2alphabetic

Which of the following BEST describes the purpose of the '/etc/skel' directory?

2.11/3/1alphabetic

Which of the following command lines would allow you to examine how many times remote users have opened secure shells into the current system?

2.11/4/1alphabetic
    SHELL=/bin/bash
    PATH=/sbin:/bin:/usr/sbin:/usr/bin
    MAILTO=root
    HOME=/
    # run-parts
    01 * * * * root run-parts /etc/cron.hourly
    02 4 * * * root run-parts /etc/cron.daily
    22 4 * * 0 root run-parts /etc/cron.weekly
    42 4 1 * * root run-parts /etc/cron.monthly
    23 4 * 1,6 1 root run-parts /etc/cron.special

Refer to the '/etc/crontab' file listed in the exhibit for this question. Which of the following statements is true?

2.11/4/2alphabetic
    # cat /etc/cron.daily/slocate.cron
    #!/bin/sh
    renice +19 -p $$ >/dev/null 2>&1
    /usr/bin/updatedb -f "nfs,smbfs,ncpfs,proc,devpts" -e "/tmp,/var/tmp,/usr/tmp"

Based on the what the exhibit shows, which of the following statements is the BEST assumption?

2.11/5/1alphabetic

Which of the following Linux commands can be used to create backups of filesystems and directories?


Valid XHTML 1.0!