nl
stringlengths
13
387
bash
stringlengths
1
532
Find all directories under minimum 2 levels down the mydir directory
find mydir -mindepth 2 -type d
Find all directories under mydir
find mydir -type d
Find all directories under path_to_dir directory
find path_to_dir -type d
Find all directories under present working directory
find $PWD -type d
Find all directories under var/ directory and change their permission to 700
find var/ -type d -exec chmod 700 {} \;
Find all directories under ~/code without descending into hidden directories and print them appended with : (colon)
find ~/code -name '.*' -prune -o -type d -printf ':%p'
Find all directories whose name is root in / directory
find / -type d -name root
Find all directories whose name is Tecmint in / directory
find / -type d -name Tecmint
Find all directories whose status were changed $FTIME days ago
find . -type d -ctime $FTIME
Find all directories with 755 permission and change the permission to 700
find . -type d -perm 755 -exec chmod 700 {} \;
find all the directories with the name "DIRNAME" in the current folder and force delete them
find . -type d -name “DIRNAME” -exec rm -rf {} \;
find all the directories with the name "c" in the current folder which are at least 3 levels deep and which are not present in the path "/p/".
find -mindepth 3 -type d ! -path '*/p/*' -name c -print
find all the directories with the name "c" in the current folder which are at least 3 levels deep and which are not present in the path "/p/".
find -mindepth 3 -type d -path '*/p/*' -prune -o -name c -print
find all directories with the name "lib64" in the usr folder and replace space with ':'
find /usr -name lib64 -type d|paste -s -d:
find all the directories with the name "uploads" in current folder
find . -type d -name 'uploads'
find all directories with the name root in the entire file system.
find / -type d -name root
find all directories with the name test in a directory
find /home/john -type d -name test -print
Find all directories with permissions 777 under and below /var/www/html, and change their permissions to 755
find /var/www/html -type d -perm 777 -print -exec chmod 755 {} \;
Find all directories with space in their names under current directory and rename them by replacing all spaces with _
find -name "* *" -type d | rename 's/ /_/g'
find all the empty directories in the current folder
find . -type d -empty
find all the empty directories in the current folder and all its sub directories too
find . -depth -empty -type d
Find all empty directories in minimum 2 levels down the root directory
find root -mindepth 2 -type d -empty
Find all empty directories recursively starting from the current one and delete them
find . -type d -empty -delete
Find all empty directories recursively starting from the current one and delete them
find . -type d -empty -print0 | xargs -0 /bin/rmdir
Find all empty directories under $somedir and copy /my/configfile into those directories
find "$somedir" -type d -empty -exec cp /my/configfile {} \;
Find all empty directories under /tmp
find /tmp -type d -empty
Find all empty directories under /tmp and below
find /tmp -type d -empty
Find all empty directories under a certain path
find /tmp -type d -empty
Find all empty directories under current directory
find . -type d -empty
find all empty files
find / -empty
find all the empty files and folders in your system
find / -empty
Find all empty files in /tmp
find /tmp -type f -empty
find all empty files in /tmp directory .
find /tmp -type f -empty
find all empty files in the current directory ( empty file = size 0 bytes )
find . -size 0
Find all empty files in the current directory and delete them
find . -empty -maxdepth 1 -exec rm {} \;
Find all empty files in the current directory and delete them
find . -maxdepth 1 -type f -empty -delete
Find all empty files in the current directory and delete them
find . -type f -maxdepth 1 -empty -print0 | xargs -0 /bin/rm
Find all empty files in home directory
find ~ -empty
find all empty files in home directory
find ~ -empty
Find all empty files (zero byte files) in your home directory and its sub-directories.
find ~ -empty
Find all empty files starting from the current directory and delete them
find . -type f -empty -delete
Find all empty files starting from the current directory and delete them
find . -type f -empty -print0 | xargs -0 /bin/rm
Find all empty files under /tmp
find /tmp -type f -empty
Find all empty files under /tmp and below
find /tmp -type f -empty
Find all empty folders in the current directory and below
find . -type d -empty
Find all empty regular files in the current directory and below
find . -type f -empty
Find all empty regular files in the current directory tree
find . -size 0c -type f
find all the empty regular/normal files in the current folder and delete them
find . -type f -empty -delete
find all the error, access, ssl_engine and rewrite logs which are bigger than 300MB and are less then 5GB in the folder /opt
find /opt \( -name error_log -o -name 'access_log' -o -name 'ssl_engine_log' -o -name 'rewrite_log' -o -name 'catalina.out' \) -size +300000k -a -size -5000000k
Find all Executable files
find / -perm /a=x
Find all executable files
find / -perm /a=x
find all executable files
find / -executable
find all executable files in /home directory.
find /home -type f -perm /a=x
Find all executable files under current directory and reverse sort them
find . -perm -111 -type f | sort -r
Find all executable files under current directory and show a few lines of output from the beginning
find . -perm /a=x | head
Find all executables in the current directory tree
find ./ -executable
Find all executable symlinks or upvoter-* files under maximum 1 level down the {} directory
find {} -name 'upvoter-*' -type f -or -type l -maxdepth 1 -perm +111
Find all executable symlinks or upvoter-* files under maximum 1 level down the {} directory
find {} -name 'upvoter-*' -type f -or \( -type l \) -maxdepth 1 -perm +111
Find all executables under /path directory
find /path -perm /ugo+x
Find all executable upvoter-* files (following symlinks) under maximum 1 level down the current directory
find -L -maxdepth 1 -name 'upvoter-*' -type f -perm /111
Find all fglrx-libGL* files under and below debian/fglrx/
find debian/fglrx/ -name 'fglrx-libGL*'
Find all fglrx-libglx* files under and below debian/fglrx/
find debian/fglrx/ -name 'fglrx-libglx*'
find all files & dircetiry in current directory which have .tmp extension and delete them .
find . -type f -name "*.tmp" -exec rm -rf {} \;
Find all files accessed on the 29th of September, 2008, starting from the current directory
find . -type f -newerat 2008-09-29 ! -newerat 2008-09-30
Find all files and directories and count them
find ./ | wc -l
Find all files/directories containing 'blah' (case insensitive) in their names that were modified in less than 2 days ago uder current directory tree
find . -iname '*blah*' -mtime -2
Find all files/directories containing 'farm' in their names under '/usr/share' directory tree
find /usr/share -name '*farm*'
Find all files/directories containing 'foo' in their names under current directory tree
find . -name '*foo*'
Find all files/directories containing the case insensitive string something' in their names under current directory tree
find . -iname '*something*'
Find all files/directories excluding paths that match '.git' or '.gitignore'
find -print0 | grep -vEzZ '(\.git|\.gitignore/)'
Find all files/directories following symbolic links under current directory tree that are owned by 'root' user
find . -follow -uid 0 -print
Find all files/directories following symlinks under /path/to/dir/* paths and print the timestamp in YmdHMS format along with their paths
find -L /path/to/dir/* -printf "%TY%Tm%Td%TH%TM%TS|%p\n"
Find all files/directories greater than 100MB and print their list along with their size in /root/big.txt file
find \( -size +100M -fprintf /root/big.txt '%-10s %p\n' \)
Find all files/directories ignoring *~ files/directories without descending into .snapshot directory with null character as the delimiter
find . -name .snapshot -prune -o \( \! -name *~ -print0 \)
Find all the files/directories in '/path/to/files' directory tree which have not been modified in the last 2 hours
find "/path/to/files" -mmin +120
Find all files/directories in 1 level down the current directory
find -mindepth 1 -maxdepth 1
Find all files/directories in all paths expanded by the glob pattern *
find *
Find all files/directories in current directory and execute the script itself with minimal invocation for those files/directories
find . -exec $0 {} +
Find all files and directories in the current directory recursively that contain spaces in their names
find . -name '* *'
Find all files and directories in the current directory tree except those whose name is "dirname", case insensitive
find ./ -iname ! -iname dirname
Find all the files/directories in the current directory tree which have been modified between 2014-08-25 and 2014-08-26
find ./ -newermt 2014-08-25 ! -newermt 2014-08-26 -print
Find all files and directories in the current directory tree with "linkin park" in their names and copy them to /Users/tommye/Desktop/LP
find . -iname "*linkin park*" -exec cp -r {} /Users/tommye/Desktop/LP \;
Find all files/directories in directories/files taken from the glob pattern '/folder/path/*' recursively that have not been modified in the last 2 hours and delete them
find /folder/path/* -mmin +120 -delete
Find all files/directories in directories/files taken from the glob pattern '/tmp/test/*' recursively that have not been modified from the start of the day
find /tmp/test/* -daystart -mtime +0
Find all files/directories in entire file system for which owner has at least read/write permissions, or the group has at least read permission, or others have at least read permission
find / -perm /u+rw,g+r,o+r
Find all files/directories in entire file system for which owner has read/write/execute permissions, or the group has at least execute permission, or others have at least execute permission
find / -perm /711
Find all files/directories in entire file system less than 50 bytes
find / -size -50c
Find all files/directories in entire file system that have "write" bit set for either the owner, the group, or others
find / -perm /222
Find all files/directories in entire file system that have "write" bit set for either the owner, the group, or others
find / -perm /a+w
Find all files/directories in entire file system that have "write" bit set for either the owner, the group, or others
find / -perm /u+w,g+w,o+w
Find all files/directories in entire file system that are exactly 50 bytes
find / -size 50c
Find all files/directories in entire file system that are owned by "syslog" user
find / -user syslog
Find all files/directories in level $i down the current directory with all positional parameters appended with the find command
find -mindepth $i -maxdepth $i "$@"
Find all files/directories in level 1 down the $queue directory with all positional parameters appended with the find command
echo "$queue" | xargs -I'{}' find {} -mindepth 1 -maxdepth 1 $*
Find all files/directories in level 2 down the current directory
find -mindepth 2 -maxdepth 2
Find all files/directories in maximum 1 level down the current directory which do not have only read permission for 'other'
find . -maxdepth 1 ! -perm -o=r
Find all files/directories in the paths expanded by the glob pattern '.*'
find .*
Find all files and directories last modified less than a day ago and copy to "../changeset" creating directories as needed
find * -mtime -1 -daystart -print0 | cpio -pd0 ../changeset
Find all files/directories matching the regex .*sql.*
find -regex .*sql.*
Find all files/directories matching the regex pattern ".*\\.rb$" under current directory
find . -regex ".*\\.rb$"