基础软件安装办法
日常命令
- 设置root密码
sudo passwd -
- 编辑只读文件保存:
- w !sudo tee %;
- 磁盘空间查看
df -lh - docker空间占用查看
docker system df -v
查询端口号以及应用
- 查询端口号以及应用进程
netstat -nultp|grep java - 查询进程以及应用
ps -ef grep|java - 查看端口号连接情况: telnet localhost 5432
服务指定位置安装
yum -y --install root=/opt/wkhtmltox install wkhtmltopdf
or make DESTDIR=/opt/wkhtmltox install
环境变量添加
-
添加临时环境变量方法:
在命令行输入:
export PATH=$PATH:/usr/local/....(你的环境变量路径)。 - 想要永久添加环境变量,步骤如下:
1.在~/.bashrc文件末尾添加如下:
export PATH=$PATH:/usr/local/...(待添加路径)
保存;
2.在命令行输入:source ~/.bashrc;
3.命令行输入:echo $PATH。显示环境变量添加成功。
apt install
git git-flow graphviz
zsh主要自动补全
sudo apt-get install zsh sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
- 切换bash chsh -s /bin/bash
- 切换zsh chsh -s /bin/zsh
网速查看
yum -y install iftop
iftop -pb
执行进度查看
查看cp, mv, dd, tar, cat, rsync, grep, fgrep, egrep, cut, sort, md5sum, sha1sum, sha224sum, sha256sum, sha384sum, sha512sum, adb, gzip, gunzip, bzip2, bunzip2, xz, unxz, lzma, unlzma, 7z, 7za, zcat, bzcat, lzcat, split, gpg, or wrong permissions进度
wget https://github.com/Xfennec/progress/archive/v0.14.tar.gz
tar -zxvf v0.14.tar.gz
make && make install
progress
扩展仓库安装
yum -y install epel-release
命令补全
- 使用systemctl如何补全服务名称
yum install -y bash-completion
windows共享挂载
apt install cifs-utils sudo mount -t cifs //192.168.1.108/share /mnt/share -o username=Administrator,password=lukelee,rw,dir_mode=0777,file_mode=0777
openconnect 远程连接
sudo openconnect vpn.hnzhzw.com:888 -u luke
luke@zhzw.2020
推荐 Remmina + tightvnc
unzip解压乱码
unzip -O cp936 xxx.zip
链接管理
软链接
- 创建
软链接:ln -s 源文件 链接名硬链接
- 创建
硬链接:ln 源文件 链接名
查看当前文件夹下文件大小
du -lh --max-depth=1