Skip to content
  • View menu
  • View sidebar

bioinfo core

Index & solution of bioInfo utilities

  • Home
  • All entries
  • Blogs
  • Contact
  • About

Categories

  • Between languages (7)
  • Blogs (8)
  • Python (35)
  • R (1)
  • Unix (37)

Tags

bedfile Blogs conda Excel html numpy Pandas Python R slurm Unix
05/15/202010/21/2021 by bioinfocore

Unix insert a line to the beginning of a file

  • Unix
  • Unix

Insert a line to the beginning of a file using sed:

sed '1 s/^/This is my first line\n/' inFile.txt > outFile.txt

Source:
https://linuxconfig.org/how-to-insert-line-to-the-beginning-of-file-on-linux

Post navigation

← Previous Post Unix skip/remove the first or last line
Next Post → Python Pandas remove rows with the same index
Copyright 2022 | by bioinfocore