Search

Question 2: Signatures

Using the "file" command, evaluate the file signature of theanalysis/file1.

file file1
file1: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=3d705971a4c4544545cb78fd890d27bf792af6d4, stripped

User the "file" command, evaluate the file signature of theanalysis/file4.

file file4 
file4: data

What is the md5 hash of file3?

md5sum file3 
79054025255fb1a26e4bc422aef54eb4  file3

Meaning of two files with same hash?

File content are probably identical

What is the md5 hash of file4?

md5sum file4 
79054025255fb1a26e4bc422aef54eb4  file4

Use the cmp command to verify that file3 and file4 are identical.

cmp file3 file4 
file3 file4 differ: byte 20, line 1

Check file3 and file4 using a 512 bit sha hash.

Question 3: FIND command

Use the find command to locate all files which start with an "a" and end in a ".conf" which exist somewhere in /usr/share. Save this list to a file '/home/demo/alist'. Make sure that the first parameter of find is "/usr/share". Run the command as user "demo" and do not worry about any permission error messages.

Use the find command to locate all FILES in /usr/share which have the permissions "rwxr-xr-x". Save this list to /home/demo/blist. Make sure that the first parameter of find is "/usr/share". Run the command as user "demo" and ignore any permission error messages.

Use the find command to locate all directories in /usr/share which have the permissions "rwxr-xr-x". Pipe this list to wc and count the number of directories.

Again using the find command find out how many FILES in /etc are in group lp.

Question 4: GREP and regexp

Using a combination of grep, regular expressions, and wc via a pipe count how many words in the /usr/share/dict/words dictionary starts with "anti" and ends with an "n".

Using grep and regular expressions, create a file /home/demo/aword which contains all the words which start with "tele" from /usr/share/dict/words, and which are exactly 7 characters long.

How many words have the string "ra" in them twice in /usr/share/dict/words?

How many words are in /usr/share/dict/words which contains "ice" then immediately following that either an "s" or a "d" (i.e. ices or iced). Use square brackets to form a set in your regular expression.

Use grep on words to find a word that contains each of the vowels in alphabetical (i.e first an A, then an E, etc) order in /usr/share/dict/words. How many such words are there? (you may include words with extra vowels such as adventitious. A vowel is one of A,E,I,O,U.

The word interlinking includes the same two characters (e.g. "in") which appear three times. The word "priestessess" also contains the same two characters repeated three time (e.g. "es"). How many words can you find which contain any two characters repeated three times, like the examples "interlinking" and "priestessess". Use /usr/share/dict/words as your list of possible words and grep to find the answer.

Challenge Question: This is a tricky question. Just give it 10 minutes before moving onto the next question! How many words are 5 character palindromes? A palindrome is a word spelled the same way forward and backwards, such as "sagas". Use /usr/share/dict/words. Hint: Use multiple groups and backreferences.

Last updated