Using sed
and the pattern described:
sed '/192.168.1.2/s/$/ myalias/' file
Using sed
and a specific line number:
sed '2s/$/ myalias/' file
More Related Contents:
- Some troubles with using sed and awk [closed]
- How can I manipulate text in bash? [closed]
- How can I do a recursive find/replace of a string with awk or sed?
- Bash tool to get nth line from a file
- How to merge every two lines into one from the command line?
- Remove first N lines of a file in place in unix command line
- How to add to the end of lines containing a pattern with sed or awk?
- How to remove double-quotes in jq output for parsing json files in bash?
- How to find/replace and increment a matched number with sed/awk?
- find difference between two text files with one item per line [duplicate]
- Grep output with multiple Colors?
- using bash (sed/awk) to extract rows AND columns in CSV files?
- How to delete rows from a csv file based on a list values from another file?
- How to grep for case insensitive string in a file?
- sed search and replace strings containing / [duplicate]
- bash: shortest way to get n-th column of output
- Error when using ‘sed’ with ‘find’ command on OS X: “invalid command code .”
- Parse out key=value pairs into variables
- How do I escape slashes and double and single quotes in sed?
- Bash: Parse CSV with quotes, commas and newlines
- Use sed to replace all backslashes with forward slashes
- Escaping forward slashes in sed command [duplicate]
- sed multiline delete with pattern
- Can I use sed to manipulate a variable in bash?
- Using grep to search for hex strings in a file
- How to strip out all of the links of an HTML file in Bash or grep or batch and store them in a text file
- How to replace paired square brackets with other syntax with sed?
- How to get the PID of a process in a pipeline
- Utility to extract dates from filenames in Bash?
- How can I format the output of a bash command in neat columns