linux常用命令(十二)

2024-11-11 04:29:09

1、cut参数: -d 接分隔符(默认是以tab键为分隔符) -f 指定取第几列 -c 从哪开始截取到哪结束但是其不能与-d选项共存。[root@elk-03 ~]# cat testfileI am wahaha,my address beijing

linux常用命令(十二)

3、-c 按字符参数[root@elk-03 ~]# cat testfile |cut -c 3-4am

linux常用命令(十二)

5、tar命令用于备份文件。mkdir testcd test/touch {1..5}.txtlltotal 0-rw-r--r-- 1 root root 0 Aug 14 18:14 1.txt-rw-r--r-- 1 root root 0 Aug 14 18:14 2.txt-rw-r--r-- 1 root root 0 Aug 14 18:14 3.txt-rw-r--r-- 1 root root 0 Aug 14 18:14 4.txt-rw-r--r-- 1 root root 0 Aug 14 18:14 5.txt

linux常用命令(十二)

7、-tf 查看压缩包里面的内容[root@elk-03 ~]# tar -tf test.tar.gztest/test/1.txttest/2.txttest/3.txttest/4.txttest/5.txt

linux常用命令(十二)
猜你喜欢