linux-三命令(三剑客)之-sed
使用 sed 对文件进行文本替换 (windows 下也可用) // 输出替换后的文本 sed 's/foo/bar/g' input.txt // 在原文件上进行修改 -i sed -i 's/foo/bar/g' input.txt // 要替换的文本中包含特殊字符 如 '/ ', 则使用 +/_或其它字符 作为分隔符 sed 's+http://+https://+g' input.txt 参考自: www.cyberciti.bizLinux-下-AX210NGW-无线网卡安装驱动
参考: Linux* Support for Intel® Wireless Adapters 参考: https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi 参考: https://www.intel.com/content/www/us/en/support/articles/000005511/wireless.html使用-echo-写入文件
docker 容器内很可能没有 vi 等编辑工具, 可使用 echo 或 cat 进行写入 # 覆盖写入, 文件不存在则新建后写入 echo "abc" > file.txt # 尾行追加写入, 文件不存在则新建后写入 echo "def" >> file.txt echo $(date) >> file.txt # 覆盖写入 cat << EOF > m.txt > d > e > f > EOF # 追加写入 cat <<EOF >> m.txt > d > e > f > EOFvmware-linux-网络配置
centos7.9 vmware 中设置 虚拟机网络连接为 桥接模式 虚拟机(centos) 中 设置 /etc/sysconfig/network-scripts/ifcfg-ens33 中 ONBOOT 为 [root@bogon ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens33 TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=dhcp DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no IPV6_ADDR_GEN_MODE=stable-privacy NAME=ens33 UUID=7e16f33b-714d-4386-ab0c-58b6ddbc7aa3 DEVICE=ens33 #ONBOOT=no ONBOOT=yeslinux-更新-curl-版本
转自: How to yum update curl 7.29 to 7.61 - CentOS 7.X # rpm -Uvh http://www.city-fan.org/ftp/contrib/yum-repo/city-fan.org-release-2-1.rhel7.noarch.rpm # cat /etc/yum.repos.d/city-fan.org.repo # 这里要保证 enabled = 1 [city-fan.org] name=city-fan.org repository for Red Hat Enterprise Linux (and clones) $releasever ($basearch) #baseurl=http://mirror.city-fan.org/ftp/contrib/yum-repo/rhel$releasever/$basearch mirrorlist=http://mirror.city-fan.org/ftp/contrib/yum-repo/mirrorlist-rhel$releasever enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-city-fan.org ... # yum info curl # yum update curl 版本回退 # mkdir ~/temp && cd ~/temp # wget http://mirror.centos.org/centos/7.5.1804/os/x86_64/Packages/curl-7.29.0-46.el7.x86_64.rpm # wget http://mirror.centos.org/centos/7.5.1804/os/x86_64/Packages/libcurl-7.29.0-46.el7.x86_64.rpm # wget http://mirror.centos.org/centos/7.5.1804/os/x86_64/Packages/libcurl-devel-7.29.0-46.el7.x86_64.rpm # rpm -Uvh --oldpackage *.ubuntu-apt-换源
// 1. /etc/apt/sources.list 文件备份 cp -a /etc/apt/sources.list /etc/apt/sources.list.bak // 2. 修改 sources.list 文件 sudo vim sources.list tips: 阿里源文件: 出现 /etc/apt/sources.list" E212: Can’t open file for writing 解决方案 , 可能是因为用户权限不足, 使用 root 或 sudo vim 试试 参考自: /etc/apt/sources.list" E212: Can’t open file for writinglinux-生成带日期的文件
// date 命令用于输出时间, 反引号用于变量输出 touch `data +%F`.txt.logredhat7-systemd-和-systemctl
systemd 是系统管理守护进程, 其中的 d 表示 daemon systemctl 是命令, 其中的 ctl 表示 control 以下的 xxx 表示服务名称 systemctl start xxx => 启动服务 systemctl restart xxx => 重新启动服务 systemctl stop xxx => 停止服务 systemctl enable xxx => 加入到启动项 systemctl status xxx => 查看状态 shell api: application interface 应用程序接口 硬件 <= 内核 <= api <= 应用程序 shell 是一种应用程序, 壳, 终端(解释器), bash 是 shell 的一种 linux 命令 格式: 命令 参数 对象 ls -a / 参数和对象有时可不需要nginx-autoindex-off
nginx autoindex off 禁止目录访问windows-中使用命令来登录远程-linux
如果不使用 xshell 类软件, 可以使用 powershell 或 gitbash 等 // 本地虚拟机做了端口转发后 ssh -p 2222 root@127.0.0.1
Recent Posts
Tags
- apache 4
- axios 1
- benchmark 1
- c 1
- canvas 1
- centos 3
- channel 1
- crontab 1
- css 2
- docker 4
- fail2ban 1
- frp 1
- gin 1
- github 1
- go 26
- goaccess 1
- goroutine 1
- http 1
- https 1
- jetbrains 1
- jquery 1
- js 2
- linux 20
- mermaid 1
- mysql 10
- nginx 3
- node 1
- php 43
- prisma 1
- react 8
- server 1
- ssh 2
- tarojs 1
- tcp/ip 1
- token 1
- ubuntu 1
- ufw 1
- unit-test 1
- vmware 1
- vscode 1
- vue 12
- yum 1
- 域名 3
- 安全 2
- 微信 3
- 算法 3