printf '%s\n%s\n' "to be prepended" "$(cat text.txt)" >text.txt
More Related Contents:
- Command line command to auto-kill a command after a certain amount of time
- Use grep –exclude/–include syntax to not grep through certain files
- Is there a way to ignore header lines in a UNIX sort?
- sed edit file in place
- Replace a string in shell script using a variable
- How to use variables in a command in sed?
- Why does my tool output overwrite itself and how do I fix it?
- How can I reverse the order of lines in a file?
- What is the difference between a symbolic link and a hard link?
- How can I grep for a string that begins with a dash/hyphen?
- Portable way to pass file descriptor between different processes
- Why an ELF executable could have 4 LOAD segments?
- How to interleave lines from two text files
- sed or awk: delete n lines following a pattern
- Executing JavaScript without a browser?
- Is PowerShell ready to replace my Cygwin shell on Windows? [closed]
- Equivalent of *Nix ‘which’ command in PowerShell?
- How to extract just plain text from .doc & .docx files? [closed]
- Print lines in one file matching patterns in another file
- Extract specific columns from delimited file using Awk
- How do the UNIX commands mv and rm work with open files?
- How do I list all cron jobs for all users?
- What does the ^M character mean in Vim?
- properly join two files based on 2 columns in common
- Diff files present in two different directories
- How to move or copy files listed by ‘find’ command in unix?
- Named Pipes (FIFOs) on Unix with multiple readers
- What are the dark corners of Vim your mom never told you about? [closed]
- How can I use xargs to copy files that have spaces and quotes in their names?
- In a unix shell, how to get yesterday’s date into a variable?