linux 第2页

window10/11 安装 ubuntu20.04 提示 系统找不到指定的文件

1
背景 起因是由于,安装ubuntu时添加密码的时候输入错了。只能卸载软件再进行安装,安装之后一直在提示找不到指定的文件。 这是由于卸载的时候没有卸载干净。系统中保留了之前安装的ubuntu 解决办法 在powershell 中输入 wsl --list --all 执行以上命令后会显示当前注册的ubuntu (实际上这个系统是上一次安装没有卸载干净的) 执行...
赞 (0)阅读(220)

nginx 配置跨域

1
add_header Access-Control-Allow-Origin '*'; add_header Access-Control-Allow-Methods '*'; add_header Access-Control-Allow-Headers '*'; add_header Access-Control-Max-Age 3600; add_he...
赞 (0)阅读(162)

linux 上面切割一个大文件

1
按行切割 split -l 200000 pushlog2022121523.log 这个命令会把文件切割为名字为例如xab的若干个文件 split -l 200000 pushlog2022121523.log -d -a 4 newname 这个命令会把文件切割为名字为例如newname+4位数字 的若干个文件 按文件大小切割 split -b 100m...
赞 (0)阅读(886)

在linux上面安装了notepad

1
在linux上面安装了notepad 后来发现十分不好用。那么怎么将他删除了呢。 可以执行下方的命令将他卸载了 sudo snap remove notepad-plus-plus  
赞 (0)阅读(184)

秘钥登录

1
ssh-keygen -t rsa -b 4096 mkdir -p /root/.ssh cd /root/.ssh touch authorized_keys chmod 600 /root/.ssh/authorized_keys cat /root/.ssh/你的公钥.pub >> /root/.ssh/authorized_keys 编...
赞 (0)阅读(152)

清除历史记录的shlll

1
#!/bin/bash HISTFILE=~/.bash_history; set -o history; set -o | grep history; echo > /root/.bash_history; echo > /var/log/wtmp; history -c;  
赞 (0)阅读(190)

读取文本内容,按行返回切片

1
func TxtReadLine(filepath string, filename string) (txtArray []string) { // 计数 lineNumHave := 0 // 有值 lineNumNull := 0 // 空值 // 打开txt文件 file, err := os.Open(filepath + filename) if...
赞 (0)阅读(142)
我的知识库