随笔分类 - linux shell
摘要:001、 (base) [root@PC1 test]# ls a.txt (base) [root@PC1 test]# cat a.txt ## 测试数据 1 2 3 1 2 3 1 2 3 ## 将相同的序列转换为行 (base) [root@PC1 test]# awk '{if(NR %
阅读全文
摘要:001、脚本模板 #!/bin/bash #SBATCH -J TEST_NAME # 本次作业的名称 #SBATCH -p xhacnormala # 指定作业队列名 #SBATCH -o %j.result # %j将被作业号替代 #SBATCH -e %j.error # 错误日志输出 #SB
阅读全文
摘要:001、 (base) [root@PC1 test]# seq 3 > a.txt (base) [root@PC1 test]# cat a.txt ## 测试数据 1 2 3 (base) [root@PC1 test]# echo >> a.txt ## 末尾追加一个空行 (base) [r
阅读全文
摘要:001、basename命令可以获取末尾文件名和末尾目录名 (base) [root@PC1 home]# basename test2/a.txt a.txt (base) [root@PC1 home]# basename test2/dir01/ dir01 002、去除文件名后缀 (base
阅读全文
摘要:001、 (base) [root@PC1 home]# date +%s 1663810406 (base) [root@PC1 home]# date +%s 1663810410 date +%s //从 1970 年 1 月 1 日 00:00:00 UTC 到目前为止的秒数(时间戳) 参考
阅读全文
摘要:001、 [liujiaxin01@PC1 ~]$ whoami liujiaxin01 ## 非root用户 002、 将bash脚本中注释行后面的颜色设置为亮绿色 [liujiaxin01@PC1 ~]$ echo "highlight Comment ctermfg=green guifg=g
阅读全文
摘要:001、 文件名称 dog.slurm #!/bin/bash #SBATCH --job-name=dog # 本次作业的名称 #SBATCH -p xhacnormala # 等价于--partition,指定作业队列名 #SBATCH --output=%j.out # “%j”将被作业号替代
阅读全文
摘要:001、 (base) [liujiaxin01@PC1 ~]$ conda config --show channels channels: - defaults
阅读全文
摘要:001、生成自然序列 (base) root@ubuntu02:/home/test# seq 5 ## 默认从1开始递增 1 2 3 4 5 (base) root@ubuntu02:/home/test# seq 2 5 ## 指定起始点 2 3 4 5 002、生成序列的时候指定步长 (bas
阅读全文
摘要:-O选项表示将下载的内容进行重命名: [root@PC1 test]# ls [root@PC1 test]# wget -O xxxx http://mirrors.aliyun.com/repo/Centos-7.repo ## 下载内容保存为xxx --2022-09-19 09:42:39-
阅读全文
摘要:https://mirrors.aliyun.com/gnu/gcc/
阅读全文
摘要:001、自动获取IP dhclient 002、获取网关 route -n
阅读全文
摘要:001、利用net-tools工具下的 ifoconfig命令 root@ubuntu01:/home/software# ifconfig | head -n 3 ens32: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192
阅读全文
摘要:001、问题src/delly.h:8:10: fatal error: boost/graph/adjacency_list.hpp: No such file or directory 002、解决方法, 安装boost库 Linux下boost库的编译及安装:https://www.cnblo
阅读全文
摘要:001、下载地址 https://www.boost.org/users/download/ 002、 tar -xzvf boost_1_80_0.tar.gz 003、 编译安装 cd boost_1_80_0/ ./bootstrap.sh --with-libraries=all --wit
阅读全文
摘要:001、 root@ubuntu01:/home# dpkg -l 002、过滤特定的包 root@ubuntu01:/home# dpkg -l | grep "vim" ii vim 2:8.2.3995-1ubuntu2 amd64 Vi IMproved - enhanced vi edit
阅读全文
摘要:001、提取前半部分 root@ubuntu01:/home/test2# cat a.txt ## 测试数据 1 2 3 4 5 6 7 8 9 10 root@ubuntu01:/home/test2# sed -n "1, $(expr $(sed -n "$=" a.txt) / 2)p"
阅读全文
摘要:001、问题 root@ubuntu01:/home# ping www.baidu.com ## 测试网络连通性, 无法解析域名 ping: www.baidu.com: Temporary failure in name resolution 002、修改DNS配置文件 root@ubuntu0
阅读全文
摘要:001、c编译器 root@ubuntu01:/home/test# gcc --version gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0 Copyright (C) 2021 Free Software Foundation, Inc. This is f
阅读全文
摘要:001、bc实现 root@ubuntu01:/home/test# bc ## 在终端直接输入bc命令 bc 1.07.1 Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006, 2008, 2012-2017 Free Software Founda
阅读全文

浙公网安备 33010602011771号