반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 총정리
- 구현
- singly Linked List
- data_structure
- Articulation_Point
- class_template
- Biconnected_Component
- 백준
- list
- red-black tree
- '0'
- c++
- Heap
- 알고리즘
- Algorithm
- 예제
- 13305
- sstream
- sort
- 5397
- STL
- template
- connected_component
- qsort
- deletion
- Pair
- 문법
- Critical_Path_Analysis
- function_template
- 자료구조
Archives
- Today
- Total
- Today
- Total
- 방명록
어제의 나보다 성장한 오늘의 나
[Linux] 자주 사용하는 리눅스 명령어 예제 및 총정리 본문
반응형
◎ 리눅스 명령어는 여기저기 정말 많이 사용되기 때문에 잘 알아두어야 한다.
◎ 많이 사용되는 명령어 위주로 정리해 보았다.
① pwd : 현재 작업중인 디렉토리를 출력한다.
$ pwd
/home/inhyuk13/바탕화면
② cd : 작업중인 디렉토리 이동
$ cd .. // 상위 디렉토리로 이동
$ pwd
/home/inhyuk13
$ cd - // 이전 디렉토리로 이동.
$ pwd
/home/inhyuk13/바탕화면
$ cd test/test2 // 여러 디렉토리 이동. '/' 사용
$ pwd
/home/inhyuk13/바탕화면/test/test2
$ cd ~ or $ cd // home 디렉토리로 이동.
$pwd
/home/inhyuk13
③ ls : 디렉토리 목록 확인
$ ls // 현재 디렉토리 안에 있는 파일, 폴더 목록 출력
test test2 test3 dir dir2
$ ls -l // 현재 디렉토리 안에 있는 상세목록 출력.
drwxrwxr-x 3 inhyuk13 inhyuk13 4096 3월 13 18:20 dir
-rw-rw-r-- 1 inhyuk13 inhyuk13 6 3월 13 18:24 test
// 권한 포함된파일수 소유자 그룹 크기 수정일자 파일이름.
$ ls -a // 숨겨진 파일도 나타냄.
$ ls -al // -a , -l을 같이 한 효과
④ cat : 파일 읽기 및 생성
$ cat test // test 파일 읽기
Hello world!
$ cat > test2 // test2 파일 작성
Hello
World // 작성이 끝나면 ctrl + d 눌러줘야 한다.
$ cat >> test // 이어 쓰기.
Hi!
⑤ mkdir : 폴더 생성
$ mkdir new_dir // 폴더 생성
$ ls
new_dir
$ mkdir -p a/b/c/d/e // -p를 하면 하위 디렉토리를 지닌 디렉토리 생성 가능.
$ ls
a new_dir
⑥ rm : 파일/폴더 삭제
-r를 붙이면 폴더 삭제 가능.
$ ls
test_dir test_file
$ rm test_file
$ rm -r test_dir
// $ rmdir test_dir도 가능
⑦ cp : 파일/폴더 복사
폴더를 복사하려면 -r를 붙여줘야 한다.
$ cp 복사할파일명 새로만들파일명
$ cp test test_cp // test의 내용을 가진 test_cp가 생성
$ cp -r 복사할폴더명 새로만들폴더명
$ cp -r testdir testdir_cp // testdir 내용을 지닌 testdir_cp 생성
⑧ mv : 파일/폴더 이동
$ ls
test testdir
$ mv test test_mv // test_mv가 없을 때 test 이름을 test_mv로 변경한다.
$ ls
test_mv testdir
$ mv test_mv testdir //testdir은 존재하므로 testdir로 이동된다.
$ ls
testdir
반응형
Comments