随笔分类 - linux shell
摘要:1、 root@PC1:/home/test2# ls a.txt root@PC1:/home/test2# cat a.txt 1 2 3 4 root@PC1:/home/test2# cat a.txt | sed "H; g" 1 1 2 1 2 3 1 2 3 4
阅读全文
摘要:1、 root@PC1:/home/test2# ls a.txt root@PC1:/home/test2# cat a.txt a b c d a b e f c d c d m n root@PC1:/home/test2# awk '{a[i++]=$0} END {for(j = i -
阅读全文
摘要:1、 root@PC1:/home/test2# for num in `seq 2 100`;do if [ `factor $num|awk '{print $2}'` == $num ];then echo -n "$num ";fi done;echo 2 3 5 7 11 13 17 19
阅读全文
摘要:index(x,y):返回字符y在字符串x中的位置。 示例: root@PC1:/home/test2# ls a.txt root@PC1:/home/test2# cat a.txt dgfe knkds dfdf dfewf zdfj ewkhd root@PC1:/home/test2# a
阅读全文
摘要:1、 root@PC1:/home/test2# ls a.txt root@PC1:/home/test2# cat a.txt a d g e e j e e j r d g e e j e f f e d k r d j root@PC1:/home/test2# awk '{array[$1
阅读全文
摘要:1、 root@PC1:/home/test# ls root@PC1:/home/test# touch {a..d}.txt {a..d}.csv root@PC1:/home/test# ls a.csv a.txt b.csv b.txt c.csv c.txt d.csv d.txt ro
阅读全文
摘要:1、sort + uniq实现 root@PC1:/home/test# ls a.txt root@PC1:/home/test# cat a.txt 1 2 a b 1 2 1 2 o p a b m m root@PC1:/home/test# sort a.txt | uniq ## 删除重
阅读全文
摘要:1、该指令只能用于查找二进制文件、源代码文件和man手册页,一般文件的定位需使用locate、find命令。 root@DESKTOP-1N42TVH:/home/test# whereis top ## 输出了二进制文件和man手册叶 top: /usr/bin/top /usr/share/ma
阅读全文
摘要:locate特定: 001:速度快 002:查找依赖于/var/lib/mlocate/mlocate.db 为了时效性查找,在使用locate命令之前可以先更新库: updatedb 示例: 1、locate + file root@DESKTOP-1N42TVH:/home/test# loca
阅读全文
摘要:1、 root@DESKTOP-1N42TVH:/home/test# echo $a root@DESKTOP-1N42TVH:/home/test# [ -z $a ] && echo "null" || echo "no null" ## -z判断变量是否为空,空返回TRUE,非空返回FALS
阅读全文
摘要:1、举例 root@DESKTOP-1N42TVH:/home/test3# a="aa.bb.cc.dd" root@DESKTOP-1N42TVH:/home/test3# echo $a aa.bb.cc.dd root@DESKTOP-1N42TVH:/home/test3# echo ${
阅读全文
摘要:1、举例 #*.的作用 root@DESKTOP-1N42TVH:/home/test3# a="aa.bb.cc.dd" root@DESKTOP-1N42TVH:/home/test3# echo ${a} aa.bb.cc.dd root@DESKTOP-1N42TVH:/home/test3
阅读全文
摘要:1、举例%.*的作用 root@DESKTOP-1N42TVH:/home/test3# a="aa.bb.cc.dd" root@DESKTOP-1N42TVH:/home/test3# echo ${a} aa.bb.cc.dd root@DESKTOP-1N42TVH:/home/test3#
阅读全文
摘要:ubuntu安装R遇到如下问题: root@DESKTOP-1N42TVH:/home/test2# apt install r-base-core 1、系统内核 root@DESKTOP-1N42TVH:/home/test2# lsb_release -a No LSB modules are
阅读全文
摘要:1、创建java安装目录 root@DESKTOP-1N42TVH:~# mkdir /usr/local/java root@DESKTOP-1N42TVH:~# cd /usr/local/java/ 2、下载jdk安装包,url:https://www.oracle.com/java/tech
阅读全文
摘要:来源:https://blog.niekun.net/archives/1801.html 在升级到 wsl 2 后发现一些网络问题和之前的 wsl 不一样了,主要是 DNS 解析和 wsl 和 Windows 网络互访问题,这里介绍如何处理。 DNS 解析 wsl 2 使用的 DNS 解析服务器设
阅读全文
摘要:cmd命令:wsl --shutdown
阅读全文
摘要:1、putty登录出现如下报错: 2、解决方法, 修改配置文件, 重启ssh服务 root@DESKTOP-1N42TVH:/home# vim /etc/ssh/sshd_config 重启ssh服务: root@DESKTOP-1N42TVH:/home# service ssh restart
阅读全文
摘要:1、问题putty无法连接ubuntu 2、检查网络连接(有ip,网络都不能正常连接) 3、查看防火墙,关闭防火墙 检查网络连接:(网络连接正常了) 4、测试putty,可以正常登录。
阅读全文
摘要:1、问题, 在启动ssh服务是出现如下问题 2、解决方法 root@DESKTOP-1N42TVH:/home# ssh-keygen -A ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519 3、测试 root@DESKTOP-1
阅读全文

浙公网安备 33010602011771号