반응형
In vi do
:1,$d
to delete all lines.
The : introduces a command (and moves the cursor to the bottom).
The 1,$ is an indication of which lines the following command (d) should work on. In this case the range from line one to the last line (indicated by $, so you don't need to know the number of lines in the document).
The final d stands for delete the indicated lines.
There is a shorter form (:%d) but I find myself never using it. The :1,$d can be more easily "adapted" to e.g. :4,$-2d leaving only the first 3 and last 2 lines, deleting the rest.
반응형
'Etc' 카테고리의 다른 글
| Check current running processes (0) | 2015.02.09 |
|---|---|
| pcntl_fork php Lost connection to MySQL (0) | 2015.02.09 |
| 실리콘 밸리의 창업 (0) | 2014.09.10 |
| 불쌍한 남자들 (0) | 2014.08.04 |
| 워렌버핏이 말하는 최고의 투자방법 그리고 직업의 선택 (0) | 2014.07.01 |