find Flashcards

memorise and start to use these very useful command.

1
Q

Find directories with 777 permissions and change the permissions to 755 in the current directory?

A

find . -type d -perm 777 -exec chmod 777 {} \;

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

Find all the empty files in the current directory and delete them:

A

find . -type f -empty -print -exec rm -f {} \;

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

Find all the files which are larger than 50MB but smaller than 100MB in the current directory

A

find . -type f -size +50M -size -100M

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

find and delete all the .mp4 files on your system which are larger than 1GB

A

find . -name ‘*.mp4’ -size +1000M -print rm -f {} \;

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