Try:
sed 's/^A/foo/g' file
Use Ctrl+V+A to create the ^A
sequence in the above command.
More Related Contents:
- Better way to rename files based on multiple patterns
- How to use sed to remove the last n lines of a file
- How do I remove newlines from a text file?
- Insert multiple lines into a file after specified pattern using shell script
- How to check if sed has changed a file
- sh: 1: Syntax error: "(" unexpected error
- Iterate over a list of files with spaces
- ./configure : /bin/sh^M : bad interpreter [duplicate]
- How to declare 2D array in bash
- Defining a variable with or without export
- What does $@ mean in a shell script?
- Syntax error in shell script with process substitution
- Raise error in a Bash script
- What is the difference between “#!/usr/bin/env bash” and “#!/usr/bin/bash”?
- How can I remove the last character of a file in unix?
- How to run a shell script on a Unix console or Mac terminal?
- How to preserve line breaks when storing command output to a variable?
- Use sudo without password INSIDE a script
- How do I run multiple background commands in bash in a single line?
- Round a divided number in Bash
- Add a newline only if it doesn’t exist
- Bash: wait with timeout
- Multithreading in Bash [duplicate]
- Randomly shuffling lines in Linux / Bash
- Difference between shell and environment variables
- SUID not working with shell script
- What’s the point of eval/bash -c as opposed to just evaluating a variable?
- How do I delete all lines in a file starting from after a matching line?
- How to convert hex to ASCII characters in the Linux shell?
- How to avoid race condition when using a lock-file to avoid two instances of a script running simultaneously?