Finding Flashcards

1
Q

What is the command to get detailed statistics on a file/directory?

A

stat

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

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

A

find >/path< -name >’name’<

i. e find -name ‘file1’
i. e find ./ -name ‘file2’

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

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

A

devtmpfs and tmpfs mount points

*file system only exists in RAM when operating

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

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

A

find {/path} -iname {name}

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

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

A

find -not -name {name}

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

How do you locate all character devices on the system?

A

find / -type c

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

How do you locate all link files on the system?

A

find / -type l

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

How do you locate all block devices on the system?

A

find / type b

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

How do you locate files larger than a designated size?

A

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

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

How do you find files denoted by timestamp modification date?

A

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

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

How do you find files owned by a specific user?

A

find -user {user}

i.e find / -user user1

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

How do you find files denoted by permission?

A

find -perm >octal notation<

i.e find -perm 755

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

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

A

find path -name name -exec command {} \;

i. e find -name file1 -exec chmod 755 {} \;
i. e find -name file1 -exec cp {} /home/user \;
* {} is a placeholder, gets replaced by internal file handles, \; ends the command

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