리눅스에서 기본적으로 알아야 할 명령어들을 정리했습니다. 이 명령어들은 리눅스 시스템에서 파일 관리, 프로세스 제어, 시스템 정보 확인 등 다양한 작업에 필수적입니다.
파일 및 디렉토리 관리
ls
디렉토리 내용 보기ls: 현재 디렉토리 내용 나열ls -l: 상세 정보 포함ls -a: 숨김 파일 포함
cd
디렉토리 이동cd /path/to/directory: 해당 경로로 이동cd ..: 상위 디렉토리로 이동cd ~: 홈 디렉토리로 이동
pwd
현재 디렉토리 경로 확인mkdir
새 디렉토리 생성mkdir directory_name
rm
파일/디렉토리 삭제rm file_name: 파일 삭제rm -r directory_name: 디렉토리와 내용 삭제rm -rf directory_name: 강제 삭제
cp
파일/디렉토리 복사cp source_file destination_file: 파일 복사cp -r source_directory destination_directory: 디렉토리 복사
mv
파일/디렉토리 이동 또는 이름 변경mv old_name new_name: 이름 변경mv file_name /path/to/destination: 파일 이동
파일 읽기 및 편집
cat
파일 내용 출력cat file_name
less
파일 내용 페이지 단위로 보기less file_name: 스크롤 가능
nano/vim
텍스트 파일 편집
nano file_name: 간단한 편집기vim file_name: 강력한 편집기 (초보자에게는 약간 어려울 수 있음)
파일 권한 및 소유권
chmod
파일 권한 변경
chmod 755 file_name: 읽기/쓰기/실행 권한 설정chmod +x script.sh: 실행 권한 추가
chown
파일 소유자 변경
chown user_name file_name: 소유자 변경
시스템 정보 및 관리
ps
현재 실행 중인 프로세스 확인
ps -ef: 상세 정보 포함
top
실시간 시스템 모니터링df
디스크 공간 확인
df -h: 사람이 읽기 쉬운 형식
du
디렉토리 크기 확인
du -h: 사람이 읽기 쉬운 형식du -sh directory_name: 특정 디렉토리의 크기
free
메모리 사용량 확인
free -h: 사람이 읽기 쉬운 형식
uptime
시스템 가동 시간 및 부하 확인whoami
현재 사용자 확인
네트워크
ping
네트워크 연결 상태 확인
ping google.com
ifconfig또는ip
네트워크 설정 확인 및 관리
ifconfig(구형)ip a: 네트워크 인터페이스 정보 보기
curl/wget
파일 다운로드 및 HTTP 요청
curl http://example.comwget http://example.com
압축 및 압축 해제
tar
파일 압축 및 해제
tar -cvf archive.tar file_name: 압축tar -xvf archive.tar: 압축 해제
zip/unzip
ZIP 파일 압축 및 해제
zip archive.zip file_nameunzip archive.zip
기타 유용한 명령어
history
실행했던 명령어 기록 보기alias
명령어 단축어 만들기
alias ll='ls -l':ll로ls -l실행
shutdown/reboot
시스템 종료 및 재부팅
shutdown now: 즉시 종료reboot: 재부팅
