Sample Interview Question Unix/Linux Experience

This is a sample interview question that has been given to those that are interviewing for an IT Consultant role. This question is only asked to those that state that they have Unix or Linux experience.

Problem

Go to your home directory. 
Get the first 10 lines of large.txt and put them in a file called small.txt in the /tmp folder. 
Display the number of lines that are in the small.txt 
Display the contents of small.txt
Then remove small.txt

Answer

cd
head -10 large.txt > /tmp/small.txt
wc -l /tmp/small.txt
cat /tmp/small.txt
rm /tmp/small.txt
Updated: 2020-07-15 | Posted: 2015-10-30