Linux
알아두면 좋을 리눅스 명령어
콴트
2021. 11. 18. 22:34
개인메모용으로 계속 업데이트 예정.
1. sudo없이 docker 실행
sudo usermod -aG docker [사용자명]
2. 매번 sudo 없이 실행.
sudo visudo
추가 -> [username] ALL=(ALL) NOPASSWD:ALL
3. 모든 service 목록 보기
systemctl list-units --type service
4. hostname 변경
hostnamectl set-hostname 호스트명
sudo vim /etc/hosts # 들어가서 호스트명 변경
reboot
5. networking 관한
ip link
# 스위치에 연결된 device 이름
ip addr add [cidr] dev eth0
# 스위치의 device와 ip를 연결
route
# route configuration을 보여준다.
ip addr add [dest cidr] via [gateway ip]
# route configuration 설정
ip route add default via [gateway ip]
# gateway ip 설정