随笔分类 -  linux shell

上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 78 下一页
摘要:001、发行版信息 [root@pc1 test]# cat /etc/redhat-release CentOS Linux release 7.6.1810 (Core) ## centos7.6 002、当前gcc版本 [root@pc1 test]# gcc --version gcc (G 阅读全文
posted @ 2023-11-03 22:34 小鲨鱼2018 阅读(245) 评论(0) 推荐(0)
摘要:001、 (base) [root@pc1 test02]# ls a.txt (base) [root@pc1 test02]# cat a.txt ## 测试文件 use File::Basename; use File::Spec; use List::Util 'none'; use "Ca 阅读全文
posted @ 2023-11-03 16:35 小鲨鱼2018 阅读(348) 评论(0) 推荐(0)
摘要:001、报错如下: 002、解决方法 在3694行 的末尾加上 --no-discard-stderr sed -i '3694 s/$/ --no-discard-stderr /' Makefile ## 在3694末尾添加上--no-discard-stderr, -i表示在原文中添加 003 阅读全文
posted @ 2023-11-02 22:07 小鲨鱼2018 阅读(217) 评论(0) 推荐(0)
摘要:001、打包只指定目录 [root@pc1 test]# ls a.txt b.map c.ped dir1 [root@pc1 test]# ls dir1/ [root@pc1 test]# tar -cf ./dir1/xx.tar a.txt b.map c.ped ## 打包至指定的目录 阅读全文
posted @ 2023-10-31 22:22 小鲨鱼2018 阅读(1771) 评论(0) 推荐(0)
摘要:001、 [root@pc1 test]# for i in ab8 ab23 ab98; do echo $i; done ## 直接迭代 ab8 ab23 ab98 [root@pc1 test]# for i in ab{8,23,98}; do echo $i; done ## 可以写成如下 阅读全文
posted @ 2023-10-31 21:50 小鲨鱼2018 阅读(39) 评论(0) 推荐(0)
摘要:001、 [root@pc1 test]# ls ## 两个测试文件 a.txt b.txt [root@pc1 test]# cat a.txt 01 02 03 04 05 06 07 08 09 10 11 12 [root@pc1 test]# cat b.txt a b c [root@p 阅读全文
posted @ 2023-10-31 21:45 小鲨鱼2018 阅读(49) 评论(0) 推荐(0)
摘要:001、 linux 中 strings命令 主要是在对象文件或者二进制文件中查找可打印的字符串。 002、举例 (base) [b20223040323@admin1 ~]$ strings /bin/ls | head /lib64/ld-linux-x86-64.so.2 libselinux 阅读全文
posted @ 2023-10-31 13:15 小鲨鱼2018 阅读(268) 评论(0) 推荐(0)
摘要:001、python程序报错如下: 002、问题分析 a、调用的是python程序 b、libstdc++.so.6是c++标准库 执行python程序时,需要调用c++标准库,libstdc++.so.6(lib = glib, 6 表示第6版),版本不匹配报错,无法找到:GLIBCXX_3.4. 阅读全文
posted @ 2023-10-31 10:19 小鲨鱼2018 阅读(1090) 评论(0) 推荐(0)
摘要:001、 Ldd: linux 系统中的一个测试工具,用于查看可执行文件或者共享库文件所依赖的动态链接库. 主要用于协助分析和解决程序运行时的依赖关系。 动态链接库? 002、举例 ldd 003、解决依赖关系 a、安装相应的软件包来获取缺失的动态链接库 比如红帽系列使用yum命令、ubuntu中使 阅读全文
posted @ 2023-10-31 09:42 小鲨鱼2018 阅读(292) 评论(0) 推荐(0)
摘要:001、 c运行库. linux 系统中最低成的API(应用程序接口), 几乎其它任何运行库都会依赖与glibc. glibc是GNU发布的libc库,即c运行库。glibc是linux系统中最底层的api,几乎其它任何运行库都会依赖于glibc。glibc除了封装linux操作系统所提供的系统服务 阅读全文
posted @ 2023-10-30 23:31 小鲨鱼2018 阅读(215) 评论(0) 推荐(0)
摘要:001、按照原始顺序输出 [root@pc1 test02]# ls a.txt [root@pc1 test02]# cat a.txt ## 测试数据 a 76 b 78 a 100 c 222 b 7777 b 8888 a 9999 b 3333 d 1111 e 7777777 e 999 阅读全文
posted @ 2023-10-24 08:55 小鲨鱼2018 阅读(115) 评论(0) 推荐(0)
摘要:001、 输出第一列中没有重复的文本 [root@pc1 test02]# ls a.txt [root@pc1 test02]# cat a.txt ## 测试数据 a 76 b 78 a 100 c 222 b 7777 b 3333 d 1111 ## 先把文本叠加一次, 然后引入文本行数变量 阅读全文
posted @ 2023-10-23 18:01 小鲨鱼2018 阅读(63) 评论(0) 推荐(0)
摘要:001、 [root@pc1 test02]# ls a.txt [root@pc1 test02]# cat a.txt ## 测试数据 a 76 b 78 a 100 c 222 b 7777 b 3333 d 1111 ## 输出所有的重复 ## 对重复去重 ## 将重复叠加至表头 ## 输出 阅读全文
posted @ 2023-10-23 16:27 小鲨鱼2018 阅读(84) 评论(0) 推荐(0)
摘要:001\ [root@pc1 test01]# ls [root@pc1 test01]# seq 3 > a.txt ## 测试文件 [root@pc1 test01]# ls a.txt [root@pc1 test01]# cat a.txt 1 2 3 [root@pc1 test01]# 阅读全文
posted @ 2023-10-17 21:18 小鲨鱼2018 阅读(310) 评论(0) 推荐(0)
摘要:001、 (base) [b20223040323@admin1 NTlibrary]$ find nt.01* | xargs du -sch ## 查找一类文件,并统计总的大小,-c表示总计 76M nt.01.nhd 1.7M nt.01.nhi 797M nt.01.nhr 50M nt.0 阅读全文
posted @ 2023-10-16 11:24 小鲨鱼2018 阅读(869) 评论(0) 推荐(0)
摘要:系统:centos7.6 1810 001、下载tmux工具 [root@pc1 ~]# tmux bash: tmux: command not found... [root@pc1 ~]# yum install tmux -y ## 安装命令 002、启动 tmux 功能 在终端直接输入 tm 阅读全文
posted @ 2023-10-15 11:11 小鲨鱼2018 阅读(793) 评论(0) 推荐(0)
摘要:001、方法1 expr [root@pc1 test]# expr 50 + 40 90 002、方法2 bc [root@pc1 test]# echo 50 + 40 | bc 90 003、方法3 awk [root@pc1 test]# awk 'BEGIN{print 50 + 40}' 阅读全文
posted @ 2023-10-15 10:08 小鲨鱼2018 阅读(88) 评论(0) 推荐(0)
摘要:001、 [root@pc1 test]# cat test.sh ## 函数脚本 #!/bin/bash function db1 ## function关键字来定义函数,db1是函数名 { read -p "请输入:" value return $[$value *2] ## return返回函 阅读全文
posted @ 2023-10-14 23:10 小鲨鱼2018 阅读(151) 评论(0) 推荐(0)
摘要:001、 awk + 数组实现 [root@pc1 test2]# ls a.txt [root@pc1 test2]# cat a.txt ## 测试数据 a b b a b c f f b a [root@pc1 test2]# awk '{ay[$0]++; print ay[$0], $0} 阅读全文
posted @ 2023-10-13 14:42 小鲨鱼2018 阅读(54) 评论(0) 推荐(0)
摘要:001、间隔2 [root@pc1 test1]# ls a.txt [root@pc1 test1]# cat a.txt ## 测试数据 1 2 3 4 5 6 7 8 9 10 [root@pc1 test1]# awk '{if(NR % 2 == 1) {count++}; if(NR % 阅读全文
posted @ 2023-10-12 14:28 小鲨鱼2018 阅读(147) 评论(0) 推荐(0)

上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 78 下一页