There is a file sample.txt
. The contents of this file is
..some content...
# bind-address = ":7086"
# bind-address = ":8086"
I want to uncomment the line for port 7086 and replace the port also to 8888 so that final modified file would look like
..some content...
bind-address = ":8088"
# bind-address = ":8086"
I want to do it with the sed
command. So what will be the exact command?
As confirmed in comments, the string always contains # bind-address = ":7086"
. So to replace it just use sed
search and replace option by hardcoding the strings.
sed -i 's/# bind-address = ":7086"/bind-address = ":8088"/' file2
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다