CLI (Command Line Interface)
POSIX (Portable Operating System Interface)
- UNIX 계열의 컴퓨터들을 제어하기 위한 표준
- unix, linux, macos는 posix를 따름
File | Directory | |
Create | editor | mkdir |
Read | editor, cat, ls | ls |
Update | editor, mv | mv |
Delete | rm | rm |
<명령어>
pwd : print working directory. 현재 작업중인 디렉토리
cd : change directory
cd / : root directory로 이동
cd ~ : home directory로 이동
ls : list directory contents. 디렉토리에 있는 파일/디렉토리의 목록을 보여줌
--help : simple manual ex) ls --help
man command : manual ex) man ls
ls -l : list in long format
touch : make empty file
ls -a : show all files (including hidden files)
mkdir: make directory
mv : move (rename). ex) mv dummy dummy2 : dummy라는 디렉토리의 이름을 dummy2로 변경
rm -r : remove directory. ex) rm -r dummy : dummy라는 디렉토리를 삭제
rm : remove file
cd .. 또는 cd ../ : parent directory로 이동
cat file : file안의 내용을 보여줌
/ : root directory
~ : home directory
../ : parent directory
.filename : hidden file. 파일명 앞에 .을 붙이면 감춤(숨김)파일 처리 됨
./ : current directory ex) cd ./posix : current directory 아래 있는 posix directory로 이동 cd /posix : 최상위디렉토리 아래 있는 posix 디렉토리로 이동
; : command separator. 여러 명령어를 쓸 때 각 명령어를 구분해줌
&& : and operator.
상대경로와 절대경로 (relative path vs absolute path)
absolute path : ex) cd /Users/jiyounglee/posix
relative path : ex) cd .. , cd ./posix
nano : terminal에서 사용 가능한 text editor의 한 종류