Git
shell 및 Vim command
jinsuc28
2022. 5. 6. 20:40
Shell command
$ cd Documents/ #경로 이동
$ mkdir dev #폴더 만들기
$ cd .. #상위 경로 이동
$ pwd #현재 위치
$ touch readme.md #파일만들기
$ mv readme.md bin/ #파일 경로 이동
$ cp readme.md bin/ #파일 복사
$ mv readme.md ./README.txt #파일 이동 및 파일 이름 변경
$ rm README.txt #remove 삭제
$ rm -rf bin/ #remove -real force 파일 삭제하는데 강제적으로 삭제(확인 없이 삭제)
$ chmod 750 readme.md #디렉토리 권한 변경 (750은 root, 동일 그룹 사용자만 디렉토리를 열 수 있게 변경)
$ cat readme.md #파일 읽기
$ vi readme.md #파일을 vim으로 엶
$ touch .gitignore # .파일은 숨겨진 파일로 만듦
$ ls -a #ls 현재 폴더 파일들 보여줌, -a 숨겨진 파일까지 보여줌
VIM command
h j k l - left, down, up, right
i - insert mode
v - visual mode
ESC - back to normal mode
d - delete
dd - delete a line
y - yank
yy - yank a line
p - paste
u - undo
a - append
A - append from end of line
o - open line(under)
O - open line(upper)
H - move to the top of the screen
L - move to the bottom of the screen
:q - quit
:q! - quit discarding all changes
:w - write
:wq - write and quit
:{number} - jump to {number}th line.
i로 수정 -> esc로 nomal 환경전환 -> :wq로 수정 종료 순으로 많이 이용