Find files larger than 100MB…Code language: Bash (bash)find . -size +10000000c -ls
Code language: Bash (bash)find . -size +100000000c -ls
find . -type f -mtime 30 -ls
Code language: Bash (bash)
Find files last modified over 365days ago… find . -type f -mtime 365 -ls
Code language: Bash (bash)
Find files last accessed over 30days ago… find . -type f -atime 30 -ls
Code language: Bash (bash)
Find files last accessed over 365days ago… find . -type f -atime 365 -ls
Code language: Bash (bash)
find . -type f -mtime -1 -ls
Code language: Bash (bash)
Better still, if we know a file is being written to now, we can touch a file and ask the find command to list any files updated after the timestamp of that file, which will logically then list the rogue file in question. touch testfile
find . -type f -newer testfile -ls
Code language: Bash (bash)
find . -type f -name "*.tar" -ls
find . -type f -name "*.tar.Z" -ls
Code language: Bash (bash)
Sometimes it is useful to then cd into that suspect directory and re-run the du command until the large files are found.Code language: Bash (bash)du -sk * | sort -n
find . -type f -mtime 365 -exec rm {} \;
Code language: Bash (bash)
Running the command with the “-ls” switch first, is always prudent to see what will be removed. The “-ls” switch prints out summary information about the file (like owner and permissions). If just the filename is required then swap “-ls” switch for “-print”. Are you using different commands to find a file? Please share it using below comment form. :) Java URL Encoder/Decoder Example - In this tutorial we will see how to URL encode/decode…
Show Multiple Examples in OpenAPI - OpenAPI (aka Swagger) Specifications has become a defecto standard…
Local WordPress using Docker - Running a local WordPress development environment is crucial for testing…
1. JWT Token Overview JSON Web Token (JWT) is an open standard defines a compact…
GraphQL Subscription provides a great way of building real-time API. In this tutorial we will…
1. Overview Spring Boot Webflux DynamoDB Integration tests - In this tutorial we will see…
View Comments
to find text inside files (in current directory and also subdirectories), grep can be used recursively:
grep -r "findthistext" *
if text is to be searched in only a type of files e.g. text files or shell scripts:
grep -r "findthistex" *.txt
grep -r "findthistex" *.sh