nl stringlengths 13 387 | bash stringlengths 1 532 |
|---|---|
Find files in the /var/log folder which were modified modified 2 weeks ago | find /var/log/ -mtime +7 -mtime -8 |
Find files in /var/tmp/stuff and below that have not been modified in over 90 days | find /var/tmp/stuff -mtime +90 -print |
Find files in two different directories (esofthub and esoft) having the "test" string and list them | find esofthub esoft -name "*test*" -type f -ls |
Find files in and below the current directory whose names begin with "not" and remove one of them | find . -name not\* | tail -1 | xargs rm |
Find files in the current directory and below that are 2000 kB in size | find . -size 2000k -print |
Find files in the current directory and below that are less than 500 kB in size | find . -size -500k -print |
FInd files in current directory and grep text and html files - but not index.html and report things that contain the word 'elevator' in four or more lines | find . -type f -print0 | egrep -iazZ '(\.txt|\.html?)$' | grep -vazZ 'index.html' | xargs -n 1 -0 grep -c -Hi elevator | egrep -v ':[0123]$' |
Find files in the current directory and its sub-directories that begin with 'f'. | find . -name f* -print |
find files in the current directory and sub-directories, that changed within last hour | find . -cmin -60 |
find files in the current directory and sub-directories, whose content was updated within the last hour | find . -mmin -60 |
Find files in the current directory excluding CVS, SVN, GIT repository files and all binary files. | find . -not \( -name .svn -prune -o -name .git -prune -o -name CVS -prune \) -type f -print0 | xargs -0 file -n | grep -v binary | cut -d ":" -f1 |
find files in the current directory having name "filename" | find -iname "filename" |
Find the files in the current directory that match pattern '*.ISOLATE.*.txt' and move them to folder ./ISOLATE | find . -name '*.ISOLATE.*.txt' -maxdepth 1 -print0 | xargs -0 -IFILE mv FILE ./ISOLATE |
Find the files in the current directory that match pattern '*.ISOLATE.quantifier.txt' and move them to folder ISOLATE/ | find -name '*.ISOLATE.quantifier.txt' -maxdepth 1 -exec mv {} ISOLATE/ + |
Find the files in the current directory that match pattern '*.JUKEBOX.*.txt' and move them to folder ./JUKEBOX | find . -name '*.JUKEBOX.*.txt' -maxdepth 1 -print0 | xargs -0 -IFILE mv FILE ./JUKEBOX |
find files in current directory that names are game | find . -name game |
Find files in the current directory tree of size between 700k and 1000k | find . \( -size +700k -and -size -1000k \) |
Find files in the current directory tree that match pattern "*sub*" | find ./ -name "*sub*" |
Find files in the current directory tree that were accessed within the last 60 minutes | find . -amin -60 |
Find files in the current directory tree which are larger than 5 MB in size | find . -size +5000k -type f |
Find files in the current directory tree which have permissions rwx for user and rw for group and others | find . -perm 766 |
Find files in the current directory tree whose content was changed within the last 60 minutes | find . -mmin -60 |
Find files in the current directory tree whose names are of the form "cxx_data.txt" where xx is a number from 30 to 70 | find . -regextype posix-egrep -regex '.\*c([3-6][0-9]|70).\*' |
Find files in the current directory tree whose names are of the form "cxx_data.txt" where xx is a number from 40 to 70 | find . -regextype posix-egrep -regex "./c(([4-6][0-9])|70)_data.txt" |
Find files in the current directory tree whose names match regular expression "^.*~$\|^.*#$" | find -regex "^.*~$\|^.*#$" |
Find files in the current directory tree whose pathnames contain "sub" | find ./ | grep "sub" |
Find files in the current directory tree whose size is 24000 bytes | find . -size 24000c |
Find files in the current directory tree whose size is greater than 24000 bytes | find . -size +24000c |
Find files in the current directory tree whose size is less than 24000 bytes | find . -size -24000c |
Find the file in the current directory tree with inode number $inum and delete it | find . -inum $inum -exec rm {} \; |
Find files in the current directory whose names begin with "file" and remove them | find . -name file* -maxdepth 1 -exec rm {} \; |
find files in the current directory with pattern` '*.[ch]' which are contain ‘thing’ string and print file names | find . -name '*.[ch]' | xargs grep -l thing |
find files in the current directory with pattern` '*.[ch]' which are contain ‘thing’ string and print file names which can contain spaces | find . -name '*.[ch]' -print0 | xargs -r -0 grep -l thing |
find files in current folder ending with ".c" or ".h" or ".ch" and search for a word in these files and enable color highlighting of the matched text | find . -name "*.[ch]" -exec grep --color -aHn "e" {} \; |
Find files in entire file system that are writable by group or other | find / -perm /g+w,o+w |
Find files in entire file system that are writable by group or other | find / -perm /g=w,o=w |
Find files in entire file system with at least 644 permissions | find / -perm -u+rw,g+r,o+r |
find files in home directory that accessed more than 100 days ago | find ~ -atime 100 |
find files in home directory that names are game | find ~ -name game |
find files in the home folder which have been modified in the last day. ( -daystart measures times from the beginning of today rather than from 24 hours ago.) | find ~/ -daystart -type f -mtime 1 |
find files in root directory that names are game | find / -name game |
Find files larger than 100MB in /var/www and exclude files with /download/ in their path from the output | find /var/www/ -type f -name "*" -size +100M -exec du -h '{}' \;|grep -v /download/ |
Find files larger than 50k | find . -size +50k |
Find files matching `.ssh*' and append their anmes to file `ssh-stuff' | find / -name .ssh* -print | tee -a ssh-stuff |
Find files matching an exact set of permissions | find / -perm 644 |
Find files matching the pattern "./sr*sc" in their paths under current directory | find . -path "./sr*sc" |
Find files matching pattern $2 in the $1 directory recursively and search them for text $3, where $1, $2, $3 are the command line arguments to the Bash script | find $1 -name "$2" -exec grep -Hn "$3" {} \; |
Find files matching pattern $2 in the $1 directory recursively and search them for text $3, where $1, $2, $3 are the command line arguments to the Bash script | find $1 -name "$2" | grep -v '/proc' | xargs grep -Hn "$3" {} \; |
Find files matching pattern $2 in the $1 directory recursively and search them for text $3, where $1, $2, $3 are the command line arguments to the Bash script | find $1 -path /proc -prune -o -name "$2" -print -exec grep -Hn "$3" {} \; |
Find files matching regular expression regexp | find . | xargs grep regexp |
Find files modified at least 5 days in the future | find . -newermt "5 days" |
Find files modified between 6 and 9 minutes ago | find . -mmin +5 -mmin -10 |
Find files modified in the last 5 minutes starting from the current directory | find . -mmin -5 |
Find files modified in last 7 days | find . -mtime -7 -type f |
Find files modified more recently than file poop | find . -newer poop |
Find files named "blabla" in the current directory tree and print the number of lines in each of them | find ./ -name "blabla" -exec wc -l {} ; |
Find files named "needle" ignoring the case | find . -iname "needle" |
Find files named "ppp.conf" in the /etc directory tree | find /etc -name ppp.conf |
Find files named 'core' in or below the directory /tmp and delete them | find /tmp -depth -name core -type f -delete |
Find files named 'core' in or below the directory /tmp and delete them | find /tmp -name core -type f -print0 | xargs -0 /bin/rm -f |
Find files named 'fileName.txt' under '/path/to/folder' directory tree ignoring 'ignored_directory' | find /path/to/folder -name fileName.txt -not -path "*/ignored_directory/*" |
Find file names *blast* in specfied directory | find /usr/local -name "*blast*" |
Find file names *blast* in specfied directory, case insensitive | find /usr/local -iname "*blast*" |
Find files named core in or below the directory /tmp and delete them. Note that this will work incorrectly if there are any filenames containing newlines, single or double quotes, or spaces. | find /tmp -name core -type f -print | xargs /bin/rm -f |
Find files named core in or below the directory /tmp and delete them, processing filenames in such a way that file or directory names containing single or double quotes, spaces or newlines are correctly handled. | find /tmp -name core -type f -print0 | xargs -0 /bin/rm -f |
find file named foo.txt under current directory. | find . -name foo.txt |
find file named foo.txt under root / directory. | find / -name foo.txt |
Find files newer than `tmpfile' starting from the current directory | find . -newer tmpfile |
Find files newer than start.txt but not newer than end.txt | find ./ -newer start.txt -and ! -newer end.txt |
Find files not matching the patterns 'Image*-70x70*' and 'Image*-100x100*' in their names under Folder1 and copy them to Folder2 | find Folder1 \( ! -name 'Image*-70x70*' -a ! -name 'Image*-100x100*' \) | xargs -i% cp -p % Folder2 |
Find files not matching the posix extended regex '.+\-[0-9]{2,4}x[0-9]{2,4}\.jpg' in their paths under Folder1 and copy them to Folder2 | find Folder1 -type f -regextype posix-extended \( ! -regex '.+\-[0-9]{2,4}x[0-9]{2,4}\.jpg' \) -print0 | xargs -0 cp -p --target-directory=Folder2 |
Find files on the system accessed during the last 24 hours but not within the last hour | find / -atime -1 -amin +60 |
Find files on the system created during the last 50 days | find / -ctime -50 |
Find files on the system modified more than 90 minutes ago | find / -mmin +90 |
Find files on the system whose names begin with either x or X | find / -name "[Xx]*" |
Find files owned by the "shadow" group | find / -group shadow |
Find files owned by no group | find / -nogroup |
Find files owned by no user | find / -nouser |
Find files owned by nonexistent groups | find / -nogroup -print |
Find files owned by nonexistent users | find / -nouser -print |
Find files patching "pattern" | find . -name "pattern" -print |
Find files readable only by the group | find . -perm g=r -type f -exec ls -l {} \; |
Find files recursively with extension "ext" | find . -name "*.ext" |
Find file size in bytes | du -b FILE |
Find files starting with the word "file" in the current directory tree | find . -name "file*" |
Find files starting with the word "file" in the current directory tree, ignoring the case | find . -iname "file*" |
Find the files that have "644" permissions and modify them to have "664" permissions | find . -type f -perm 644 -exec chmod 664 {} \; |
Find files that have a modification time of a day ago | find / -mtime 1 |
Find files that are 0 bytes in size in the current directory and remove them | find . -maxdepth 1 -size 0c -exec rm {} \; |
Find files that are 0 bytes in size in the current directory tree and remove them | find . -size 0 -exec rm {} \; |
Find files that are 100k | find -size 100k |
Find files that are empty | find -empty -type -f |
Find files that are orphaned | find -nouser |
Find files that have been modified within the last month and copy them somewhere | find /etc/ -mtime -30 | xargs -0 cp /a/path |
Find files that match the executable bit for owner or group | find -type f -perm /110 |
Find files that do not have a listing in the /etc/passwd or /etc/group in the file system | find / -nouser -o -nogroup |
Find files that were accessed in less than a day ago | find / -atime -1 |
find files (under root file system /) that were accessed within the last 24 hours | find / -atime -1 |
Find files that were modified 7 days ago and archive them | find . -type f -mtime 7 | xargs tar -cvf `date '+%d%m%Y'_archive.tar` |
Find files that were modified in less than 1 minute ago | find / -mmin -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.