Skip to content

Instantly share code, notes, and snippets.

@AndrewRussellHayes
Last active December 28, 2015 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndrewRussellHayes/7547721 to your computer and use it in GitHub Desktop.
Save AndrewRussellHayes/7547721 to your computer and use it in GitHub Desktop.
replace file with file name and the entire contents get printed with line numbers to screen
#replace file with file name and the entire contents get printed with line numbers to screen
perl -n -e 'print "$. - $_"' file
#or
perl -p -e '$_ = "$. - $_"' file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment