安装
# centos7
yum install -y p7zip
#ubuntu
apt-get install -y p7zip
压缩
7za a zipfile.7z /path/to/file_or_folder
解压
7za x zipfile.7z [-o/path/to/folder]
o参数用于指定解压目录,-o之后没有空格
安装
# centos7
yum install -y p7zip
#ubuntu
apt-get install -y p7zip
压缩
7za a zipfile.7z /path/to/file_or_folder
解压
7za x zipfile.7z [-o/path/to/folder]
o参数用于指定解压目录,-o之后没有空格
执行以下脚本确定 CPU 支持虚拟化,如果有输出则代表支持。
grep -E '(vmx|svm)' /proc/cpuinfo
kvm相关安装包及其作用:
qemu-kvm 主要的KVM程序包python-virtinst 创建虚拟机所需要的命令行工具和程序库virt-manager GUI虚拟机管理工具virt-top 虚拟机统计命令virt-viewer GUI连接程序,连接到已配置好的虚拟机libvirt C语言工具包,提供libvirt服务libvirt-client 为虚拟客户机提供的C语言工具包virt-install 基于libvirt服务的虚拟机创建命令bridge-utils 创建和管理桥接设备的工具yum install -y qemu-kvm virt-manager libvirt
安装完后要开启服务
systemctl enable --now libvirtd.service
继续阅读 批量添加后缀
find . -type f -exec mv '{}' '{}'.suf \;
修改后缀
rename .suf .suffix *.suf
如果只有一个系统,GRUB 菜单默认不会显示。如果需要切换内核则需要显示 GRUB 菜单,方法如下:
/etc/default/grubGRUB_TIMEOUT_STYLE=hidden,改为 GRUB_TIMEOUT_STYLE=menu,保存退出sudo update-grub重启即可看到 GRUB 菜单了。
操作与上面类型,添加以下内容,更新grub并重启。
GRUB_TIMEOUT=3
GRUB_RECORDFAIL_TIMEOUT=3
选择一个可用的配置并预览效果:
c 键进入命令行videoinfo 列出所有可用模式,带 * 的是当前模式terminal_output consoleterminal_output gfxtermset gfxmode=1024x768通过 /etc/default/grub 配置:
GRUB_GFXMODE=1024x768
sudo pacman -Syyu
sudo pacman -S system-config-printer print-manager cups
sudo systemctl enable --now cups
sudo pacman -S hplip
# 贮藏
git stash
# 贮藏时添加 message
git stash save "message"
# 贮藏时包含所有修改,同 --all
git stash -a
# 贮藏时包含未暂存的修改,同 --include-untracked
git stash -u
# 出栈第一个贮藏,应用到工作目录
git stash pop
# 应用贮藏内容到工作目录
git stash apply
# 贮藏堆栈列表
git stash list
# 丢弃贮藏 stash@{0}
git stash drop stash@{0}
# 清空 stash
git stash clear
# 查看贮藏的 diff
git stash show [stash@{0}]
# 查看贮藏的全部 diff,同 --patch
git stash show -p
# 从贮藏创建新分支
git stash branch new_branch_name
yum grouplist
yum groupinstall "Server with GUI"
yum update -y
yum groupinstall "GNOME Desktop" -y
yum groupinstall "KDE Plasma Workspaces" -y
# 中文支持
yum install kde-l10n-Chinese
安装完中文包后要在设置的 local 中设置首选语言为中文,并注销重登录。
systemctl get-default
multi-user.target表示命令行启动
systemctl set-default graphical.target
单纯在 ssh 连接时使用客户端图形界面,当出现
X11 forwarding request failed on channel 0时,安装以下命令:yum install xorg-x11-xauth
systemctl set-default multi-user.target
yum groupremove "GNOME Desktop"
scoop 是 windows 下的包管理工具,可以帮助我们自动安装并配置软件包。
有科学上网的可以跳过。
参考:https://gitee.com/doshengl/GitHub520
用于 switchHosts 的 github520 远程 URL:https://raw.hellogithub.com/hosts
用 powerShell 执行以下命令
Set-ExecutionPolicy RemoteSigned -scope CurrentUser
iwr -useb https://gitee.com/RubyKids/scoop-cn/raw/master/install.ps1 | iex
如果安装失败,删除用户目录下的 scoop 目录再重试。
scoop config SCOOP_REPO https://gitee.com/squallliu/scoop
scoop install git
如果安装失败,先卸载失败的包,再重新安装即可。卸载示例:
scoop uninstall git
scoop bucket add extras
scoop install windows-terminal insomnia switchhosts vscode sublime-text
Set-ExecutionPolicy RemoteSigned -ForceGet-ExecutionPolicy,应该返回 RemoteSignedd:\shell\Install-WMF5.1.ps1注意:需要开启「Windows Update」服务。