Finding FIles Flashcards

(14 cards)

1
Q

what is the which command?

A

Used to locate executable files on the system; it returns any aliases and directories within the PATH variable for the command.

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

what is the path command?

A

A variable that stores a list of directories that will be searched in order when commands are executed without an absolute or relative pathname.

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

Q: What is the fastest method to search for files in the Linux directory tree?

A

A: The locate command.

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

Q: How does the locate command work?

A

A: It searches a premade, indexed database of file paths for fast results.

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

Q: Why might the results from locate be outdated?

A

A: Because the database doesn’t update in real-time as files are added or removed.

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

Q: How often is the database used by locate updated automatically?

A

A: Once per day.

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

Q: What command updates the locate database manually?

A

updatedb

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

Q: Where is the database used by the locate command stored?

A

A: /var/lib/plocate/plocate.db

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

Q: How can you exclude certain files, directories, or filesystems from being indexed by updatedb?

A

A: Add them to the /etc/updatedb.conf file (this is called pruning).

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

Q: What is a slower but more versatile command for locating files in Linux?

A

Find

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

Q: How does the find command work compared to locate?

A

A: It searches the directory tree recursively in real time, without using a premade index.

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

Q: What is the basic format of the find command?

A

A: find <start> -criterion <what></what></start>

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

Q: What does the type command do in Linux?

A

A: Displays only the first result normally outputted by the which command.

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

Q: What does the whereis command do in Linux?

A

A: Displays the location of a command as well as associated man and info pages.

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