Showing posts with label command. Show all posts
Showing posts with label command. Show all posts

How to turn on/off wifi using command line on Ubuntu

In case the wifi access points have been saved, it will automatically connect. 

Turn on/off wifi:
- nmcli nm wifi on
- nmcli nm wifi off

Newer version (e.g., 18.04):
- nmcli radio wifi on
- nmcli radio wifi off

자주 쓰는 git command 모음



// 현재 git 상황
git status

// 새로운 repo시작
git init [repository name]

// (github) 등에 있는 repo 복사
git clone [url]

// branch바꾸기
git checkout [branch name]
git checkout -b [branch name] // 새 branch생성후 사용

// branch통합
git merge [branch name]

// 파일(들)을 staging 영역에 추가
git add [file]
git add *

// 파일 삭제 및 삭제를 stage영역에 추가
git rm [file]

// stage안된 파일 다른점 비교
git diff
git diff –staged // stage영역 파일과 최신 버전 비교

// 파일을 stage영역에서 제거
git reset [file]

// 파일을 repo로 commit
git commit -m “[ Type in the commit message]”

// 로컬 파일변경된 myfile.ext를 무시하고 hard reset, @ 는 HEAD 대표함
git checkout @ -- myfile.ext
git pull

// 전체 repo를 hard reset할 경우 (모든 파일의 로컬 변경을 무시)
git checkout HEAD
git pull

// remote repo에 변경사항을 보냄
git push [variable name] master

MAC에서의 VI[M] Command (명령어)



VI[M] improved VI는 텍스트 편집기로서 nano와 같이 사용되군 한다.

VI는 insert모드와 command모드가 있다. 프로그램을 시작하면 기본으로 command모드이다.

1. command모드에서 자주 쓰는 코맨드를 정리해보면...


  • i : insert모드로 변경(커서앞)
  • a : insert모드로 변경(커서뒤)
  • A : insert모드로 변경(라인마지막)
  • x : 커서에 있는 문자 삭제
  • dd : 한개 라인 삭제
    • 100dd: 100 개 라인 삭제
  • yy : 라인 복제
    • 100yy: 100 개 라인 복제
  • p : 삭제했거나 복제한 라인 붙여넣기(커서뒤)
  • P : 삭제했거나 복제한 라인 붙여넣기(커서앞)
  • / : /뒤에 오는 문자열 검색하기
  • G : 문서의 마지막 라인으로 이동
    • 1G : 문서의 첫라인으로 이동
    • 100G : 100번째 라인으로 이동
  • :wq : 저장하고 나가기
  • :q! : 저장안하고 바로 나가기
  •  중복제거: sort u
  • set number / set nonumber: 라인넘버 온 / 오프





2. insert모드에서 자주 쓰는 코맨드는...
  • ESC키로 insert모드 나가기(command모드)
  • insert모드에서는 글자 입력 가능