편집할 대상파일의 지정한 행 번호부터 파일 vi열기
작성자 정보
- 관리자 작성
- 작성일
컨텐츠 정보
- 2,101 조회
- 0 추천
- 목록
본문
편집할 대상파일의 지정한 행 번호부터 파일 vi열기
앞에서 “vi testfile”과 같이 vi를 시작하면서 파일명만을 지정하여 시작한 예를 보았습니다.
만약 편집하고자 하는 파일에 많은 내용이 저장되어 있을 경우에 vi시작 시 특정 행부터 오픈할 수 있습니다.
즉, “vi +시작행번호 파일명”과 같은 형식으로 지정하시면 지정한 “시작행번호”부터 vi의 첫화면으로 오픈합니다.
아래의 예는 testfile의 5행부터 첫화면으로하여 vi를 실행한 것입니다.
[root@su250 sulinux]# vi +5 testfile
------------------------------------------------------------ OpenOffice.org 3.0 ReadMe ------------------------------------------------------------
For latest updates to this readme file, see http://www.openoffice.org/welcome/readme.html Dear User
This file contains important information about this program. Please read this information very carefully before starting work.
The OpenOffice.org Community, responsible for the development of this product, would like to invite you to participate as a community member. As a new user, you can check out the OpenOffice.org site with helpful user information at
http://www.openoffice.org/about_us/introduction.html
Also read the sections below about getting involved in the OpenOffice.org project.
------------------------------------------------------------ Is OpenOffice.org really free for any user? ------------------------------------------------------------ |
위의 예에서 처음 커서의 위치가 5행에 위치하고 있음을 확인하시기 바랍니다.
만약 1,000라인 이상 되는 파일을 vi로 오픈할 때에 500라인부터 vi의 첫 편집화면으로 시작하려면 “vi +500 파일명”과 같은 형식으로 사용하시면 됩니다.
즉, 이 방법은 파일의 내용이 많은 경우에 편집위치를 지정하여 vi를 시작할 때에 주로 사용하는 방법입니다.
관련자료
-
이전
-
다음