LinuxText Processingsed s///
sed

sed s///Text Processing

awk

Substitute pattern with replacement string.

Syntax

sed 's/PATTERN/REPLACE/g' FILE

Example

Enter values below to update the example in real time.

sed
file
txt
config
ini
# 파일 내 텍스트 치환 (출력만)
sed 's/foo/bar/g' file.txt

# 파일 직접 수정 (-i)
sed -i 's/localhost/127.0.0.1/g' config.ini

# 특정 줄 삭제
sed '/^#/d' config.txt