linux 命令列表
systemctl (Control the systemd system and service manager)
systemd 系统用来替代之前的linux 中的system V 目的在于统一系统服务,
并行启动系统服务程序,加快系统启动,大部分现代linux使用此程序引导系统.
常用命令如下
- pushd popd
pushd dir_name 切换目录的同时把当前目录圧入栈,方便后续使用popd 弹出栈切换目录
popd 弹出上一次的目录栈,相当于cd -
popd 可以多次使用,直到目录栈为空,cd - 多次使用只会在两个目录之间来回切换
grep
1
| $ grep -nrw getPower --include="*.h,*.c"
|
递归的查找当前目录中c文件和头文件,全词匹配 getPower -n 显示行号, -w 全词匹配 -r递归
sed(stream editor for filtering and transforming text)
流文本编辑器,执行格式匹配和替换 -i 输出到源文件
firewall-cmd 取代 ipfilter
debian系的 可以通过sudo apt-get -y install firewalld安装
* 开放端口
sudo firewall-cmd –permanent –add-port=22444/udp && sudo firewall-cmd –permanent –add-port=22444/tcp && sudo firewall-cmd –reload
* 关闭端口
sudo firewall-cmd –permanent –remove-port=22444/udp && sudo firewall-cmd –permanent –remove-port=22444/tcp && sudo firewall-cmd –reload
* 将80端口的流量转发至192.168.0.1的8080端口
sudo firewall-cmd –permanent –add-forward-port=port=80:proto=tcp:toaddr=192.168.0.1:toport=8080
*使防火墙规则生效
firewall-cmd –reload
* 列出所有的防火墙规则
firewall-cmd –list-all
* 列出所有的防火墙允许通过的服务规则
firewall-cmd –list-services
* 列出所有的防火墙开放端口规则 firewall-cmd –list-ports
6. yum install python-pip python34-pip
centos 安装pip 管理python包
cetnos selinux 下开启/变更 ssh 端口
linux 安装 libsodium
1 2
| wget https://download.libsodium.org/libsodium/releases/LATEST.tar.gz tar xfz LATEST.tar.gz && cd libsodium-stable/
|
centos 安装epel软件源
opensuse 搜索软件组
opensuse 中文指导文档
文档链接
查看linux运行级别
查看linux的默认网关
1 2
| $ route -n $ netstat -nr
|
install ssh
install man pages
1 2
| apt-get install manpages-posix-dev apt-get install glibc-doc
|
install git
1
| apt-get install git-core gitk
|
install build-essential
1
| atp-get install build-essential gcc-doc
|
change all files permession current dir
1
| find ./ -type d -exec chmod 644 {} \;
|
change all dir permession in current dir
1
| find path -type d -exec chmod 755 {} \;
|
what todo whit DHCP timeout is taking so long.
Edit /etc/sysconfig/network/dhcp and change the values for DHCLIENT_WAIT_AT_BOOT and DHCLIENT6 WAIT AT BOOT
目录介绍
- /usr/local/ 一般安装自己编译的软件
- debian系的/lib/systemd/system 目录下有各种service文件和系统运行级别的target文件
- debian系的 /usr/lib/systemd/usr/ 目录一般存放用户定义的service