Chapter 5 Flashcards

1
Q

The user elvis knows that he created a file called report.txt two days ago, but has forgotten where he stored it. He knows that his machine has been continuously running, so he uses the locate command to find the file, but the command returns no hits. Which of the following is the most likely reason the file could not be found by locate?

A

The file was created in the /tmp directory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which of the following commands rebuilds the locate database?

A

The updatedb command is being given a lower scheduling priority because it can take a long time to execute.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The user blondie just restored a large number of files from a backup tape, and would like to be able to search through her files with the locate command. How should she proceed?

A

As the root user, she should run the updatedb command manually.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Use the contents of the following transcript to answer the next 2 questions.

[root@station root]# cat /etc/cron.daily/tmpwatch 
/usr/sbin/tmpwatch 240 /tmp
/usr/sbin/tmpwatch 720 /var/tmp
for d in /var/{cache/man,catman}/{cat?,X11R6/cat?,local/cat?}; do
    if [ -d "$d" ]; then
        /usr/sbin/tmpwatch -f 720 $d
    fi
done
A

-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

About how long can a file expect to live untouched in the /tmp directory?

A

10 days

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

About how long can a file expect to live untouched in the /var/tmp directory?

A

1 month

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

In which of the following files can you customize which directories are omitted from the locate database?

A

/etc/updatedb.conf

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What command can be used to update the locate database?

A

updatedb

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Which file should be edited to most easily modify how often the file /var/log/cups/access_log is rotated (but only that file)?

A

/etc/logrotate.d/cups

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which file should be edited to most directly modify how often logs are rotated by default?

A

/etc/logrotate.conf

How well did you know this?
1
Not at all
2
3
4
5
Perfectly