리눅스 / 게이트웨이(gateway) 확인하는 방법
리눅스에서 네트워크 정보는 주로 ifconfig, ip addr 명령어로 확인합니다.
그런데, gateway 정보는 나오지 않습니다. 만약 gateway 정보가 필요하다면 route 명령어를 사용합니다.
같은 카테고리의 다른 글
리눅스 / 로그아웃 명령어, 재부팅 명령어, 종료 명령어
로그아웃 명령어 logout exit 재부팅 명령어 즉시 재부팅 reboot shutdown -r now init 6 일정 시간 또는 일정 시간 후 재부팅 10분 후 재부팅 shutdown -r 10 12시에 재부팅 shutdown -r 12:00 취소 shutdown -c 종료 명령어 즉시 종료 poweroff shutdown -h now shutdown -P now halt -p init 0 일정 시간 또는 일정 시간 후에 종료 10분 후에 종료 shutdown -P 10 13시에 종료 shutdown -P 13:00 취소 shutdown -c 기타 10분 후에 종료할 거라는 메시지를 사용자에게 보내지만, 종료하지는 ...
리눅스 / 명령어 / rmdir / 빈 디렉토리 삭제하는 명령어
rmdir rmdir은 빈 디렉토리를 삭제하는 명령어입니다. Remove the DIRECTORY(ies), if they are empty. 사용법 rmdir directory a 디렉토리를 삭제합니다. rmdir a 비어있다면 삭제를 하고, 그렇지 않다면 다음을 출력합니다. rmdir: failed to remove ‘a’: Directory not empty rmdir --ignore-fail-on-non-empty directory 디렉토리가 비어있지 않아도 메시지를 출력하지 않습니다. rmdir -v directory 현재 디렉토리 안에 있는 모든 비어있는 디렉토리를 삭제합니다. v 옵션을 넣으면 작업 결과를 출력합니다. rmdir -v ...
리눅스 / 명령어 / which, whereis, locate / 명령어 위치 찾기
명령어의 위치를 찾을 때 사용할 수 있는 명령어에는 which, whereis, locate가 있습니다. 명령어의 위치만 찾을 때는 which를 사용하고, 관련된 파일들의 위치까지 찾을 때는 whereis나 locate를 사용합니다. 각 명령어로 find 명령어를 찾아보겠습니다. # which find /usr/bin/find # whereis find find: /usr/bin/find /usr/share/man/man1/find.1.gz # 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 옵션으로 출력 개수를 정할 수 있습니다. # locate ...
리눅스 / 절전 모드 진입 끄는 방법, 노트북 덮개 닫아도 켜져 있게 하는 방법
노트북에 리눅스를 설치했다. 노트북에 설치했지만 용도는 서버용. 그래서 항상 켜져 있어야 한다. 그런데 노트북의 특성인지 일정 시간이 지나면 절전 모드로 들어가고, 노트북 덮개를 닫으면 잠금(?) 상태가 된다. 그래서 서비스가 중지되거나 원격 연결이 되지 않는데... 항상 켜져 있게 하는 방법은 다음과 같다. 절전 모드 진입하기 않게 하는 방법 다음과 같이 명령하면 절전 모드가 해제된다. # ...
파일 이름 바꾸기 mv는 파일을 이동시키는 명령어이다. 이 명령어를 이용해서 파일 이름을 바꿀 수 있다. 예를 들어 다음은 abc.txt를 xyz.txt로 바꾼다. mv abc.txt xyz.txt 디렉토리 이름 바꾸기 디렉토리 이름을 바꾸는 것도 파일 이름 변경과 같다. 다음은 abc 디렉토리의 이름을 xyz로 바꾼다. mv abc xyz
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
리눅스 / LVM / 만드는 방법, 수정하는 방법, 삭제하는 방법
1TB 디스크와 2TB 디스크를 추가했다고 하자. 디스크 크기에 맞게 그대로 사용할 수도 있지만, 3TB 하나인 것처럼 사용하거나 1.5TB 두 개인 것처럼 사용하고 싶을 수도 있다. 즉, 물리적인 디스크 크기와 무관하게 자유롭게 볼륨을 만들고 싶은 것이다. 이럴 때 사용하는 것이 LVM(Logical Volume Manager)이다. 여러 개의 볼륨을 하나로 묶은 후 다시 배분하여 사용한다.(이렇게 ...
레드 햇(Red Hat) 평가판 다운로드하고 설치하는 방법
Red Hat은 유료 프로그램이다. 설치는 가능하나 업데이트나 패키지를 설치할 수 없다. 그러나 평가판이 있으므로 체험이 가능하다. 기간은 60일로 그리 짧지도 않고 길지도 않다. 귀찮은 점은 회원 가입을 해야 한다는 것이고, 60일 사용 후에 다시 체험판을 사용하고 싶다면 90일을 기다려야 한다는 것이다. 하지만 회원 가입 시 본인 인증 절차 같은 건 ...
리눅스 / 사용자 / 사용자 조회, 사용자 추가, 사용자 삭제, 사용자 수정
사용자 조회 모든 사용자를 출력합니다. # cat /etc/passwd root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/sbin/nologin daemon:x:2:2:daemon:/sbin:/sbin/nologin adm:x:3:4:adm:/var/adm:/sbin/nologin lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin sync:x:5:0:sync:/sbin:/bin/sync shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown halt:x:7:0:halt:/sbin:/sbin/halt mail:x:8:12:mail:/var/spool/mail:/sbin/nologin operator:x:11:0:operator:/root:/sbin/nologin games:x:12:100:games:/usr/games:/sbin/nologin ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin ... root과 useradd 또는 adduser를 통해 생성한 사용자 계정을 출력합니다. # grep /bin/bash /etc/passwd root:x:0:0:root:/root:/bin/bash jb:x:1000:1000:JB:/home/jb:/bin/bash 사용자 추가 useradd jb 사용자를 만듭니다. useradd jb 사용자 홈 디렉토리도 같이 만들고 싶다면 -d 옵션을 사용합니다. useradd jb -d /home/jbdir jb 사용자의 비밀번호를 만듭니다. passwd jb adduser adduser 명령어로 사용자를 추가할 수 있습니다. useradd와는 달리 사용자 홈 디렉토리를 자동으로 만들고, 비밀번호 ...
리눅스 / 명령어 / cd / 다른 디렉토리로 이동하는 명령어
cd cd는 change directory의 약자로, 다른 디렉토리로 이동하는 명령어입니다. cd 현재 로그인한 사용자의 홈 디렉토리로 이동합니다. 일반적으로 root 계정이라면 /root로, 사용자 jb 계정이라면 /home/jb로 이동합니다. cd ~user user의 홈 디렉토리로 이동합니다. 다음과 같이 명령하면 jb 사용자의 홈 디렉토리로 이동합니다. cd ~jb cd 디렉토리명 지정한 디렉토리로 이동합니다. 절대경로, 상대경로 다 사용할 수 있습니다. 다음과 같이 명령하면 /etc 디렉토리로 이동합니다. cd /etc 현재 디렉토리에 속한 디렉토리 ...