Commands Flashcards

(40 cards)

1
Q

lsblk

A

Displays information about block devices, including partitions and mount points.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

blkid /dev/sdb

A

Outputs details of /dev/sdb, such as file system type and UUID

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

cat /etc/fstab

A

Displays the contents of the file that defines file systems to be mounted at boot

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

find /home -type f -name “*.txt”

A

Searches for all .txt files under the /home directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

awk -F ‘:’ ‘{print $1}’ /etc/passwd

A

Extracts the first field (username) from the /etc/passwd file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

grep -i “error” /var/log/syslog

A

Searches case-insensitively for the word “error” in /var/log/syslog

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

mount -o ro,loop disk.img /mnt/evidence

A

Mounts the disk.img as read only at /mnt/evidence

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

losetup -a

A

List all active loop devices

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

fsstat -o 2048 disk.img

A

Shows file system statistics for the image starting at offset 2048

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

blkls -o 63 disk.img > unallocated.blk

A

Extracts the unallocated space from disk.img starting at offset 63

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

icat -o 63 disk.img 45 > recovered.txt

A

Recovers the file linked to inoed 45 from disk.img and saves it as recovered.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

dd if=dev/sda ofdisk_backup.img bs=1M

A

Copies dara from /dev/sdato disk_backup.img in 1MB blocks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

mmls disk.img

A

Displays the partition table of disk.img

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

xxd -s 1024 -l 512 file.bin

A

Outputs a hex dump of 512 bytes starting at offset 1024 in file.bin

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

bulk_extractor -o results evidence.img

A

Extracts artifacts (e.g email, URLs) from evidence.img and stores results in results.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

sort -u usernames.txt:

A

Sorts the contents of usernames.txt and removes duplicates

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

chmod 644 report.txt

A

Sets permissions of report .txt to be readable and writable by the owner and readable by owner groups and others

18
Q

strings -n 8 disk.img | grep “password”

A

Extracts ASCII strings of at least 8 characters from disk.img and filters for “password”.

19
Q

file evidence.img

A

Identifies the file type and encoding of evidence.img

20
Q

tar -cvf archive.tar /home/user

A

Creats a tarball archive.tar containing the /home/user directory

21
Q

md5sum file.img

A

Calculates the MD% has of file.img

22
Q

sha256sum image.raw

A

Calculates the SHA-256 hash of image.raw

23
Q

find /var/log -size +1M

A

Fine files larger than 1MB in the /var/log directory

24
Q

grep -r “TODO” /project/code

A

Recursively searches for “TODO” in all files under /project/code.

25
awk '{if ($2 > 10) print $1}' scores.txt
Prints the first column of rows where the second column is greater than 10
26
ls -R /mnt/evidence
Recursively lists all files and directories under /mnt/evidence
27
fdisk -l
List all disk partitions on the system
28
hashdeep -r /mnt/data
Recursicely hashes all files in /mnt/data and generates a report
29
find . -name "*.log" - exec wc -l {} \
Counts the number of lines in each .log file in the current directory
30
chmod 700 secure_file.txt
Sets the permissions of the secure_file.txt so that the owner can read, write and execute and the owners group and others have no permissions
31
xxd evidence.raw
Displays a hex dump of evidence.raw
32
df -h
Displays disk usage information in human readable format
33
dc3dd if=/dec/sda of=image.img hash=md5
Creates an image of /dev/sda while calculating its MD5 hash
34
mmls -t dos disk.img
Displays the DOS partition table of disk.img
35
istat -o 128 image.img 35
Shows metadata for inode 35 in the image, starting at offset 128
36
mount -o loop, ro evidence.img /mnt/mountpoint
Mounts evidence.img as read-only at /mnt/mountpoint
37
echo $((5+3))
Outputs the result of the arthmetric expression 5 + 3
38
less /var/log/auth.log
Open /var/log/auth.log in a pager for easy navigation
39
basename /path/to/file.txt
Strips the directory path and outptus the filename, file.txt
40
head -n 20 report.log
Displays the first 20 lines of report.log