find sort grep uniq awk

find  

find /home -name password.txt  

find /home -type d -name MyFolder   #you can also specify the directory

sudo find / -name sbd*  #with wildcard to match a certain string

find / -name 'file*'  #using wildcard

find / -name 'foldername' -type d

find / -name 'filename' -type f

find / -name 'sbd*' -exec file {} \;

find  files/ -type f -exec grep -H  ...................... {} \: 
#finds a specific string within a given file folder, 
dotted line is the string you looking for

find / -type d \( -perm -g+w -or -perm -o+w \) -exec ls -adl {} \;  
# looking for writable directories to run exploit


ls -la /usr/bin | grep zip

dpkg -l | grep -i python  #-i flag is to ignore case as grep is case sensitive

sudo grep -v "Starting" /var/log/boot.log  
#-v flag excludes any output which includes the word “Starting”



zgrep, which, similar to zcat, is for use on gzipped files. 
It takes the same options as grep and is used in the same way:

zgrep –i error /var/log/syslog.2.gz


#Sort unique files in a given directory (assets/)
cat assets/* | sort | uniq

# List of super users
grep -v -E "^#" /etc/passwd | awk -F: '$3 == 0 { print $1}'   

#Same with awk
awk -F: '($3 == "0") {print}' /etc/passwd 

Last updated