Linux 各种命名规范
1、文件名不能包括反斜线字符 “/” “NUL(空)”,其它字符均可。
2、主机名不支持下划线字符 “_”,可使用字母、数字、横线组合,部分软件对主机名有特殊要求。
命令帮助
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| [root@tencent ~] alias ls='ls --color=auto' /usr/bin/ls [root@tencent ~] trap is a shell builtin [root@tencent ~]
[root@tencent ~] vim is /usr/bin/vim [root@tencent ~] [root@tencent ~]
[root@tencent ~] ls (1) - list directory contents ls (1p) - list directory contents
|
Rocky Linux 安装后必需所做的初始化操作
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| sed -i '/^SELINUX=/c SELINUX=disabled' /etc/selinux/config
systemctl disable --now firewalld
yum -y install autofs systemctl enable --now autofs
sed -e 's|^mirrorlist=|#mirrorlist=|g' \ -e 's|^#baseurl=http://dl.rockylinux.org/$contentdir|baseurl=https://mirrors.aliyun.com/rockylinux|g' \ -i.bak \ /etc/yum.repos.d/Rocky*.repo yum makecache yum list
yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel* sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*
[root@rocky8 ~] [root@rocky8 ~] [root@rocky8 ~]
[root@rocky ~] [root@rocky ~] DEVICE=eth0 NAME=eth0 BOOTPROTO=static IPADDR=10.0.0.129 PERFIX=24 GATEWAY=10.0.0.2 DNS1=223.5.5.5 DNS2=180.76.76.76 [root@rocky ~] [root@rocky ~]
yum -y install autofs vim vim-enhanced tcpdump autofs chrony lrzsz tree telnet ftp lftp bash-completion net-tools postfix wget bzip2 zip unzip xz lsof mlocate man-pages rsync gcc autoconf gcc-c++ iotop nfs-utils openssl-devel pcre-devel systemd-devel tmux dos2unix redhat-lsb-core
|
Ubuntu开启root远程登录功能
1 2 3 4
| sudo -i passwd root sed -i '/PermitRootLogin/c PermitRootLogin yes' /etc/ssh/sshd_config systemctl restart sshd
|
网络检查命令
1 2 3 4 5
| 监听端口:ss -ntlp 监听端口:losf -i :port IP地址:ip a 网关: route -n DNS: cat /etc/resolv.conf
|
CentOS6设置主机名
1 2
| [root@x-z ~] [root@x-z ~]
|
CentOS7设置主机名