#파일 관리
| 명령어 | 설명 | |
|---|---|---|
ls | 파일 목록 | |
ls -la | 숨김 파일 포함 상세 | |
ls -lh | 사람이 읽기 쉬운 크기 | |
touch [file] | 빈 파일 생성 | |
cp [src] [dest] | 파일 복사 | |
cp -r [src] [dest] | 디렉토리 복사 | |
mv [src] [dest] | 이동/이름 변경 | |
rm [file] | 파일 삭제 | |
rm -rf [dir] | 디렉토리 강제 삭제 | |
mkdir [dir] | 디렉토리 생성 | |
mkdir -p [path] | 중간 디렉토리 포함 생성 | |
rmdir [dir] | 빈 디렉토리 삭제 | |
ln -s [target] [link] | 심볼릭 링크 생성 |
#파일 보기
| 명령어 | 설명 | |
|---|---|---|
cat [file] | 파일 내용 출력 | |
less [file] | 페이지 단위 보기 | |
head [file] | 앞 10줄 출력 | |
head -n 20 [file] | 앞 20줄 출력 | |
tail [file] | 마지막 10줄 출력 | |
tail -f [file] | 실시간 파일 추적 | |
wc [file] | 줄/단어/바이트 수 | |
wc -l [file] | 줄 수만 출력 |
#검색
| 명령어 | 설명 | |
|---|---|---|
find [path] -name [pattern] | 이름으로 파일 찾기 | |
find . -type f | 파일만 찾기 | |
find . -type d | 디렉토리만 찾기 | |
find . -mtime -7 | 7일 내 수정된 파일 | |
grep [pattern] [file] | 패턴 검색 | |
grep -r [pattern] [dir] | 재귀적 검색 | |
grep -i [pattern] | 대소문자 무시 | |
grep -n [pattern] | 줄 번호 표시 | |
grep -v [pattern] | 패턴 제외 | |
which [cmd] | 명령어 경로 찾기 | |
whereis [cmd] | 바이너리/소스/매뉴얼 찾기 |
#권한
| 명령어 | 설명 | |
|---|---|---|
chmod 755 [file] | 권한 변경 (숫자) | |
chmod +x [file] | 실행 권한 추가 | |
chmod -w [file] | 쓰기 권한 제거 | |
chmod u+x [file] | 소유자에 실행 권한 | |
chown [user] [file] | 소유자 변경 | |
chown user:group [file] | 소유자와 그룹 변경 | |
chgrp [group] [file] | 그룹 변경 |
#프로세스
| 명령어 | 설명 | |
|---|---|---|
ps | 현재 프로세스 | |
ps aux | 모든 프로세스 상세 | |
ps aux | grep [name] | 프로세스 검색 | |
top | 실시간 프로세스 모니터 | |
htop | 향상된 프로세스 모니터 | |
kill [pid] | 프로세스 종료 | |
kill -9 [pid] | 강제 종료 | |
killall [name] | 이름으로 종료 | |
bg | 백그라운드로 전환 | |
fg | 포그라운드로 전환 | |
jobs | 백그라운드 작업 목록 | |
nohup [cmd] & | 로그아웃 후에도 실행 |
#디스크/메모리
| 명령어 | 설명 | |
|---|---|---|
df -h | 디스크 사용량 | |
du -sh [dir] | 디렉토리 크기 | |
du -h --max-depth=1 | 1단계 하위 크기 | |
free -h | 메모리 사용량 | |
mount [dev] [dir] | 장치 마운트 | |
umount [dir] | 언마운트 |
#네트워크
| 명령어 | 설명 | |
|---|---|---|
ping [host] | 호스트 연결 확인 | |
curl [url] | URL 요청 | |
curl -O [url] | 파일 다운로드 | |
wget [url] | 파일 다운로드 | |
ssh user@host | SSH 접속 | |
scp [file] user@host:[path] | 원격 파일 복사 | |
netstat -tulpn | 열린 포트 확인 | |
ss -tulpn | 소켓 통계 | |
ifconfig | 네트워크 인터페이스 | |
ip addr | IP 주소 확인 |
#압축
| 명령어 | 설명 | |
|---|---|---|
tar -cvf arch.tar [files] | tar 아카이브 생성 | |
tar -xvf arch.tar | tar 압축 해제 | |
tar -czvf arch.tar.gz [files] | gzip 압축 | |
tar -xzvf arch.tar.gz | gzip 해제 | |
zip arch.zip [files] | zip 압축 | |
unzip arch.zip | zip 해제 | |
gzip [file] | gzip 압축 | |
gunzip [file.gz] | gzip 해제 |
#리다이렉션/파이프
| 명령어 | 설명 | |
|---|---|---|
cmd > file | 출력을 파일로 (덮어쓰기) | |
cmd >> file | 출력을 파일에 추가 | |
cmd < file | 파일을 입력으로 | |
cmd 2> file | 에러를 파일로 | |
cmd &> file | 출력+에러를 파일로 | |
cmd1 | cmd2 | 파이프 | |
cmd | tee file | 출력 + 파일 저장 | |
cmd | xargs [cmd2] | 인자로 전달 |
#텍스트 처리
| 명령어 | 설명 | |
|---|---|---|
sort [file] | 정렬 | |
sort -r [file] | 역순 정렬 | |
sort -n [file] | 숫자 정렬 | |
uniq [file] | 중복 제거 | |
cut -d: -f1 [file] | 필드 추출 | |
awk '{print $1}' [file] | 첫 번째 컬럼 | |
sed 's/old/new/g' [file] | 문자열 치환 | |
tr 'a-z' 'A-Z' | 문자 변환 |
#시스템
| 명령어 | 설명 | |
|---|---|---|
uname -a | 시스템 정보 | |
hostname | 호스트 이름 | |
uptime | 가동 시간 | |
whoami | 현재 사용자 | |
id | 사용자 ID 정보 | |
date | 현재 날짜/시간 | |
cal | 달력 | |
history | 명령어 기록 | |
sudo [cmd] | 관리자 권한 실행 | |
su - [user] | 사용자 전환 | |
shutdown -h now | 지금 종료 | |
reboot | 재부팅 |
이 포스팅은 쿠팡 파트너스 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받습니다.