ls -[OPTION]...[FILE/DIRECTORY]...
- -[OPTION]
-l
파일의 상세 정보(권한, 소유자, 그룹, 용량, 생성 시각 등의 정보)를 출력
-a
숨김 파일까지 모두 보기
-al
두 옵션을 합쳐서 숨김 파일, 상세정보 동시에 확인
cat -[0PTION]... [FILE]...
cat [파일]
cat 뒤에 옵션 사용하지 않고 파일 이름만 입력하면, [파일] 내용 출력cat ./[파일]
현재 디렉토리에 있는 [파일] 내용 출력- 파일명에 공백이 있을 경우
cat [F\ I\ L\ E ]
cat [ "FILE" ]
- cat [F
tab
] ->cat F/ I/ L/ E
" - "
- 리눅스 명령어 옵션 지정할때 사용
디렉토리
- " / " (루트 디렉토리)
: 리눅스 최상위 디렉토리
- 절대경로
- 현재 위치와는 상관없이" / "를 기준으로 해당 위치까지의 경로
pwd
로 확인 가능- 상대경로
- 현재 자신이 위치한 디렉토리를 기준으로 하는 경로
./
현재 디렉토리../
상위 디렉토리
ls
home directory의 “spaces in this filename” file
cat spaces in this filename
→ cat spaces\ in\ this\ filename
“spaces in this filename” file 열기
Linux는 일반적으로 공백을 문자로 인식하지 않는다.
💡 How do you deal with spaces in filename, then? :
- 띄어쓰기 앞에
\
(backslash)- 공백을 포함한 문자열을 따옴표
""
로 감싸tab
자동완성
(cat spaces하고 탭 누르니까 알아서 \ 넣어서 완성해 주네??)
ssh bandit3@bandit.labs.overthewire.org -p 2220