리눅스 / 명령어

명령어 개요
adduser 사용자 추가하는 명령어.
alias 명령어 별칭을 만든다.
cal calendar. 달력을 출력하는 명령어.
cat concatenate. 파일 내용 출력하는 명령어.
cd change directory. 다른 디렉토리로 이동하는 명령어.
chmod 파일 또는 디렉토리의 읽기, 쓰기, 실행 권한 설정하는 명령어
chown 파일 또는 디렉토리의 소유자(그룹) 설정하는 명령어
clear 터미널 화면의 내용을 다 지운다.
cp copy. 파일 또는 디렉토리 복사.
du disk usage. 디스크 사용량 출력.
file 파일의 종류를 출력하는 명령어
find 파일 또는 디렉토리를 검색하는 명령어
free 메모리 사용량 확인하는 명령어
history 이전에 실행한 명령어 목록 출력
locate 명령어 위치 찾기
ls list. 디렉토리와 파일 목록 출력
man manual. 설명서 출력. rm 명령어의 설명서를 보고 싶다면 man rm
mkdir make directory. 디렉토리를 만드는 명령어.
mv move. 파일 또는 디렉토리 이동.
passwd password. 사용자 비밀번호 생성 또는 변경.
poweroff 시스템 종료
pwd print working directory. 현재 작업 중인 디렉토리 출력.
rdate 타임서버의 시간과 동기화해주는 명령어
reboot 재부팅
rename 파일 이름 변경
rm remove. 파일 또는 디렉토리 삭제
rmdir remove directory. 빈 디렉토리를 삭제.
scp secure copy. ssh 프로토콜로 파일 복사
sftp SSH File Transfer Protocol
shutdown 종료 또는 재부팅
systemctl Control the systemd system and service manager.
touch 빈 파일 만들거나 파일 최종 수정 시간 변경.
useradd 사용자 추가하는 명령어.
userdel user delete. 사용자 삭제하는 명령어.
which 명령어 위치 찾기
whereis 명령어 위치 찾기
같은 카테고리의 다른 글

리눅스 / 명령어 / find / 파일 또는 디렉토리를 찾는 명령어

find는 파일 또는 디렉토리를 찾는 명령어이다. 현재 디렉토리 안에 있는 모든 파일과 디렉토리를 출력한다. 숨긴 파일 또는 숨긴 디렉토리도 출력한다. # find /etc 디렉토리 안에 있는 모든 파일과 디렉토리를 출력한다. 숨긴 파일 또는 숨긴 디렉토리도 출력한다. # find /etc 현재 디렉토리 안에서 이름이 abc인 파일 또는 abc인 디렉토리를 검색한다. # find -name abc 현재 디렉토리 안에서 이름이 ...

리눅스 / rsync / 동기화 프로그램

rsync는 동기화 프로그램이다. 백업할 때 유용하게 사용할 수 있다. 사용법 기본 abc 디렉토리 안의 def 디렉토리를 xyz 디렉토리 안에 동기화시킨다. 처음 실행하는 것이라면 xyz 디렉토리 안에 def 디렉토리가 복사된다. 다시 실행시키면 /abc/def 디렉토리의 내용 중 수정되거나 추가된 것만 /xyz/def 디렉토리로 복사된다. /abc/def에서 삭제된 내용은 /xyz/def에 반영되지 않는다. # rsync -avz /abc/def /xyz def 뒤에 /를 붙이면 def 디렉토리 ...

리눅스 / 명령어 / which, whereis, locate / 명령어 위치 찾기

명령어의 위치를 찾을 때 사용할 수 있는 명령어에는 which, whereis, locate가 있다. 명령어의 위치만 찾을 때는 which를 사용하고, 관련된 파일들의 위치까지 찾을 때는 whereis나 locate를 사용한다. which 명령어로 find 명령어를 찾는다. # which find /usr/bin/find whereis 명령어로 find 명령어를 찾는다. # whereis find find: /usr/bin/find /usr/share/man/man1/find.1.gz locate 명령어로 find 명령어를 찾는다. # locate find /usr/bin/find /usr/bin/find2perl /usr/bin/findmnt /usr/bin/nl-link-ifindex2name /usr/bin/nl-link-name2ifindex /usr/bin/oldfind /usr/lib64/python2.7/modulefinder.py /usr/lib64/python2.7/modulefinder.pyc /usr/lib64/python2.7/modulefinder.pyo /usr/sbin/btrfs-find-root /usr/sbin/findfs /usr/share/bash-completion/completions/findmnt /usr/share/doc/findutils-4.5.11 /usr/share/doc/findutils-4.5.11/AUTHORS /usr/share/doc/findutils-4.5.11/COPYING /usr/share/doc/findutils-4.5.11/ChangeLog /usr/share/doc/findutils-4.5.11/NEWS /usr/share/doc/findutils-4.5.11/README /usr/share/doc/findutils-4.5.11/THANKS /usr/share/doc/findutils-4.5.11/TODO /usr/share/doc/wpa_supplicant-2.6/examples/p2p/p2p_find.py /usr/share/doc/wpa_supplicant-2.6/examples/p2p/p2p_stop_find.py /usr/share/info/find-maint.info.gz /usr/share/info/find.info.gz /usr/share/locale/be/LC_MESSAGES/findutils.mo /usr/share/locale/bg/LC_MESSAGES/findutils.mo /usr/share/locale/ca/LC_MESSAGES/findutils.mo /usr/share/locale/cs/LC_MESSAGES/findutils.mo /usr/share/locale/da/LC_MESSAGES/findutils.mo /usr/share/locale/de/LC_MESSAGES/findutils.mo /usr/share/locale/el/LC_MESSAGES/findutils.mo /usr/share/locale/eo/LC_MESSAGES/findutils.mo /usr/share/locale/es/LC_MESSAGES/findutils.mo /usr/share/locale/et/LC_MESSAGES/findutils.mo /usr/share/locale/fi/LC_MESSAGES/findutils.mo /usr/share/locale/fr/LC_MESSAGES/findutils.mo /usr/share/locale/ga/LC_MESSAGES/findutils.mo /usr/share/locale/gl/LC_MESSAGES/findutils.mo /usr/share/locale/hr/LC_MESSAGES/findutils.mo /usr/share/locale/hu/LC_MESSAGES/findutils.mo /usr/share/locale/id/LC_MESSAGES/findutils.mo /usr/share/locale/it/LC_MESSAGES/findutils.mo /usr/share/locale/ja/LC_MESSAGES/findutils.mo /usr/share/locale/ko/LC_MESSAGES/findutils.mo /usr/share/locale/lg/LC_MESSAGES/findutils.mo /usr/share/locale/lt/LC_MESSAGES/findutils.mo /usr/share/locale/ms/LC_MESSAGES/findutils.mo /usr/share/locale/nl/LC_MESSAGES/findutils.mo /usr/share/locale/pl/LC_MESSAGES/findutils.mo /usr/share/locale/pt/LC_MESSAGES/findutils.mo /usr/share/locale/pt_BR/LC_MESSAGES/findutils.mo /usr/share/locale/ro/LC_MESSAGES/findutils.mo /usr/share/locale/ru/LC_MESSAGES/findutils.mo /usr/share/locale/rw/LC_MESSAGES/findutils.mo /usr/share/locale/sk/LC_MESSAGES/findutils.mo /usr/share/locale/sl/LC_MESSAGES/findutils.mo /usr/share/locale/sr/LC_MESSAGES/findutils.mo /usr/share/locale/sv/LC_MESSAGES/findutils.mo /usr/share/locale/tr/LC_MESSAGES/findutils.mo /usr/share/locale/uk/LC_MESSAGES/findutils.mo /usr/share/locale/vi/LC_MESSAGES/findutils.mo /usr/share/locale/zh_CN/LC_MESSAGES/findutils.mo /usr/share/locale/zh_TW/LC_MESSAGES/findutils.mo /usr/share/man/man1/find.1.gz /usr/share/man/man1/find2perl.1.gz /usr/share/man/man1/oldfind.1.gz /usr/share/man/man8/btrfs-find-root.8.gz /usr/share/man/man8/findfs.8.gz /usr/share/man/man8/findmnt.8.gz locate 명령어는 -n 옵션으로 출력 ...

리눅스 / 파일 또는 디렉토리 이름 바꾸는 방법

파일 이름 바꾸기 mv는 파일을 이동시키는 명령어이다. 이 명령어를 이용해서 파일 이름을 바꿀 수 있다. 예를 들어 다음은 abc.txt를 xyz.txt로 바꾼다. # mv abc.txt xyz.txt 디렉토리 이름 바꾸기 디렉토리 이름을 바꾸는 것도 파일 이름 변경과 같다. 다음은 abc 디렉토리의 이름을 xyz로 바꾼다. # mv abc xyz

리눅스 / 하드디스크 파디션 만들기, 포맷하기, 마운트하기

리눅스에서 하드디스크 파티션 만들고, 포맷 하고, 마운트 하는 방법을 요약한다. 장착된 하드디스크 확인하기 ls 명령어로 컴퓨터에 장착된 하드디스크 정보를 출력할 수 있다. /dev/sda, /dev/sdb 등이 하드디스크, /dev/sda1 등이 파티션이다. # ls -l /dev/sd* brw-rw----. 1 root disk 8, 0 Oct 16 13:12 /dev/sda brw-rw----. 1 root disk 8, 1 Oct 16 13:12 /dev/sda1 brw-rw----. 1 ...

리눅스 / crontab 사용법

cron & crontab cron은 특정 시간에 특정 작업을 수행하게 하는 시스템 대몬이다. 백업, 캐시 메모리 비우기 등 주기적으로 어떤 작업을 해야할 때 유용하다. crontab은 시간과 작업을 적은 텍스트 파일이다. 사용자별로 파일이 존재한다. cron은 모든 사용자의 crontab 파일을 찾아서, 적혀진 일정대로 작업을 수행한다. 작업 목록 보기 예약 작업 목록을 보고 싶다면 다음과 같이 명령한다. 사용자의 crontab ...

리눅스 / chown, chmod / 파일 또는 디렉토리 소유자, 소유그룹, 권한 설정

ls -l ls 명령어에 -l 옵션을 붙여서 파일 또는 디렉토리의 권한과 소유자(그룹)을 확인할 수 있습니다. 제일 앞에 있는 문자는 디렉토리인지 파일인지는 나타냅니다. d는 디렉토리라는 뜻이고, -는 파일이라는 뜻입니다. 그 다음 3개의 문자열은 소유자의 권한을, 그 다음 3개의 문자열은 소유그룹의 권한을, 그 다음 3개의 문자열은 소유자(그룹) 이외의 권한을 나타냅니다. 처음 나오는 jb는 소유자, 그 다음 ...

리눅스 / 그룹 / 그룹 조회, 그룹 추가, 그룹 삭제, 그룹 수정

그룹 조회 그룹 목록은 /et/group 파일에 있습니다. cat 명령어로 전체를 조회하거나... cat /etc/group tail 명령어로 마지막 부분을 조회할 수 있습니다. # tail -n 5 /etc/group avahi:x:70: slocate:x:21: rngd:x:974: tcpdump:x:72: vboxsf:x:973: X:Y:Z 형식으로 나오는데, X는 그룹 이름, Y는 그룹 비밀번호, Z는 그룹 ID입니다. 그룹 추가 groupadd 명령으로 그룹을 추가합니다. # groupadd group-1 # tail -n 5 /etc/group slocate:x:21: rngd:x:974: tcpdump:x:72: vboxsf:x:973: group-1:x:1000: 그룹 삭제 groupdel 명령으로 그룹을 삭제합니다. # ...

리눅스 / 명령어

명령어 개요 adduser 사용자 추가하는 명령어. alias 명령어 별칭을 만든다. cal calendar. 달력을 출력하는 명령어. cat concatenate. 파일 내용 출력하는 명령어. cd change directory. 다른 디렉토리로 이동하는 명령어. chmod 파일 또는 디렉토리의 읽기, 쓰기, 실행 권한 설정하는 명령어 chown 파일 또는 디렉토리의 소유자(그룹) 설정하는 명령어 clear 터미널 화면의 내용을 다 지운다. cp copy. 파일 또는 디렉토리 복사. du disk usage. 디스크 사용량 출력. file 파일의 종류를 출력하는 명령어 find 파일 또는 디렉토리를 검색하는 명령어 free 메모리 사용량 ...

리눅스 / 스왑 메모리(Swap Memory) 만드는 방법

리눅스 시스템이 메모리를 다 사용하면 프로그램이 멈추는 등 문제가 발생한다. 이때 스왑 메모리(Swap Memory) 늘려서 메모리 부족 문제를 해결할 수 있다. 스왑 파일 만들기 적당한 디렉토리에 적당한 이름의 파일을 적당한 크기로 만든다. 예를 들어 다음과 같이 하면, 루트 디렉토리에 jb-swap이라는 파일을 2G의 크기로 만든다. # fallocate -l 2G /jb-swap root만 읽고 쓸 수 있게 권한 ...