리눅스 명령어
업데이트:
- 리눅스 명령어를 알아보자
- Directory: folder를 의미한다
Directory 기호
Symbol | Description |
---|---|
~ | 현재 접속 중인 Home directory를 나타낸다. |
./ | 현재 사용자가 작업 중인 directory |
../ | 상위 directory |
* | Wildcard |
? | 문자 하나를 의미하는 Wildcard |
help manual
man <command>
option
리눅스 명령어 뒤에 -<option>
을 추가해 출력 조건을 변경한다.
command
pwd
Print Working Directory, 현재 작업 중인 directory 경로를 출력한다.
pwd
ls
List, 현재 작업 중인 directory에 있는 file과 directory를 출력한다.
ls -alt
Option | Description |
---|---|
-a | 숨긴 파일과 폴더를 출력한다.(all) |
-l | 파일과 폴더의 상세 정보를 출력한다.(long format) |
-r | 정렬 순서를 거꾸로 출력한다.(reverse) |
-t | 작성 시간에 따라 내림차순으로 출력한다. (time & date) |
-i | inode index number를 출력한다. |
cd
Change Directory, directory를 이동한다.
cd
orcd ~
- Home directory로 이동한다.
cd ..
- 상위 directory로 이동한다.
cd /
- Root directory로 이동한다.
cd <directory>
- directory로 이동한다.
mkdir
Make Directory, directory를 생성한다.
rm
Remove, 현재 directory 내 존재하는 file이나 directory를 삭제한다.
rm -rf <directory>
Option | Description |
---|---|
-r | directory를 삭제한다. |
-f | 삭제 여부를 확인하지 않고 바로 삭제한다.(force) |
mv
Move, file과 directory를 이동한다.
mv <option> <이동할 것> <이동할 위치>
Option | Description |
---|---|
-f | 이동 여부를 확인하지 않고 바로 이동한다.(force) |
-v | 완료된 결과를 출력한다.(verbose) |
cp
Copy, file을 복사한다.
cp <option> <복사할 파일 이름.확장자> <복사될 파일 이름.확장자>
cat
Catenate, file을 연결하거나(concatenate) 출력한다.
cat test1.txt, test2.txt > test.txt
- test1.txt과 test2.txt 파일을 차례로 연결해서 새로운 파일 test.txt를 생성한다.
cat test3.txt >> test.txt
- test3.txt 파일의 내용을 test.txt 파일 끝에 추가한다.
참고자료(References)
- 이고잉, 고경희(2020). 지옥에서 온 문서관리자 깃&깃허브 입문. 서울: 이지스퍼블리싱.
- https://www.rapidtables.com/code/linux/index.html
- https://gomguard.tistory.com/73
댓글남기기