DarkMatter in Cyberspace
  • Home
  • Categories
  • Tags
  • Archives

Print First and Last Characters of a Line


Some large files all content are in the same line, there is no newline for the entire file. For them it's very slow to view them with less or vim. Instead we can use head and tail, for example commands below print first and last 50 characters of a large one-line file:

cat large-one-line.json|head -c 50
cat large-one-line.json|tail -c 50


Published

Mar 14, 2016

Last Updated

Mar 14, 2016

Category

Tech

Tags

  • linux 158
  • print 1
  • shell 46

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor