Command | Description |
diff file 1 file2 | Compare 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 -l | List connected drives |
mount /dev/sda# /mnt/usbkey | Mount USB key |
md5sum -t file | Compute md5 hash |
echo -n "str" | md5sum | Generate md5 hash |
sha1sum file | SHA1 hash of file |
sort -u | Sort/show unique lines |
grep -c "str" file | Count lines w/ "str" |
tar cf file.tar files | Create .tar from files |
tar xf file.tar | Extract .tar |
tar czf file.tar.gz files | Create .tar.gz |
tar xzf file.tar.gz | Extract .tar.gz |
tar cjf file.tar.bz2 files | Create .tar.bz2 |
tar xjf file.tar.bz2 | Extract .tar.bz2 |
gzip file | Compress/rename file |
gzip -d file.gz | Decompress file.gz |
upx -9 -o out.exe orig.exe | UPX packs orig.exe |
zip -r <zipname.zip> \Directory\* | Create zip |
dd skip=1000 count=2000 bs=8 if=file of=file | Cut block 1K-3K from file |
split -b 9K ]<file> <prefix> | Split file into 9K chunks |
awk 'sub("$"."\r)' unix.txt > win.txt | Win compatible txt files |
find -i -name <file> -type *.pdf | Find 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 |