
vim에서
vim file +10
다음과 같이 10번째 줄에서 파일을 열 수 있습니다.
vim file +10d
10번째 줄을 삭제할 수 있는데 어떻게 줄을 삭제하고 vim을 종료할 수 있나요? 또는 vim을 열지 않고 어떻게 줄을 삭제할 수 있습니까?
답변1
vim file +10d -c wq
또는
vim file +10d -c x
vim --help
-c <command> Execute <command> after loading the first file
답변2
그렇게하려면 다음을 사용하는 것이 좋습니다.sed이와 같이:
sed -i 10d file