nl
stringlengths
13
387
bash
stringlengths
1
532
Find all files/directories under '/var/log' directory tree that bave been modified today (from the start of the day)
find /var/log -daystart -mtime 0
Find all files/directories under '/var/tmp' directory tree that belong to a user with user id 1000
find /var/tmp -uid 1000
Find all files/directories under 'A' directory tree excluding directory 'A/a' and all of it's contents
find A \! -path "A/a/*" -a \! -path "A/a"
Find all files/directories under 'A' directory tree excluding the paths containing the directory 'a'
find A \! -path "A/a/*"
Find all files/directories under 'my key phrase' directory
find 'my key phrase'
Find all files/directories under .. directory and copy them to ~/foo/bar
find .. -exec cp -t ~/foo/bar -- {} +
Find all files/directories under ./var/log directory
find ./var/log
Find all files/directories under /home/baumerf/public_html/ that were modified less than 60 minutes ago excluding *.log files/directories
find /home/baumerf/public_html/ -mmin -60 -not -name \*.log
Find all files/directories under /home/baumerf/public_html/ that were modified less than 60 minutes ago excluding error_log files/directories
find /home/baumerf/public_html/ -mmin -60 -not -name error_log
Find all files/directories under /home/bozo/projects directory that were modified 1 day ago
find /home/bozo/projects -mtime 1
Find all files/directories under /home/feeds/data directory
find /home/feeds/data
Find all files/directories under /home/foo/public_html/ that were modified less than 60 minutes ago
grep ! error_log | find /home/foo/public_html/ -mmin -60
Find all files/directories under /myfiles following symlinks if needed
find -L /myfiles
Find all files/directories under /myfiles that are 2560 bytes in size
find /myfiles -size 5
Find all files/directories under /myfiles that were accessed more than 30 days ago
find /myfiles -atime +30
Find all files/directories under /myfiles that were modified 2 days ago
find /myfiles -mtime 2
Find all files/directories under /path directory that were modified more than 30 minutes ago
find /path -mtime +30m
Find all files/directories under /path/to/dir and set directory permission to 0755 and file permission to 0644
find /path/to/dir -type d -exec chmod 0755 '{}' \; -o -type f -exec chmod 0644 '{}' \;
Find all files/directories under /path/to/dir/* paths and print the timestamp in YmdHMS format along with their paths and object of symlinks
find /path/to/dir/* -printf "%TY%Tm%Td%TH%TM%TS|%p|%l\n"
Find all files/directories under /proc and run ls command on each.
find /proc -exec ls '{}' \;
Find all files/directories under /usr/tom which matches the extended regex '*.pl| *.pm' in their names
find /usr/tom | egrep '*.pl| *.pm'
Find all files/directories under /var/log directory
find /var/log
Find all files/directories under _CACHE_* directories
find _CACHE_*
Find all files/directories under current /export/home/someone directory and upload them to ftp://somehost/tmp/
find /export/home/someone -exec curl -u someone:password -vT {} ftp://somehost/tmp/
Find all files and directories under current directory
find .
Find all files/directories under current directory
find -print
Find all files/directories under current directory
find -print0 | xargs -0
Find all files/directories under current directory
find .
Find all files/directories under current directory
find ./
Find all files/directories under current directory
find | xargs
Find all files/directories under current directory and append a null character at the end of each path
find -print0
Find all files/directories under current directory and count the number of lines for the output
find |wc -l
find all files and directories under the current directory and display the inode of each one, using printf
find . -printf "%i \n"
Find all files/directories under current directory and print their paths
find . -exec echo {} ";"
Find all files/directories under current directory and print their paths
find . -exec echo {} ';'
Find all files/directories under current directory and print their paths
find . -exec echo {} +
Find all files/directories under current directory and print their paths
find . -exec echo {} \+
Find all files/directories under current directory and print their paths
find . -exec echo {} \;
Find all files/directories under current directory and print them twice in each line
find | xargs -i sh -c "echo {} {}"
Find all files/directories under current directory and print them with newline as the delimiter
find -print | xargs -d'\n'
Find all files/directories under current directory and set their permission to 775
find . -type f -exec chmod 775 {} \;
Find all files/directories under current directory and sort them
find | sort
Find all files/directories under current directory appending a null character at the end of each file name/path
find -print0
Find all files/directories under current directory bypassing file hierarchies in lexicographical order
find -s
Find all files/directories under current directory excluding the paths that match the POSIX extended regex ".*def/incoming.*|.*456/incoming.*"
find . -regex-type posix-extended -regex ".*def/incoming.*|.*456/incoming.*" -prune -o -print
Find all files/directories under current directory in maximum 3 levels deep
find -maxdepth 3
Find all files/directories under current directory matching the case insensitive pattern 'pattern'
find -iname pattern
Find all files/directories under current directory that are greater than 10MB in size
find . -size +10M
Find all files/directories under current directory that match the case insensitive extended regex .*/(EA|FS)_.*
find -E . -iregex '.*/(EA|FS)_.*'
Find all files/directories under current directory that match the case insensitive glob pattern {EA,FS}_*
find . -iname "{EA,FS}_*"
Find all files/directories under current directory that match the case insensitive regex .*/\(EA\|FS\)_.*
find . -iregex '.*/\(EA\|FS\)_.*'
Find all files/directories under current directory that match the case insensitive regex ./\(RT\|ED\).* and show several lines of output from the beginning
find . -iregex './\(RT\|ED\).*' | head
Find all files/directories under current directory that match the case insensitive regex ./\(EA\|FS\)_.*
find . -iregex './\(EA\|FS\)_.*'
Find all files/directories under current directory that were accessed 30 minutes ago
find -amin 30
Find all files/directories under current directory that were accessed less than 1 day ago
find . -atime -1 -print
Find all files/directories under current directory that were accessed more than 25 but less than 35 minutes ago
find -amin +25 -amin -35
Find all files/directories under current directory that were modified later than /reference/file
find . -newer /reference/file
Find all files/directories under current directory tree
find | xargs
Find all files/directories under current directory tree excluding files/directories with name 'query_to_avoid'
find -not -name "query_to_avoid"
Find all files/directories under current directory tree excluding files/directories with name 'query_to_avoid'
find \! -name "query_to_avoid"
Find all files/directories under current directory tree excluding hidden files/directories
find . -not -path '*/\.*'
Find all files/directories under current directory tree that are newer than backup.tar.gz by modification time
find . -newer backup.tar.gz
Find all files/directories under current directory tree that belong to user 'john'
find . -user john
Find all files/directories under current directory tree that belong to the user 'tom'
find ./ -user tom
Find all files/directories under current directory tree that contain 'pattern' in their names
find -name "*pattern*"
Find all files/directories under current directory tree that start with 'R' and end with 'VER' in their names and were modified more than 1 day ago
find . -name "R*VER" -mtime +1
Find all files/directories under current directory tree that start with 'test' in their names without descending into directories with the same name pattern
find . -name 'test*' -prune
Find all files/directories under current directory tree whose names start with 'some_text_2014.08.19'
find . -name 'some_text_2014.08.19*'
Find all files/directories under current directory tree whose names start with 'test' followed by two digits and end with '.txt' extension
find . -regextype sed -regex "./test[0-9]\{2\}.txt"
Find all files/directories under current directory tree whose paths match the regex 'filename-regex.\*\.html'
find . -regex filename-regex.\*\.html
Find all files/directories under current directory tree whose paths start with './sr' and end with 'sc'
find . -path './sr*sc'
Find all files/directories under current directory tree with '.old' extension
find . -name ”*.old” -print
Find all files/directories under current directory tree with inode number 211028 and move them to 'newname.dir'
find . -inum 211028 -exec mv {} newname.dir \;
Find all files/directories under current directory tree wihout descending into './src/emacs' directory
find . -path './src/emacs' -prune -o -print
Find all files/directories under current directory which have read-write permission for owner and only read permission for group and others
find -perm -644
Find all files/directories under current directory with 'FooBar' in their paths and copy them to ~/foo/bar
find . | grep "FooBar" | tr \\n \\0 | xargs -0 -I{} cp "{}" ~/foo/bar
Find all files/directories under current directory with 'FooBar' in their paths and copy them to ~/foo/bar
find . | grep FooBar | xargs -I{} cp {} ~/foo/bar
Find all files/directories under current directory with 'FooBar' in their paths and copy them to ~/foo/bar
find .|grep "FooBar"|xargs -I{} cp "{}" ~/foo/bar
Find all files/directories under current directory with 'foobar' (case insensitive) in their names and copy them to ~/foo/bar
find . -iname "*foobar*" -exec cp "{}" ~/foo/bar \;
Find all files/directories under current directory with a Depth-First search
find dir -depth
Find all files/directories under current directory with null character as the delimiter
find -print0
Find all files/directories under current directory with null character as the delimiter
find . -print0
Find all files/directories under current directory with the null character as the delimiter
find -print0
Find all files/directories under current directory with null character as the delimiter and then replace the null characters with :
find -print0 | tr "\0" ":"
Find all files and directories under current directory without crossing over to other partitions
find . -xdev -print0
Find all files/directories under directory '.cache/chromium/Default/Cache/' which are bigger than 100MB and which are atleast 1 level deep and delete them
find .cache/chromium/Default/Cache/ -mindepth 1 -size +100M -delete
Find all files/directories under minimum 2 level down the current directory and set their permission to 700
find . -mindepth 2 | xargs chmod 700
Find all files/directories under test directory
find test
Find all the files/directories under user's home directory that do not belong to the user $USER
find ~ ! -user ${USER}
Find all files/directories under whatever and ... directory and copy them to /var/tmp
find whatever ... | xargs -d "\n" cp -t /var/tmp
Find all files/directories which have been modified from the start of the day in directories/files taken from the glob pattern '/tmp/test/*'
find /tmp/test/* -daystart -mtime -0
Find all files/directories which have been modified within the last day in the drectories/files taken from the glob pattern '/tmp/test/*'
find /tmp/test/* -mtime -1
Find all files and directories whose names end in ".rpm" and change their permissions to 755
find / -name *.rpm -exec chmod 755 '{}' \;
Find all files and directories whose names end in ".rpm", ignoring removable media, such as cdrom, floppy, etc.
find / -xdev -name \*.rpm
Find all files/directories whose names start with 'readme' (case insensitive) under '/usr/share/doc' directory tree
find /usr/share/doc -iname readme\*
Find all files/directories with '.bar' extension in maximum 2 levels down the current directory
find . -name *.bar -maxdepth 2 -print
Find all the files/directories with '.conf' extension under '/etc' directory non-recursively and display the last ten files
find /etc -maxdepth 1 -name "*.conf" | tail
Find all files/directories with '.err' extension under '/home/username' directory tree
find /home/username/ -name "*.err"
Find all files/directories with '.js' extension under current directory tree excluding paths that contain the directory './directory'
find -name "*.js" -not -path "./directory/*"
Find all files/directories with '.js' extension under current directory tree without descending into and ignoring './directory' completely
find . -not \( -path ./directory -prune \) -name \*.js