리눅스 / 명령어

명령어 개요
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 명령어 위치 찾기
같은 카테고리의 다른 글
Rocky Linux 8 / 원격 데스크톱으로 연결하는 방법

Rocky Linux 8 / 원격 데스크톱으로 연결하는 방법

패키지 설치 다음과 같이 명령하여 EPEL(Extra Packages of Enterprise Linux) 저장소를 추가한다. dnf install epel-release xrdp 패키지를 설치한다. dnf install xrdp 방화벽 설정 원격 데스크톱이 사용하는 포트는 3389이다. firewall-cmd로 3389 포트를 열어준다. firewall-cmd --permanent --add-port=3389/tcp 방화벽을 다시 로드한다. firewall-cmd --reload 서비스 설정 systemctl 명령어로 xrdp 서비스를 시작한다. systemctl start xrdp 시스템 재부팅 후에도 자동으로 실행되게 하려면 다음과 같이 명령한다. systemctl enable xrdp 재부팅 위와 같이 했을 때 원격 ...

Ubuntu Server / 22.04 / 네트워크 세팅에 이더넷(Wired) 보이지 않을 때 해결 방법

Ubuntu Server / 22.04 / 네트워크 세팅에 이더넷(Wired) 보이지 않을 때 해결 방법

우분투 설정의 네트워크에 Wired가 보이지 않는다. 그것이 보여야 GUI로 IP 설정이 가능한데 말이다. 이를 보이게 하는 방법이 여러 가지가 있는 거 같은데, 내가 성공한 방법은... /etc/netplan/00-installer-config.yaml의 내용은 다음처럼 생겼을 것이다. # This is the network config written by 'subiquity' network: ethernets: eth0: dhcp4: true ...

Ubuntu 22.04 Server / 고정 IP 설정하는 방법

Ubuntu 22.04 Server / 고정 IP 설정하는 방법

설정 파일 수정하기 네트워크 설정 파일은 /etc/netplan 디렉토리 안에 있는 yaml 파일이다. DHCP로 설치했다면, 설정 파일 내용은 다음과 비슷하게 되어 있다. # This is the network config written by 'subiquity' network: ethernets: eth0: dhcp4: true version: 2 다음과 같이 수정하고 저장한다. IP 등은 네트워크 환경에 ...

Ubuntu 16.04 Server / logrotate 설치하고 설정하기

우분투(Ubuntu)는 여러 작업의 내용을 로그(Log) 파일로 남깁니다. 예를 들어 웹서버 운영과 관련된 로그는 /var/log/apache2에 있습니다. 로그는 기본적으로 하나의 파일에 계속 추가하는 것이어서, 시간이 지날수록 파일의 크기가 커집니다. 로그 파일의 크기가 너무 커지면, 시스템이 느려지거나 다운되기도 합니다. 이러한 문제를 해결해주는 패키지가 logrotate입니다. 로그 파일이 일정 기준을 충족하면 기존 로그 파일을 다른 이름으로 변경하여 저장하고 ...

Ubuntu / 특정 패키지만 업그레이드 하기, 보안 업데이트만 업그레이드 하기

우분투 서버에 접속하면 업데이트가 필요한 패키지가 있는지 알려줍니다. 두 가지 분류로 알려주는데, 하나는 패키지 업데이트, 또 하나는 보안 업데이트입니다. 소프트웨어는 보통 최신 버전을 유지하는 것이 좋지만, 업그레이드했을 때 문제가 없는지 충분히 확인을 해야 합니다. 따라서 특정 패키지만 업그레이드를 하거나, 보안 업데이트만 해야 하는 경우가 발생하는데, 어떻게 그런 작업을 하는지 알아보겠습니다. 특정 ...

CentOS / 버전 확인하는 방법

CentOS / 버전 확인하는 방법

cat /etc/redhat-release # cat /etc/redhat-release CentOS Linux release 7.4.1708 (Core) cat /etc/*release* # cat /etc/*release* CentOS Linux release 7.4.1708 (Core) Derived from Red Hat Enterprise Linux 7.4 (Source) NAME="CentOS Linux" VERSION="7 (Core)" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="7" PRETTY_NAME="CentOS Linux 7 (Core)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:centos:centos:7" HOME_URL="https://www.centos.org/" BUG_REPORT_URL="https://bugs.centos.org/" CENTOS_MANTISBT_PROJECT="CentOS-7" CENTOS_MANTISBT_PROJECT_VERSION="7" REDHAT_SUPPORT_PRODUCT="centos" REDHAT_SUPPORT_PRODUCT_VERSION="7" CentOS Linux release 7.4.1708 (Core) CentOS Linux release 7.4.1708 (Core) cpe:/o:centos:centos:7

Ubuntu 20.04 Server / 고정 IP 설정하는 방법

네트워크 설정 파일은 /etc/netplan 디렉토리 안에 있는 yaml 파일이다. DHCP로 설치했다면, 설정 파일 내용은 다음과 비슷하게 되어 있다. # This is the network config written by 'subiquity' network: ethernets: enp0s3: dhcp4: true version: 2 다음과 같이 수정하고 저장한다. IP 등은 네트워크 환경에 맞게 적절히 ...

리눅스 / 명령어 / systemctl

systemctl은 서비스를 관리하는 명령어이다. 서비스 상태 확인 systemctl status service_name.service 서비스 시작 systemctl start service_name.service 서비스 재시작 systemctl restart service_name.service 서비스 중지 systemctl stop service_name.service 부팅 시 서비스 자동 시작 systemctl enable service_name.service 부팅 시 서비스 자동 시작 해제 systemctl disable service_name.service 서비스 목록 보기 systemctl list-units --type=service

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

그룹 조회 그룹 목록은 /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 명령으로 그룹을 삭제합니다. # ...

리눅스 / 명령어 / 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 옵션으로 출력 ...