반응형

/*********************************************************************************************************
-- Title : [Lnx] 리눅스 관리 기초 명령어 모음
-- Reference : 웹검색
-- Key word : 리눅스 명령어 linux command

*********************************************************************************************************/


# -- File Navigation

> ls

> ls -a

> ls -l

> ls -alh

> ls -alZ

> ls -Rcd 


# -- Directory Navigation

> pwd

> cd /tmp

> cd ..



# -- File Viewing

> vi ttt.txt

> vim 

> cat

> tail

> head

> grep

> cut

> wc


# -- File Editing

> vi

> vim

> sed

> awk


# -- File Managing

> touch

> cp

> mv

> rm

> mkdir

> rmdir

> cp -r

> rm -rf


# -- Symbolic Link Making

> ln -s ./mapbak/ttt.txt new.txt


# -- Users and Groups Viewing

> id

> /etc/passwd

> /etc/group

> su - 

> sudo

> /etc/sudoers

> w


# -- User Accounts Managing

> useradd

> usermod

> userdel

> passwd

> groupadd

> groupmod

> groupdel


# -- Permissioin Changing

> chmod go-rw file1

> chmod a+x file2

> chmod 750 file3


# -- ownership Changing

> chown user:group file1

> chown -R user dir1

> chown :group dir2


# -- Process Showing

> ps

> ps axu

> ps axjf

> ps axZ

> pstree

> man ps


# -- Process Killing

> kill

> kill -9 {PID}

> killall

> pkill

> man 7 signal


# -- Process Monitoring

> grep "model name" /proc/cpuinfo

> uptime

> top

> htop

> nmon


# -- Software Package

> yum list "http*'

> yum search all 'web server'

> yum info httpd

> yum provides '/*httpd'

> yum install httpd

> yum update

> yum remove httpd

> yum history

> yum history info 2

> yum -y install bash-completion


# -- Service managing

> systemctl status sshd             -- Fedora?

> systemctl start httpd

> systemctl stop httpd

> systemctl reload httpd

> systemctl enable httpd

> systemctl disable httpd


> service httpd status               -- CentOS?

> service httpd start

> service httpd stop

> service httpd restart

> service httpd reload

> chkconfig httpd on 

> chkconfig httpd off


# -- Network Validating

> ip a

> ifconfig

> ip -s link show eth0

> ip route

> trace path access.redhat.com

> ss -tua

> netstat -anlp


# -- Network Configuation

> /etc/sysconfig/network-scripts/ifcfg-<name>

    7: nmcli con reload

    6: service network restart

> hostname

    7: hostnamectl

    6: /etc/sysconfig/network

> /etc/hosts 

> /etc/resolv.conf


# -- Firewall

> systemctl stop firewalld

> systemctl mask firewalld

> yum install iptables-services

> systemctl umask iptables

> systemctl enable iptables

> systemctl start iptables

> systemctl status iptables

> iptables -L

> systemctl reload iptables


> vi /etc/sysconfig/iptables     -- CentOS?

    *filter

    :INPUT ACCEPT [0:0]

    :FORWARD ACCEPT [0:0]

    :OUTPUT ACCEPT [0:0]

    -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

    -A INPUT -p icmp -j ACCEPT

    -A INPUT -i lo -j ACCEPT

    -A INPUT -s 172.16.0.0/12 -m state --state NEW -j ACCEPT

    -A INPUT -s 10.0.0.0/8 -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

    -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT

    -A INPUT -j REJECT --reject-with icmp-host-prohibited

    -A FORWARD -j REJECT --reject-with icmp-host-prohibited

    COMMIT


# -- Hardware and System Information

    o 하드웨어 정보 및 용량 확인(dbrang.tistory.com/584)

    o CPU 정보 보기(dbrang.tistory.com/561)

    o 리눅스 종류, 버전 및 패키지, CPU 정보 확인(dbrang.tistory.com/505)

    o 호스트명 확인 및 변경, 버전 확인(dbrang.tistory.com/557)


    






반응형

+ Recent posts