随笔分类 - linux shell
摘要:001、 'gmake'特指GNU make。 'make'是指系统默认的make实现;在大多数Linux发行版中,这是GNU make,但是在其他unix中,它可以指代make的某些其他实现,例如BSD make或各种商业unix的make实现。 GNU make接受的语言是传统make实用程序支
阅读全文
摘要:001、问题:Failed to find "GL/gl.h" in 002、解决方法 [root@pc1 cmake-3.27.7-build]# yum install mesa-lib* 。 参考:https://www.jianshu.com/p/5eeb3dd51c08
阅读全文
摘要:001、从左侧删除,# 和 *. a、从左侧删除单个 [root@pc1 test01]# var=GCF_000001735.4_TAIR10.1_genomic.fna ## 测试字符串 [root@pc1 test01]# echo ${var#*.} ## 从左侧删除第一个.后之前的,使用的
阅读全文
摘要:001、 [root@pc1 test01]# ls a.txt [root@pc1 test01]# cat a.txt ## 测试数据 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020
阅读全文
摘要:001、 [root@pc1 test01]# ls a.txt [root@pc1 test01]# cat a.txt ## 测试数据 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020
阅读全文
摘要:001、方法1 利用cut [root@pc1 test01]# ls a.txt [root@pc1 test01]# cat a.txt ## 测试数据 001.002.003.004.005 006.007.008.009.010 011.012.013.014.015 016.017.018
阅读全文
摘要:. switch 构造是 Linux bash 脚本提供的另一个强大功能。(c语言?) 它可以用于需要嵌套条件的地方,但不希望使用复杂的 if-else elif 链。 001、
阅读全文
摘要:001、 [root@pc1 test01]# ls a.sh [root@pc1 test01]# cat a.sh ## 测试脚本 #!/bin/bash : " ## 冒号和双引号之间有一个空格(也可以是单引号) xxxxxxx yyyyyyyyyyy ## 注释内容 zzzzzzzz " (
阅读全文
摘要:001、 -s file:文件存在而且文件不为空,则为真,否则为假 (base) [root@pc1 test01]# ls a.txt b.txt (base) [root@pc1 test01]# ll -h ## 两个侧式文件,a.txt不为空,b.txt则为空 total 4.0K -rw-
阅读全文
摘要:001、 a.txt [root@pc1 test01]# cat a.txt ## 测试数据 40 60 20 40 40 80 60 20 20 89 ## 每隔3行, 打上标签 [root@pc1 test01]# awk 'BEGIN{a=1}{if(sum <= 3) {print "ta
阅读全文
摘要:001、 [root@pc1 test01]# ls a.txt [root@pc1 test01]# cat a.txt ## 测试数据 40 60 20 40 40 80 60 20 20 0 0 80 4 4 8 8 ## 每隔4行输出平均值 [root@pc1 test01]# awk '{
阅读全文
摘要:001、问题,centos7中中用户名和主机名消失,显示-bash-4.2,如下: -bash-4.2$ 002、产生原因 配置文件丢失或意外删除。 003、解决方法1 -bash-4.2$ echo "export PS1='[\u@\h \W]\$'" >> ~/.bash_profile -b
阅读全文
摘要:001、 创建两个测试用户 [root@pc1 home]# ls [root@pc1 home]# useradd user01 ## 创建两个测试用户 [root@pc1 home]# useradd user02 [root@pc1 home]# echo tmppasswd | passwd
阅读全文
摘要:001、 (base) [root@pc1 test]# ls (base) [root@pc1 test]# echo $a ## 测试变量a和b (base) [root@pc1 test]# echo $b (base) [root@pc1 test]# export a=10000 ## a
阅读全文
摘要:001、tr -dc string: 表示删除字符以外(补集complement)的所有字符 [root@pc1 test]# ls a.txt [root@pc1 test]# cat a.txt ## 测试文本 01 02 abd ef 03jkk. 04, f 05 f 06 [root@pc
阅读全文
摘要:001、 [root@pc1 test]# ls ## 测试文件 a.txt b.txt [root@pc1 test]# ll -h total 110M -rw-r--r--. 1 root root 10M Oct 1 22:13 a.txt -rw-r--r--. 1 root root 1
阅读全文
摘要:001、tr实现 a、 [root@pc1 test02]# ls a.txt [root@pc1 test02]# cat a.txt ## 测试文件 01 02 03 04 05 06 07 08 09 10 [root@pc1 test02]# cat a.txt | tr "\n" " "
阅读全文
摘要:001、 [root@pc1 test]# echo -n ! | od -A n -t u1 ## 将ASCII码感叹号转换为十进制数值 33 002、 [root@pc1 test]# echo -n ! | od -A n ## 将ASCII感叹号转换为8进制数值 000041 003、 [r
阅读全文
摘要:001、磁盘占用 (base) [root@pc1 test1]# ls test1 test2 test3 (base) [root@pc1 test1]# find $PWD -type d ## 查出所有目录 /home/test1 /home/test1/test1 /home/test1/
阅读全文
摘要:001、 [root@pc1 test2]# ls a.txt [root@pc1 test2]# cat a.txt batch01 xyz1 batch02 xyz2 batch03 xyz3 batch04 xyz4 batch05 xyz5 [root@pc1 test2]# awk '{s
阅读全文

浙公网安备 33010602011771号