lazyhacker 1 year ago

find command CheatSheet

Basic Examples:

# Search for files or directories with the exact name "example.txt" in the current directory (and its subdirectories).

find . -name "example.txt"   

# Find all directories in the "/home" directory.     

find /home -type d 

# Search for files owned by the user "john" in the "/data" directory.           

find /data -user john  

# Find all files with the extension ".txt" in the current directory and download them using `curl`.          

find . -type f -name "*.txt" -exec curl -O {} \; 

Intermediate Examples:

# Extract specific content from a webpage using `curl` and `sed`.

curl https://example.com/page.html | sed -n 's/<p>\(.*\)<\/p>/\1/p'  

# Find all directories in the "/home" directory and count the number of files in each using `find` and `wc`.

find /home -type d -exec sh -c 'echo -n "{}: "; find "{}" -type f | wc -l' \; 

# Find all files modified in the last 7 days and perform an HTTP POST request with their content using `find`, `curl`, and `xargs`.

find . -type f -mtime -7 -print0 | xargs -0 -I{} curl -X POST -d @{} https://api.example.com/upload 

# Search for files with the extension ".log" in the "/var/logs" directory, compress them, and store in a backup folder using `find`, `curl`, and `tar`.

find /var/logs -type f -name "*.log" -exec tar czvf /backup/logs_backup.tar.gz {} \;  

Advanced Examples:

# Find all files in the current directory larger than 10MB and delete them using `find` and `rm`.

find . -type f -size +10M -exec rm {} \; 


0
1.9K
Understanding API Authentication: A Guide to Cookie-Based,jwt

Understanding API Authentication: A Guide to Cookie-Based,jwt

defaultuser.png
X0NE
1 year ago
DNS Spoofing Attacks

DNS Spoofing Attacks

defaultuser.png
Admin
8 months ago
Zphisher graphic extension

Zphisher graphic extension

defaultuser.png
Admin
9 months ago
Burp Suite

Burp Suite

defaultuser.png
Admin
8 months ago

Black Box Testing

https://lh3.googleusercontent.com/a/ACg8ocIkM8EGIx0gz9GUP_nM6_sMxivr6876Wp0e9MAp6mGc=s96-c
xone
5 months ago