$ sed 's/\(.*\) \(.*\) \(.*\) \(.*\) \(.*\) \(.*\)/\2/' ea.txt 1933 Best would be: $ awk '{print $2}' ea.txt 1933