멀티부팅으로 윈도우와 우분투를 미리 설치했다.
막상 우분투에서 터미널을 사용하려고 하니 GUI에 길들여진 내가 쉽게 익숙해질리 없었다.
자주 사용하는 명령어들이 많은데 계속해서 명령어들을 블로그에 업데이트해서 외워야할 것 같다.
빨리 익숙해지자!
현재 위치를 확인하는 명령어
pwd
// 현재 위치를 확인함
새로운 폴더를 생성하는 명령어
mkdir helloworld
// helloworld 폴더를 생성함
폴더나 파일의 목록을 출력하는 명령어
ls
// 폴더나 파일의 목록을 출력
ls -l
// 폴더나 파일의 포멧을 전부 표현하여 출력
ls -a
// 폴더나 파일의 목록(숨겨진 파일까지 포함)을 출력
ls -al
// 폴더나 파일의 포멧을 전부 표현한 목록(숨겨진 파일까지 포함)을 출력
우분투에서 현재 폴더를 파일 탐색기로 여는 명령어
nautilus
// helloworld 폴더를 생성함
맥OS에서 현재 폴더를 파일 탐색기로 여는 명령어
open
// helloworld 폴더를 생성함
폴더에 진입하는 명령어
cd helloworld
// cd를 이용해 helloworld 폴더로 진입
새로운 파일을 생성하는 명령어
touch helloworld.txt
// helloworld.txt 파일을 생성
파일의 내용을 터미널에 출력하는 명령어
cat helloworld.txt
// helloworld.txt 파일의 내용을 터미널에 출력
폴더나 파일을 삭제하는 명령어
rm helloworld.txt
// helloworld.txt 파일을 삭제
rm -rf helloworld
// helloworld 폴더를 삭제
폴더나 파일의 이름을 변경하거나 폴더나 파일 위치를 옮기는 명령어
mv helloworld.txt helloworld/
// helloworld.txt 파일을 helloworld 폴더로 이동
mv helloworld.txt helloworld2.txt
// helloworld.txt 파일을 helloworld2.txt 이름으로 변경
폴더나 파일을 복사하는 명령어
cp helloworld.txt helloworld2.txt
// helloworld.txt 파일을 새로운 파일 helloworld2.txt 파일로 복사
cp -rf helloworld helloworld2
// helloworld 폴더를 새로운 폴더 helloworld2 폴더로 복사
현재 로그인된 사용자를 확인하는 명령어
whoami
// 현재 로그인된 사용자를 확인
관리자(루트) 권한을 획득하는 명령어
mkdir justMkdir
// justMkdir 폴더 생성(사용자 권한)
sudo mkdir sudoMkdir
// sudoMkdir 폴더 생성(관리자 권한)
nano 편집기를 열 수 있는 명령어
nano script.js
// script.js를 nano 편집기로 실행