nl
stringlengths
13
387
bash
stringlengths
1
532
List all files in current directory whose name or file type description contains the word "ASCII".
file * | grep ASCII
List all files in entire file system owned by the user wnj and are newer than the file ttt
find / -newer ttt -user wnj -print
List all files in entire file system that are newer than the file $newerthan and older than the file $olderthan in regards of modification time
find / -type f -name "*" -newermt "$newerthan" ! -newermt "$olderthan" -ls
List all files in entire file system that are not newer than the ttt file and do not belong to the user wnj
find / \! \( -newer ttt -user wnj \) -print
List all files in entire file system that belong to the user wnj or modified later than the ttt file
find / \( -newer ttt -or -user wnj \) -print
list all the files in the file system excluding proc folder and excluding symbolic links which have write permission for the user
find / -path /proc -prune -o -perm -2 ! -type l -ls
List all files in maximum 2 levels down the current directory
find . -maxdepth 2 -type f -exec ls -l {} \;
List all files in maximum 2 levels down the current directory
find . -maxdepth 2 -type f -print0 | xargs -0 -n1 ls -l
List all your files including everything in sub-directories
find ~
List all the file links
find . -type l
List all files matching regular expression '*foo*' in a human-readable form
find . -name '*foo*' -exec ls -lah {} \;
List all files named "filename" from the current directory tree, ignoring directory "FOLDER1"
find . -name FOLDER1 -prune -o -name filename -print
List all file paths under the current directory with case insensitive name ".note" in reverse alphabetic order
find . -iname '.note' | sort -r
List all files that are between 10000 and 32000 bytes in size
find . -size +10000c -size -32000c -print
List all files that matches both the case insensitive patterns *$1* and *$2* under /home/musicuser/Music/ directory
find /home/musicuser/Music/ -type f -iname "*$1*" -iname "*$2*" -exec echo {} \;
Lists all files that matches path pattern with wildcards.
ls -l /lib*/ld-linux*.so.2
List all files under and below the directory given as variable $ARCH1
find $ARCH1 -ls
List all files under current directory
find . -type f | xargs ls
list all files under the current directory called cookies.txt
find -name cookies.txt
List all files under current directory matching the regex '.*(c|h|cpp)$'
find -E . -type f -regex '.*(c|h|cpp)$' -exec ls {} \;
List all files under current directory matching the regex '.*\.\(c\|h\|cpp\)'
find . -type f -regex '.*\.\(c\|h\|cpp\)' -exec ls {} \;
List all files under current directory that are greater than 10MB in size
find . -size +10M -exec ls -ld {} \;
List all files under current directory with white space safety in their paths
find . -type f -print0 | xargs -0 ls
List all files under the current working directory last modified less than a day ago
find `pwd` -mtime -1 -type f -print
List all files under the current working directory tree
find $(pwd)/ -type f
List all files under the current working directory with name ".htaccess"
find `pwd` -name .htaccess
List all files with their modification time in entire file system that are newer than the file $newerthan and older than the file $olderthan in regards of modification time and sort them according to file modification time
find / -type f -name "*" -newermt "$newerthan" ! -newermt "$olderthan" -printf "%T+\t%p\n" | sort
List all files with name "someFile" and their modification time under the current directory sorted by oldest modified to newest modified
find . -name "someFile" -printf "%p:%T@\n" | sort -t : -k2
List all files with their paths that have identical content.
find * -type f | xargs md5sum | sort | uniq -Dw32
List all files without descending into subdirectories
find * -type f -print -o -type d -prune
List all files/folders in current directory by separating them with spaces
ls | tr "\n" " "
List all hidden regular files from the current directory separating them with zeroes
find . -maxdepth 1 -type f -name '.*' -printf '%f\0'
list all java file that StringBuff in context.
find . -type f -name "*.java" -exec grep -l StringBuffer {} \;
list all javascipts file expect files under proc folder
find . -type d -name proc -prune -o -name '*.js'
list all javascipts file which whole name does not contain excludeddir or excludedir2 or excludedir3
find . -name '*.js' | grep -v excludeddir | grep -v excludedir2 | grep -v excludedir3
list all js files under currect directory exculde the directory which path contain "/path/to/search/exclude_me" or name isexclude_me_too_anywhere
find /path/to/search \ -type d \ \( -path /path/to/search/exclude_me \ -o \ -name exclude_me_too_anywhere \ \) \ -prune \ -o \ -type f -name '*\.js' -print
List all leaf directories of the current directory tree
find . -type d -links 2
List all leaf directories (directories which don't contain any sub-directory) under current directory
find . -type d -links 2
Lists all manual pages.
apropos -r '.*'
List all mounted filesystems
mount
List all nfs mounts
mount -l -t nfs4
List all non-empty files under under current directory
find . -type f ! -size 0
List all non-hidden files in ~/junk
find ~/junk -name "*" -exec ls -l {} \;
List all of the subdirectories in the current directory with no trailing slash.
ls -d */ | cut -f1 -d'/'
List all processes with detailed information
ps -ef
List all regular files in /var/www and below that have changed in the last 10 minutes
find /var/www -cmin -10 -type f -printf "%c %pn"
List all regular files in and below the home directory that have been modified in the last 90 minutes
find ~ -type f -mmin -90 | xargs ls -l
List all regular files in and below the home directory that were modified more than 5 years ago
find ~ -type f -mtime +1825 |xargs -r ls -l
List all regular files in and below the home directory that were modified more than 5 years ago
find ~ -type f -mtime +1825 |xargs ls -l
List all regular files in the current directory tree modified within the last 24 hours
find . -mtime 0 -type f -ls
List all regular files in the current directory tree that were modified less than 60 minutes ago
find . -mmin -60 -type f -exec ls -l {} +
List all regular files in entire file system
find / -type f -exec echo {} \;
List all regular files matching the name pattern "$1*" (where $1 is a positional parameter) under '/usr', '/bin', '/sbin' and '/opt' directory tree
find /usr /bin /sbin /opt -name "$1*" -type f -ls
List all regular files modified more than 61 days
find -type f -mtime 61 -exec ls -ltr {} \;
List all regular file owned by root with permissions 4000
find / -type f -user root -perm -4000 -exec ls -l {} \;
List all regular files residing in the current directory tree and containing string "/bin/ksh"
find . -type f -exec grep -li '/bin/ksh' {} \;
List all regular files residing in the current directory tree and containing string "/bin/ksh"
find . -type f -print | xargs grep -li 'bin/ksh'
List all regular files under current directory (not white space sage)
find . -type f -print | xargs -n 1
List all regular files under the current directory and below it
find . -type f -print0 | xargs -0 ls -l
List all regular files under the current directory and below it
find . -type f | xargs ls -l
List all regular files under current directory ensuring white space safety
find . -type f -print0 | xargs -0 -n 1
list all regular files under the directory "$directory"
find $directory -type f -name '*'
list all regular files which path is not dir1 or dir2
find ! -path "dir1" ! -path "dir2" -type f
list all regular files which path is not dir1 or dir2
find dir -not \( -path "dir1" -o -path "dir2" -prune \) -type f
list all regular files which path is not dir1 or dir2
find dir -not \( -path "dir1" -prune \) -not \( -path "dir2" -prune \) -type f
list all running jobs
jobs
Lists all subdirectories in a current folder, removing trailing slash.
ls -d */ | cut -f1 -d'/'
Lists all subdirectories in the current directory
ls -d -- */ ### more reliable GNU ls
Lists all subdirectories in current directory with a trailing slash
ls -d ./*/ ### more reliable BSD ls
Lists all subdirectories in the current directory with the trailing slash removed
ls -d1 */ | tr -d "/"
Lists all top-level files in a '/home/dreftymac/' folder.
ls /home/dreftymac/
List all unique parent directories of .class files found under the current directory
find -name '*.class' -printf '%h\n' | sort -u
List all variables (names and values) whose name or value contains X.
env | grep ".*X.*"
List all zero-length files
find . -empty -exec ls {} \;
list all zero-length files under the current directory
find . -empty -exec ls {} \;
List an empty environment (prints nothing)
env -i
List and remove all regular files named "core" that are larger than 500KB
find /prog -type f -size +1000 -print -name core -exec rm {} \;
list any files modified since /bin/sh was last modified
find . -newer /bin/sh
List any line in "f1" or "f2" which does not appear in the other and delete all tab characters in the output
comm -3 <(sort -un f1) <(sort -un f2) | tr -d '\t'
List characters from standard input showing backslash escapes for non-displayables
od -cvAnone -w1
List the combined path of the current working directory and "file.txt"
ls "`pwd`/file.txt"
List common files in directories "1" and "2"
cat <(ls 1 | sort -u) <(ls 2 | sort -u) | uniq -d
List content of 'myfile' in a subshell and returns output to parent shell
$(cat myfile)
Lists content of compressed text file.
zless MyFile
Lists content of the current folder.
$ ls
List the current directory recursively ignoring the "dir1" subdirectory
find . -path ./dir1 -prune -o -print
List the current directory recursively ignoring the "dir1" subdirectory
find . -path ./dir1\* -o -print
List the current directory recursively ignoring the "dir1" subdirectory
find . -path ./dir1\* -prune -o -print
List the current directory recursively ignoring the "dir1" subdirectory's content
find . -print -name dir -prune
List the current directory recursively ignoring ./src/emacs/ and all its contents
find . -path ./src/emacs -prune -o -print
List current user's crontab.
crontab -l
list the details of all the directories in the current folder
find . -type d -exec ls -ld {} \;
List the directory contents of the current working directory
echo $(ls $(pwd))
list directories owned by group ID 100 in the file system
find / -type d -gid 100
List the directory paths of all *.ext (case insensitive) files under /path directory
find /path -type f -iname "*.ext" -printf "%h\n"
List directories under current directory
find . -type d
List each directory in the current directory prefixed with its disk usage in human readable format and sorted from smallest to largest
du -sh */ | sort -n
List each file or directory in the current directory prefixed by its human readable filesize and sorted from largest to smallest
du -h --max-depth=0 * | sort -hr
List each file or directory in the current directory prefixed with its filesize in bytes and sorted from smallest to largest
du -s * | sort -n
List each file or directory in the current directory prefixed with its filesize in MB and sorted from smallest to largest
du -smc * | sort -n