Linux Commands

CommandDescription
diff file 1 file2Compare files
rm -rf <dir>Force delete of <dir>
shred -f -u <file>Overwrite/delete file
touch -r <ref_file> <file >Matches ref_file timestamp
touch -t YYYYMMDDHHSS <file>Set file timestamp
sudo fdisk -lList connected drives
mount /dev/sda# /mnt/usbkeyMount USB key
md5sum -t fileCompute md5 hash
echo -n "str" | md5sumGenerate md5 hash
sha1sum fileSHA1 hash of file
sort -uSort/show unique lines
grep -c "str" fileCount lines w/ "str"
tar cf file.tar filesCreate .tar from files
tar xf file.tarExtract .tar
tar czf file.tar.gz filesCreate .tar.gz
tar xzf file.tar.gzExtract .tar.gz
tar cjf file.tar.bz2 filesCreate .tar.bz2
tar xjf file.tar.bz2Extract .tar.bz2
gzip fileCompress/rename file
gzip -d file.gzDecompress file.gz
upx -9 -o out.exe orig.exeUPX packs orig.exe
zip -r <zipname.zip> \Directory\*Create zip
dd skip=1000 count=2000 bs=8 if=file of=fileCut block 1K-3K from file
split -b 9K ]<file> <prefix>Split file into 9K chunks
awk 'sub("$"."\r)' unix.txt > win.txtWin compatible txt files
find -i -name <file> -type *.pdfFind PDF files
find / -perm -4000 -0 -perm -2000 -exec ls -ldb {} \;Search for setuid files
dos2unix <file>Convert to *nix format
file <file>Determine file type/info
chattr (+/-)i <file>Set/Unset immutable bit
T-Mobile - Wikipedia
Kali Linux
Rocky Linux
Ubuntu Linux