_command.png)
Ctrl + R : show the recent command you input
$ !! : redo the last command
Ctrl + U : delete the current line
Ctrl + C : finish the current command by force
Ctrl + D : logout the current session like Exit
$ exist : logout the current session
h, j, k, l : 왼쪽, 아래, 위, 오른쪽으로 커서이동
i : 현재커서위치에 작성
a : 현재커서 다음위치에 작성
I : 맨앞에 작성
A : 맨뒤에 작성
w : 단어 첫글자로 이동하기
e : 단어의 마지막 글자로 이동하기
gg : 문서 맨 앞으로 이동
G : 문서 맨끝으로 이동
^ : 문장 맨 앞으로 이동
$ : 문장 맨 뒤로 이동
f + 문자 : 문자의 위치로 이동 ; 를 누르면 계속 이동
/ + 단어 : 문서에서 단어 찾기 n이나 N으로 다음/이전 찾기
* : 현재 단어를 포워드 방향으로 찾기
# : 현재 단어를 백워드 방향으로 찾기
Ctrl + f : 다음 페이지 이동
Ctrl + b : 이전 페이지 이동
Ctrl + u : 페이지절반만큼 다음으로 이동
Ctrl + d : 페이지절반만큼 이전으로 이동
H : 현재 화면의 맨 위라인으로 이동
M : 현재 화면의 중간 라인으로 이동
L : 현재 화면의 마지막 라인으로 이동
% : { }나 ( )에서 현재 괄호의 짝으로 이동
dd : 현재 줄 잘라내기
yy : 현재 줄 복사하기
dw : 단어 잘라내기
cw : 단어 잘라내기
y : 복사하기
c : 잘라내기
p : 붙혀넣기
x : 현재 글자 지우기
>> : 들여쓰기
<< : 내어쓰기
. : 이전 명령어를 다시 실행
v : 비쥬얼모드(비쥬얼 모드에서 커서 이동해서 블럭지정 가능)
~ : 선택 문자 대소문자 변경
Ctrl + A : 숫자를 증가시키기
Ctrl + X : 숫자를 감소시키기
:w : 문서 저장하기
:q : 현재 문서 닫기
:q! : 저장하지 않고 강제 종료
:wq : 저장하고 닫기
:숫자 : 지정한 라인넘버로 이동
$ ls : list of directories and files
$ ls-al : list of directories and files including hidden
$ cd [directory_name] : locomotion to the directory
$ pwd : show the location of current directory
$ mkdir [directory_name] : make a directory
$ rm [file_name] : remove the file
$ rm -r [directory_name] : remove the directory
$ rm -f [file_name] : remove the file by force
$ rm -rf [directory_name] : remove the directory and all lower files
$ cp [file1][fijle2] : copy file1 to file2
$ cp -r [file1][file2] : copy file1+lower all to file2
$ mv [file1][file2] : move or change file1 to file2
$ grep -r [text_you wanna find] : search the text including lower paths
$ find -name "file_name" : search with file name
$ tail -f[file_name] : print out the last 10 lines of file
$ tail -f [file_name] grep [text_you wanna find]
$ tar -xvzf [file_name].tar.gz : decompress the zip file
$ ps : show the current active process
$ top : show all active process
$ kill [process ID] : exist the process
(the process ID is same to pid, It can be show when input the 'ps' command)
$ git --help : help what options there are
$ git init : create a GIT
$ git status : check status of the file
$ git add [file_path] : add the file in Staging Area
$ git add --all : add the all files in Staging Area
$ git diff : Working Directory와 Staging Area를 비교(Unstaged파일 수정된 부분)
$ git diff --staged(--cached) : Staging Area와 Repository 를 비교
(Staged파일 수정된 부분)
$ git commit : do commit
$ git commit -v : 편집기에 diff메세지도 추가
$ git commit -m "commit_message" : write the description of the selected code
$ git commit -a
: put in the Tracked files to the Staging Area automatically
(In other words, you can skip the 'git add' command)
$ git commit --amend : commit message 변경하기
$ git commit --amend --no-edit : if a file was omitted, you can do 'git add [file_name]' and renew existing commit
$ git reset (--mixed) [commit ID_you wanna go back]
: move to past commit of a specific point (commits after move is deleted), Index field is initialized with the corresponding Commit ID status but, Working Directory is not
$ git reset --hard [commit ID_you wanna go back] : both the Working Directory and Index are initialized with the corresponding Commit ID status
$ git reset --soft [commit ID_you wanna go back]
: both the Working Directory and Index are not initialized with the corresponding Commit ID status
$ git reset [commit] [path]
$ git reset HEAD^ : 가장 최근의 commit을 취소
$ git reset HEAD~2 : 가장 최근 2개의 commit을 취소
$ git reflog : GIT이력 리스트 보기 -> commit ID 확인
$ git reset --hard [commit_hash_ID] : 복구하기
$ git reflog 또는 git reflog |grep [branch_name] : log 확인
$ git checkout -b [branch_name_wanted to return] [commit_hash_ID] : 복구하기
$ git log : check the commit record of git
$ git log [branch1][branch2] : different between branch1 and branch2
$ git log -p [branch1][branch2] : different between branch1 and branch2 + code
$ git log --grep
$ git log --branch --not --remotes : check the log without pushing
(The commit after the moved point is deleted)
$ git log --oneline : commit record를 한줄씩 간결히 보기
$ git format-patch [commit_ID] : create a patch file
$ git format-patch -[number] : create [number] patch files form HEAD
$ git am [patch_file_name] : apply patch file
$ git rm -rf
$ git mv : 파일이름 변경 (mv file1 file2 --> git rm fjile1 --> git add file2)
$ git blame : 소스파일의 각라인을 누가 작성했는지 출력
$ git blame -L [start_line],[finish_line] ./[file_name] : 해당 부분(시작줄~끝줄)을 누가 작성했는지 출력
$ git merge
$ git rebase : change the base (It is not remain unnecessary merge history)
$ git rebase --interactive : re-base and edit the commit history
$ git cherry-pick [commit_hash1] [commit_hash2].... : 다른 브랜치에 있는 커밋을 선택적으로 내 브랜치에 적용
$ git cherry-pick --continue : 중지되었던 cherry-pick 진행
add.) Conflict으로 인해 cherry-pick이 더 이상 진행하지 못하는 상황에, git add
$ git branch [branch_name] : create a branch
$ git branch -a : list of the local branch
$ git branch -r : list of the remote branch
$ git branch -m [branch_name] [change_branch_name] : change the branch's name
$ git branch --delete [branch_name] : delete the branch
$ git checkout [branch_name] : select the branch
$ git checkout -t [remote_path/branch_name] : select the remote branch
$ sudo su : 관리자 권한으로 접속
$ su - 사용자계정 : 유저권한으로 되돌아가기
$ smbpasswd -U 사용자계정 : 삼바 비밀번호 변경
$ passwd 사용자계정 : 사용자계정의 비밀번호 변경
$ alias ll="ls -al"
########## Will continue to add and edit ###########