---
title: "Discussion on \"Adding Text to First and Last Line of File in Linux\" | Hashnode"
description: "Discussion on \"Adding Text to First and Last Line of File in Linux\". Hi everyone,\nLet’s assume that you have many files to that you wanted to add some text to the first line or end line.\nIf you are a Linux user, this is easy to do. I am using sed  and tee commands to add something to the file.\nFirstly, I would like to..."
url: "https://hashnode.com/posts/adding-text-to-first-and-last-line-of-file-in-linux/63becefe6588b999a44128c2"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Adding Text to First and Last Line of File in Linux](https://erkanguzeler.com/adding-text-to-first-and-last-line-of-file-in-linux?utm_source=hashnode&utm_medium=feed)

Hi everyone, Let’s assume that you have many files to that you wanted to add some text to the first line or end line. If you are a Linux user, this is easy to do. I am using sed and tee commands to add something to the file. Firstly, I would like to...

Jan 11, 2023 · 2 min read · erkanguzeler.com  
Read the article

-   [#tee](https://hashnode.com/tag/tee)
-   [#linux](https://hashnode.com/tag/linux)
-   [#sed](https://hashnode.com/tag/sed)
-   [#command-line](https://hashnode.com/tag/command-line)

## Written by

[Erkan Güzeler](https://hashnode.com/@coderkan)

@coderkan · Turkey, Kocaeli

  
[View profile](https://hashnode.com/@coderkan)

Software Developer

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
