nl
stringlengths 13
387
| bash
stringlengths 1
532
|
|---|---|
Find all files under /var/www directory and set their permission to 644
|
sudo find /var/www -type f -print0 | xargs -0 chmod 644
|
Find all files under and below /dir that were accessed less than 60 minutes ago
|
find /dir -amin -60
|
Find all files under and below /dir that were changed or created less than 60 minutes ago
|
find /dir -cmin -60
|
Find all files under and below /dir that were modified less than 60 minutes ago
|
find /dir -mmin -60
|
Find all files under and below the current working directory with the word California in the file
|
find . -type f -exec grep California {} \; -print
|
Find all files under current directory and append a null character at the end of each of their paths
|
find -type f -print0
|
Find all files under current directory and change their permission to 400
|
find . -type f -exec chmod 400 {} \;
|
Find all files under current directory and change their permission to 600
|
find . -type f -exec chmod 600 {} \;
|
Find all files under current directory and change their permission to 644
|
find . -type f -exec chmod 644 {} \;
|
Find all files under the current directory and copy their permissions to the same file in "../version1"
|
find . -type f | xargs -I {} chmod --reference {} ../version1/{}
|
Find all files under current directory and count the output line number
|
find . -type f | wc -l
|
Find all files under current directory and make them read-only for owner, read & writable by group and remove read-write-execute permission
|
find . -type f -exec chmod u+r-wx,g+rw-x,o-rwx {} \;
|
Find all files under current directory and print only the filenames (not paths)
|
find . -type f -execdir echo '{}' ';'
|
Find all files under current directory and print only the filenames (not paths)
|
find . -type f -printf "%f\n"
|
Find all files under current directory and print them appending a null character at the end of each file paths
|
find . -type f -print0
|
Find all files under current directory and search for 'something' in those files
|
find . -exec grep something {} +
|
Find all files under current directory and search for 'something' in those files
|
find . -print | xargs grep something
|
Find all files under current directory and set their permission to 775
|
find -type f | xargs chmod 775
|
Find all files under current directory and set their permission to 775
|
find . -type f -exec chmod 775 {} +
|
Find all files under current directory and set read-write permission for owner, read permission for group and no permission for other for those files
|
find . -type f -exec chmod u=rw,g=r,o= '{}' \;
|
Find all files under current directory and show their file information
|
find . -type f -exec file {} \;
|
Find all files under current directory and show their file information
|
find . -type f -print0 | xargs -0 file
|
Find all files under current directory and show their file information
|
find . -type f | xargs file
|
Find all flies under current directory excluding *.png files and print the file paths (with match count) that match the case insensitive regex 'foo=' in their contents
|
find . -not -name '*.png' -o -type f -print | xargs grep -icl "foo="
|
Find all files under current directory excluding hidden directories
|
find -name '.?*' -prune -o \( -type f -print0 \)
|
Find all files under current directory excluding hidden files
|
find . -depth -path './.*' -prune -o -print
|
find all files under the current directory, filtering the output through a regular expression to find any lines that contain the word foo or bar.
|
find ./ | grep -E 'foo|bar'
|
Find all files under current directory matching either of the patterns 'error.[0-9]*', 'access.[0-9]*', 'error_log.[0-9]*', 'access_log.[0-9]*', 'mod_jk.log.[0-9]*' in their names
|
find -type f -name 'error.[0-9]*' -o -name 'access.[0-9]*' -o -name 'error_log.[0-9]*' -o -name 'access_log.[0-9]*' -o -name 'mod_jk.log.[0-9]*'
|
Find all files under current directory matching the pattern '[error,access,error_log,access_log,mod_jk.log]*.[0-9]*' in their names
|
find -name '[error,access,error_log,access_log,mod_jk.log]*.[0-9]*' -type f
|
Find all files under current directory matching the posix-egrep type regex '^.*/[a-z][^/]*$' in their names
|
find . -regextype posix-egrep -regex '^.*/[a-z][^/]*$' -type f
|
Find all files under current directory matching the regex '.*\(\(error\|access\)\(_log\)?\|mod_jk\.log\)\.[0-9]+' in their paths
|
find -type f -regex '.*\(\(error\|access\)\(_log\)?\|mod_jk\.log\)\.[0-9]+'
|
Find all files under current directory that are larger than 10KB in size
|
find . -type f -size +10k
|
Find all files under the current directory that are not the same file as "/home/nez/file.txt"
|
find . -maxdepth 1 -not -samefile /home/nez/file.txt
|
Find all files under current directory that are read less than 1 minute ago
|
find . -amin -1
|
Find all files under current directory that were modified in the last 24 hours
|
find -mtime 0
|
Find all files under current directory that were modified in the last 24 hours and also include the files that were modified in less than 1 day ago
|
find -daystart -mtime +0
|
Find all files under current directory that were modified in the last 24 hours and also include the files that were modified in less than 1 day ago
|
find -mtime +0
|
Find all files under current directory that were modified more than 1 day ago
|
find -mtime +1
|
Find all files under current directory that were modified more than 7 days ago and delete them
|
find . -type f -mtime +7 -print0 | xargs -0 rm
|
Find all files under current directory tree named 'filename_regex' excluding '.svn' and '.pdv' directories and files then search for the case insensitive pattern 'your search string' in those files
|
find . -name "filename_regex"|grep -v '.svn' -v '.pdv'|xargs grep -i 'your search string'
|
Find all files under current directory whose file type description contains "image", display only path to each file.
|
find . -type f -exec file {} \; | grep -o -P '^.+: \w+ image'
|
Find all files under current directory whose file type description contains "image", display the paths to files and file type descriptions.
|
find . -name '*' -exec file {} \; | grep -o -P '^.+: \w+ image'
|
Find all files under the current directory whose pathnames do not end with "Video", ignoring the case
|
find . -maxdepth 1 -not -iwholename '*Video'
|
Find all files under current directory with 755 permission and change their permission to 644
|
find . -type f -perm 755 -exec chmod 644 {} \;
|
Find all files under current directory with their size and paths, reverse sort them numerically, then print the 2nd field (with space as the delimiter) of the first 4 entries
|
find -type f -printf "%s %p\n" | sort -nr | head -n 4 | cut -d ' ' -f 2
|
Find all files under current directory with their size and paths, reverse sort them numerically, then print first 4 entries
|
find -type f -printf "%s %p\n" | sort -nr | head -n 4
|
Find all files under current directory without descending into .snapshot directory that were modified in last 24 hours with null character as the delimiter
|
find . -name .snapshot -prune -o \( -type f -mtime 0 -print0 \)
|
find all files under the current folder except dir1 dir2 dir3 folder
|
find . -type d \( -path dir1 -o -path dir2 -o -path dir3 \) -prune -o -print
|
Find all files under directory tree /path/to/dir whose permissions are not 644
|
find /path/to/dir ! -perm 0644
|
Find all files under directory tree /path/to/dir whose permissions are not 644
|
find /path/to/dir ! -perm 644
|
Find all files under foldername directory and set their permission to 644
|
sudo find foldername -type f -exec chmod 644 {} ";"
|
Find all files under images directory
|
find images -type f
|
Find all files under minimum 1 level down the current directory
|
find . -mindepth 1 -type f
|
Find all files under path_to_dir
|
find path_to_dir -type f
|
Find all files under var/ directory and change their permission to 600
|
find var/ -type f -exec chmod 600 {} \;
|
Find all files which have 211028 inode number in current directory then Locating and renaming unprintable directories
|
find . -inum 211028 -exec mv {} newname.dir \;
|
Find all the files which are accessed 50 days back
|
find / -atime 50
|
Find all files which are accessed after modifying /etc/passwd files.
|
find -newer /etc/passwd
|
Find all the files which are accessed in last 1 hour
|
find / -amin -60
|
Find all the files which are accessed in last 1 hour in entire file system
|
find / -amin -60
|
Find all the files which are changed in last 1 hour
|
find / -cmin -60
|
Find all the files which are changed in last 1 hour in entire file system and show a few lines of output from the beginning
|
find / -cmin -60 | head
|
Find all the files which are greater than 50MB and less than 100MB
|
find / -size +50M -size -100M
|
Find all the files which are greater than 50MB but less than 100MB in size
|
find / -size +50M -size -100M
|
Find all the files which are modified 50 days back
|
find / -mtime 50
|
Find all the files which are modified in last 1 hour
|
find / -mmin -60
|
Find all the files which are modified in last 1 hour in entire file system
|
find / -mmin -60
|
Find all the files which are modified more than 50 days back and less than 100 days
|
find / -mtime +50 –mtime -100
|
find all the files which are of size 0 bytes.
|
find . -type f -empty
|
find all the files which have been changed after the modification of a file.
|
find -cnewer /etc/fstab
|
find all the files which have been modified in the last 15 minutes excluding hidden files.
|
find . -mmin -15 \( ! -regex ".*/\..*" \)
|
Find all files which begin with 'a' or 'b' from current directory downwards and print them.
|
find . -name [ab]* -print
|
Find all files which belong to user lal and change their ownership to ravi
|
find / -user lal -exec chown ravi {} \;
|
find all the files which end with ".deb" and display their base name (strip the extension)
|
find . -name '*.deb' -exec basename {} \;
|
find all the files which end with ".deb" and display their base name (strip the extension)
|
find . -name '*.deb' | xargs -n1 basename
|
Find all file which have more the 2 hard link
|
find . -type f -links +2 -exec ls -lrt {} \;
|
find all files which name contain 'foo' and path is not dir1 or dir2
|
find ! -path "dir1" ! -path "dir2" -name "*foo*"
|
find all the file which name (name can contains space) end with c or h and content contain 'thing'
|
find . -name '*.[ch]' -print0 | xargs -r -0 grep -l thing
|
find all the file which name end with c or h and content contain 'thing'
|
find . -name '*.[ch]' | xargs grep -l thing
|
find all the files which have size 0 bytes in temp folder
|
find /tmp -type f -empty
|
find all the files which start with the name "Metallica" in the folder "/mp3-collection" and which are bigger than 10MB
|
find /mp3-collection -name 'Metallica*' -and -size +10000k
|
Find all the files which were accessed 50 days ago
|
find / -atime 50
|
Find all the files which were modified 50 days ago
|
find / -mtime 50
|
find all the files which have the write permission to the group and remove the write permission.
|
find . -perm -20 -exec chmod g-w {} ;
|
Find all files whose filename does not end with *.html.
|
find . -type f -not -name "*.html"
|
Find all files whose names begin with 'Makefile' at the /usr/ports directory tree's level 3 and count the number of lines with NOPORTDOCS or NOPORTEXAMPLES in them.
|
find /usr/ports/ -name Makefile\* -mindepth 3 -maxdepth 3 -exec egrep "NOPORTDOCS|NOPORTEXAMPLES" '{}' '+' | wc -l
|
Find all files whose names begin with 'Makefile' in the /usr/ports directory tree and count how many of them contain 'QMAKESPEC'
|
find /usr/ports/ -name Makefile\* -exec grep -l QMAKESPEC '{}' '+' | wc -l
|
Find all files whose names begin with 'Makefile' in the /usr/ports directory tree and count how many of them contain 'QTDIR'
|
find /usr/ports/ -name Makefile\* -exec grep -l QTDIR '{}' '+' | wc -l
|
Find all files whose names contain the string 'xpilot' which exist within '/usr/local/games'
|
find /usr/local/games -name "*xpilot*"
|
Find all files whose names end with "macs" in and below the current directory
|
find -name '*macs'
|
Find all files whose names end with "~" in the /home/peter directory tree, following symlinks, and delete them
|
find -L /home/peter -name *~ -exec rm '{}' +
|
Find all files whose names end with "~" in the /home/peter directory tree, following symlinks, and delete them
|
find -L /home/peter -name *~ -exec rm '{}' \;
|
Find all files whose names end with "~" in the /home/peter directory tree, following symlinks, and delete them
|
find -L /home/peter -name *~ -print0 |xargs -0 -r -n1000 rm
|
Find all files whose names end with "~" in the /home/peter directory tree, following symlinks, and delete them
|
find -L /home/peter -name *~ -print0 |xargs -0 -r rm
|
Find all files whose names end with "~" in the /home/peter directory tree, following symlinks, and delete them
|
find -L /home/peter -name *~ |xargs rm
|
Find all the files whose name is FindCommandExamples.txt and contains both capital and small letters in / directory
|
find / -iname findcommandexamples.txt
|
Find all the files whose name is tecmint.txt and contains both capital and small letters in /home directory
|
find /home -iname tecmint.txt
|
Find all the files whose name is tecmint.txt in the current directory
|
find . -name tecmint.txt
|
Find all files whose names do not begin with "zsh" on ext3 file systems
|
find / -fstype ext3 -name zsh*
|
Find all files whose name or type description includes "text", display only paths to files.
|
find . -exec file {} \; | grep text | cut -d: -f1
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.