Searching Flashcards Preview

Linux Foundation Certified SysAdmin > Searching > Flashcards

Flashcards in Searching Deck (14)
Loading flashcards...
1

What is the command to search the current directory for a file/directory?

find >/path< -name >'name'<
i.e find -name 'file1'
i.e find ./ -name 'file2'

2

What denotes the pseudo file system when doing a block listing?

devtmpfs and tmpfs mount points
*file system only exists in RAM when operating

3

How do you search for a file/directory ignoring case sensitivity?

find >/path< -iname '>name

4

How do you search for everything excluding a specified file/directory?

find -not -name '>name

5

How do you locate all character devices on the system?

find / -type c

6

How do you locate all link files on the system?

find / -type l

7

How do you locate all block devices on the system?

find / type b

8

How do you locate files larger than a designated size?

find >/path< -size n
i.e find -size +1G *greater than gigabytes
i.e find -size 1470c *equal to bytes
i.e find -size -14k *less than kilobytes

9

How do you find files denoted by timestamp modification date?

find >path< -mtime n
i.e find -mtime -3 *modified less than 3 days
i.e find -mtime 1+ *modified over a day ago
i.e find -mtime 2 *modified 2 days ago

10

How do you find files owned by a specific user?

find -user >user<
i.e find / -user user1

11

How do you find files denoted by permission?

find -perm >octal notation<
i.e find -perm 755

12

How do you search for a file by using an incrementally populated database?

locate >name

13

How do you update the search database for locate in the event a new file is not detected?

updatedb

14

How do you find a file and perform and subsequent action?

find >path< -name >name< -exec >command< {} \;
i.e find -name file1 -exec chmod 755 {} \;
* {} \; is a placeholder, gets replaced by internal file handles