Commands Flashcards
(40 cards)
lsblk
Displays information about block devices, including partitions and mount points.
blkid /dev/sdb
Outputs details of /dev/sdb, such as file system type and UUID
cat /etc/fstab
Displays the contents of the file that defines file systems to be mounted at boot
find /home -type f -name “*.txt”
Searches for all .txt files under the /home directory
awk -F ‘:’ ‘{print $1}’ /etc/passwd
Extracts the first field (username) from the /etc/passwd file
grep -i “error” /var/log/syslog
Searches case-insensitively for the word “error” in /var/log/syslog
mount -o ro,loop disk.img /mnt/evidence
Mounts the disk.img as read only at /mnt/evidence
losetup -a
List all active loop devices
fsstat -o 2048 disk.img
Shows file system statistics for the image starting at offset 2048
blkls -o 63 disk.img > unallocated.blk
Extracts the unallocated space from disk.img starting at offset 63
icat -o 63 disk.img 45 > recovered.txt
Recovers the file linked to inoed 45 from disk.img and saves it as recovered.txt
dd if=dev/sda ofdisk_backup.img bs=1M
Copies dara from /dev/sdato disk_backup.img in 1MB blocks
mmls disk.img
Displays the partition table of disk.img
xxd -s 1024 -l 512 file.bin
Outputs a hex dump of 512 bytes starting at offset 1024 in file.bin
bulk_extractor -o results evidence.img
Extracts artifacts (e.g email, URLs) from evidence.img and stores results in results.
sort -u usernames.txt:
Sorts the contents of usernames.txt and removes duplicates
chmod 644 report.txt
Sets permissions of report .txt to be readable and writable by the owner and readable by owner groups and others
strings -n 8 disk.img | grep “password”
Extracts ASCII strings of at least 8 characters from disk.img and filters for “password”.
file evidence.img
Identifies the file type and encoding of evidence.img
tar -cvf archive.tar /home/user
Creats a tarball archive.tar containing the /home/user directory
md5sum file.img
Calculates the MD% has of file.img
sha256sum image.raw
Calculates the SHA-256 hash of image.raw
find /var/log -size +1M
Fine files larger than 1MB in the /var/log directory
grep -r “TODO” /project/code
Recursively searches for “TODO” in all files under /project/code.