728x90
반응형
[Ubuntu Linux] 파일 경로 및 파일관리 명령어 |
파일 경로
명령어 | 설명 |
pwd | print working directory |
cd | change directory |
ll | |
ls | |
터미널 | |
man | 매뉴얼 |
clear | 터미널 지난 화면 지우기 |
파일관리 명령어
명령어 | 설명 |
mkdir | 디렉토리 생성 |
rmdir | 디렉토리 삭제 |
touch | 빈 파일 생성 |
mv | 파일 이동 / 변경 |
rm | 파일 삭제 |
cp | 파일 복사 |
rm -r 디렉토리 | 디렉토리와 그 안에 있는 모든 것을 삭제 |
javanian@ubuntu:~$ mkdir hongtv javanian@ubuntu:~$ ll total 64 drwxrwxr-- 5 javanian javanian 4096 Feb 18 16:11 ./ drwxr-xr-x 3 root root 4096 Feb 15 03:44 ../ -rw------- 1 javanian javanian 2536 Feb 16 15:04 .bash_history -rw-r--r-- 1 javanian javanian 220 Jan 6 2022 .bash_logout -rw-r--r-- 1 javanian javanian 3771 Jan 6 2022 .bashrc drwx------ 2 javanian javanian 4096 Feb 15 03:47 .cache/ drwxrwxr-x 2 javanian javanian 4096 Feb 18 16:11 hongtv/ -rw------- 1 javanian javanian 20 Feb 18 15:59 .lesshst -rw-r--r-- 1 javanian javanian 807 Jan 6 2022 .profile drwx------ 2 javanian javanian 4096 Feb 15 03:44 .ssh/ -rw-r--r-- 1 javanian javanian 0 Feb 15 05:58 .sudo_as_admin_successful -rw-rw-r-- 1 javanian javanian 87 Feb 18 05:29 test1 -rw-r--r-- 1 root root 20 Feb 15 08:13 test1_back -rw-rw-r-- 1 javanian javanian 2466 Feb 16 14:59 test_shell.sh -rw------- 1 javanian javanian 7130 Feb 18 14:43 .viminfo -rw------- 1 javanian javanian 52 Feb 18 05:28 .Xauthority javanian@ubuntu:~$ cd hongtv javanian@ubuntu:~/hongtv$ ll total 8 drwxrwxr-x 2 javanian javanian 4096 Feb 18 16:11 ./ drwxrwxr-- 5 javanian javanian 4096 Feb 18 16:11 ../ javanian@ubuntu:~/hongtv$ pwd /home/javanian/hongtv javanian@ubuntu:~/hongtv$ mkdir dir1 javanian@ubuntu:~/hongtv$ mkdir dir2 javanian@ubuntu:~/hongtv$ ll total 16 drwxrwxr-x 4 javanian javanian 4096 Feb 18 16:12 ./ drwxrwxr-- 5 javanian javanian 4096 Feb 18 16:11 ../ drwxrwxr-x 2 javanian javanian 4096 Feb 18 16:12 dir1/ drwxrwxr-x 2 javanian javanian 4096 Feb 18 16:12 dir2/ javanian@ubuntu:~/hongtv$ mv dir2 dir3 javanian@ubuntu:~/hongtv$ ll total 16 drwxrwxr-x 4 javanian javanian 4096 Feb 18 16:13 ./ drwxrwxr-- 5 javanian javanian 4096 Feb 18 16:11 ../ drwxrwxr-x 2 javanian javanian 4096 Feb 18 16:12 dir1/ drwxrwxr-x 2 javanian javanian 4096 Feb 18 16:12 dir3/ javanian@ubuntu:~/hongtv$ touch test.txt javanian@ubuntu:~/hongtv$ ll total 16 drwxrwxr-x 4 javanian javanian 4096 Feb 18 16:14 ./ drwxrwxr-- 5 javanian javanian 4096 Feb 18 16:11 ../ drwxrwxr-x 2 javanian javanian 4096 Feb 18 16:12 dir1/ drwxrwxr-x 2 javanian javanian 4096 Feb 18 16:12 dir3/ -rw-rw-r-- 1 javanian javanian 0 Feb 18 16:14 test.txt javanian@ubuntu:~/hongtv$ mv test.txt dir1 javanian@ubuntu:~/hongtv$ ll total 16 drwxrwxr-x 4 javanian javanian 4096 Feb 18 16:15 ./ drwxrwxr-- 5 javanian javanian 4096 Feb 18 16:11 ../ drwxrwxr-x 2 javanian javanian 4096 Feb 18 16:15 dir1/ drwxrwxr-x 2 javanian javanian 4096 Feb 18 16:12 dir3/ javanian@ubuntu:~/hongtv$ ll dir1/ total 8 drwxrwxr-x 2 javanian javanian 4096 Feb 18 16:15 ./ drwxrwxr-x 4 javanian javanian 4096 Feb 18 16:15 ../ -rw-rw-r-- 1 javanian javanian 0 Feb 18 16:14 test.txt javanian@ubuntu:~/hongtv$ pwd /home/javanian/hongtv javanian@ubuntu:~/hongtv$ rm dir1/test.txt javanian@ubuntu:~/hongtv$ ll dir1 total 8 drwxrwxr-x 2 javanian javanian 4096 Feb 18 16:17 ./ drwxrwxr-x 4 javanian javanian 4096 Feb 18 16:15 ../ javanian@ubuntu:~/hongtv$ |
javanian@ubuntu:~/hongtv$ ll dir1 total 8 drwxrwxr-x 2 javanian javanian 4096 Feb 18 17:33 ./ drwxrwxr-x 4 javanian javanian 4096 Feb 18 17:33 ../ -rw-rw-r-- 1 javanian javanian 0 Feb 18 17:31 test1.txt javanian@ubuntu:~/hongtv$ pwd /home/javanian/hongtv javanian@ubuntu:~/hongtv$ rmdir dir1 rmdir: failed to remove 'dir1': Directory not empty javanian@ubuntu:~/hongtv$ rm -r dir1 javanian@ubuntu:~/hongtv$ ll total 12 drwxrwxr-x 3 javanian javanian 4096 Feb 18 17:34 ./ drwxrwxr-- 5 javanian javanian 4096 Feb 18 16:11 ../ drwxrwxr-x 2 javanian javanian 4096 Feb 18 16:12 dir3/ javanian@ubuntu:~/hongtv$ |
javanian@ubuntu:~/hongtv$ touch test1.txt javanian@ubuntu:~/hongtv$ ll total 12 drwxrwxr-x 3 javanian javanian 4096 Feb 18 17:44 ./ drwxrwxr-- 5 javanian javanian 4096 Feb 18 16:11 ../ drwxrwxr-x 2 javanian javanian 4096 Feb 18 16:12 dir3/ -rw-rw-r-- 1 javanian javanian 0 Feb 18 17:44 test1.txt javanian@ubuntu:~/hongtv$ mv dir3 dir1 javanian@ubuntu:~/hongtv$ ll total 12 drwxrwxr-x 3 javanian javanian 4096 Feb 18 17:45 ./ drwxrwxr-- 5 javanian javanian 4096 Feb 18 16:11 ../ drwxrwxr-x 2 javanian javanian 4096 Feb 18 16:12 dir1/ -rw-rw-r-- 1 javanian javanian 0 Feb 18 17:44 test1.txt javanian@ubuntu:~/hongtv$ cp test1.txt c_test1.txt javanian@ubuntu:~/hongtv$ ll total 12 drwxrwxr-x 3 javanian javanian 4096 Feb 18 17:46 ./ drwxrwxr-- 5 javanian javanian 4096 Feb 18 16:11 ../ -rw-rw-r-- 1 javanian javanian 0 Feb 18 17:46 c_test1.txt drwxrwxr-x 2 javanian javanian 4096 Feb 18 16:12 dir1/ -rw-rw-r-- 1 javanian javanian 0 Feb 18 17:44 test1.txt javanian@ubuntu:~/hongtv$ |
728x90
반응형
'네트워크,서버,프로그래밍' 카테고리의 다른 글
[Ubuntu Linux] Linux(Unix) 파일 찾기와 파일 정보 (0) | 2023.02.19 |
---|---|
[Ubuntu Linux] 나노(nano)를 이용한 파일편집 (0) | 2023.02.19 |
[Ubuntu Linux] Linux 쉘(shell) 기본 문법 (0) | 2023.02.17 |
[Ubuntu Linux] Linux 쉘(shell) (0) | 2023.02.16 |
[Ubuntu Linux] 우분투 방화벽(UFW) 설정 (0) | 2023.02.16 |