# credit to the Stack Overflow user in the source link # the line is stored in a variable, remove 'line=' to print on display line=$(head -n 1 filename)