Flashcards
Ch 2.9 Search for files
Cards in this deck (33)
- 1Search for test.txt in /usr/ directoryfind /usr/ -name test.txt
- 2Search for test.txt in current directoryfind -name test.txt
- 3Find files modified 5 minutes agofind -mmin 5
- 4Find files modified for past 5 minutesfind -mmin -5
- 5Find files modified before 5 minute agofind -mmin +5
- 6Find files modified past 24-hourfind -mtime 0
- 7Find files modified between 24 and 48 hours agofind -mtime 1
- 8Find files metadata of which changed 10 minutes agofind -cmin 10
- 9Find files with 512 kb sizefind -size 512k
- 10Find files with 120 bytesfind -size 120c
- 11Find files with size greate than 2Mbfind -size +2M
- 12Find files with size less than 3Gbfind -size -3G
- 13Find files which is either 512 kb or starts with cfind -size 512k -o -name "c*"
- 14Find files which is 1 Gb and starts with cfind -size 1G -name "c*"
- 15Find files which do not start with l (show two ways)find -not -name "l*"
find \! -name "l*" - 16Find all files with following permissions: r-xrw-r-- (write in numbers)find -perm 564
- 17Find all files with following permissions: at least rwxrw-rw- (write in numbers)find -perm -766
- 18Find all files with any of the following permissions: rw-rw-rw- (write in numbers)find -perm /666
- 19Find all files with following permissions: rwxrw-rw-- (write in letters)find -perm u=rwx,g=rw,o=rw
- 20Find all files with following permissions: at least r-xrw-rw- (write in letters)find -perm -u=rx,g=rw,o=rw
- 21Find all files with any of the following permissions: -wxrw--w- (write in letters)find -perm /u=wx,g=rw,o=w
- 22Find files that others cannot readfind \! -perm -o=r
- 23Find files/directories under /var/log/ directory that the group can write to, but others cannot read or write to it.sudo find /var/log/ -perm -g=w ! -perm /o=rw
- 24Add the permissions for setuid, setgid and sticky bit on /home/bob/datadir directory.chmod u+s,g+s,o+t /home/bob/datadir
- 25Find all directories named pets in /var/directory and save the output (along with directory path) in /home/bob/pets.txt file.sudo find /var/ -type d -name pets > /home/bob/pets.txt
- 26Find all the files whose permissions are 0777 in /var directory.sudo find /var -type f -perm 0777 -print
- 27Find all the files whose permissions are 0640 in /usr/ directorysudo find /usr -type f -perm 0640
- 28Find all the files which have been modified in the last 2 hours in /usr directory.sudo find /usr -type f -mmin -120
- 29Find all the files with size 20MB in /var directory.sudo find /var -type f -size 20M
- 30Find all files between 5mb and 10mb in the /usr directorysudo find /usr -type f -size +5M -size -10M
- 31Create a directory named LFCS under bob's home directory and update its user owner permissions to only x (execute), and group and others should not have any permissions.sudo mkdir /home/bob/LFCS
sudo chmod 0100 /home/bob/LFCS - 32Update the permissions for some_directory to rwxr-xr-xchmod 0755 some_directory/
- 33Find file named boyukherf.txt irrespective of case (so boyukherf, Boyukherf, BoyukHerf)find -iname boyukherf.txt
Information
- Description
- Easy KodeKloud - Linux Flashcards on Ch 2.9 Search for files, created by Archimed Nemes on 21/04/2022.
- Created by
- Archimed Nemes
- Views
- 2
- Rating
More on Linux File Management and Permissions