touch
: time 변경 또는 빈 파일 생성change file timestamps
hyojin@computer:~/test2$ ls -l
total 0
-rw-r--r-- 1 hyojin hyojin 14 Sep 5 16:14 memo.txt
hyojin@computer:~/test2$ touch memo.txt
hyojin@computer:~/test2$ ls -l
total 0
-rw-r--r-- 1 hyojin hyojin 14 Sep 5 16:16 memo.txt
hyojin@computer:~/test2$ touch memo2.txt
hyojin@HDPL35175:~/test2$ ls -l
total 0
-rw-r--r-- 1 hyojin hyojin 14 Sep 5 16:16 memo.txt
-rw-r--r-- 1 hyojin hyojin 0 Sep 5 16:16 memo2.txt >> 빈 파일로 생성됨
mkdir
: 디렉토리 생성makes directories
hyojin@computer:~/test2$ ls -l
total 4
-rw-r--r-- 1 hyojin hyojin 14 Sep 5 16:20 memo.txt
-rw-r--r-- 1 hyojin hyojin 0 Sep 5 16:16 memo2.txt
hyojin@computer:~/test2$ mkdir sub
hyojin@computer:~/test2$ ls -l
total 8
-rw-r--r-- 1 hyojin hyojin 14 Sep 5 16:20 memo.txt
-rw-r--r-- 1 hyojin hyojin 0 Sep 5 16:16 memo2.txt
drwxr-xr-x 2 hyojin hyojin 4096 Sep 5 16:24 sub
-p
: no error if existing, make parent directories as neededhyojin@computer:~/test2$ ls -l
total 8
-rw-r--r-- 1 hyojin hyojin 14 Sep 5 16:20 memo.txt
-rw-r--r-- 1 hyojin hyojin 0 Sep 5 16:16 memo2.txt
drwxr-xr-x 2 hyojin hyojin 4096 Sep 5 16:24 sub
hyojin@computer:~/test2$ mkdir sub2/sub2-1
mkdir: cannot create directory ‘sub2/sub2-1’: No such file or directory
hyojin@HDPL35175:~/test2$ mkdir -p sub2/sub2-1
hyojin@computer:~/test2$ ls -l
total 12
-rw-r--r-- 1 hyojin hyojin 14 Sep 5 16:20 memo.txt
-rw-r--r-- 1 hyojin hyojin 0 Sep 5 16:16 memo2.txt
drwxr-xr-x 2 hyojin hyojin 4096 Sep 5 16:24 sub
drwxr-xr-x 3 hyojin hyojin 4096 Sep 5 16:29 sub2
hyojin@computer:~/test2$ ls -l sub2
total 4
drwxr-xr-x 2 hyojin hyojin 4096 Sep 5 16:29 sub2-1
mkdir 디렉토리명 && cd 디렉토리명
: 디렉토리를 만들고 만든 디렉토리로 바로 이동hyojin@computer:~$ mkdir sample && cd sample
hyojin@computer:~/sample$ pwd
/home/ubuntu/sample
file
: 파일 타입 확인determine file type (확장자명을 보고 파일의 타입을 결정하는 건 X)