当前位置首页 > Linux知识

一些实用的linux命令

阅读次数:194 次  来源:admin  发布时间:

1、ls 按时间倒序查看,最上面的是最新的

[root@master1 ~]# ls -rtl
total 244
-rw-r--r--  1 root root   4637 Dec 21 12:24 haproxy-ingress.yaml
-rw-r--r--  1 root root 189295 Mar  8 14:12 calico.yaml
-rw-r--r--  1 root root  29438 Mar  8 15:32 openebs-operator.yaml
-rw-r--r--  1 root root   4000 Mar  8 17:25 components.yaml
-rw-------. 1 root root   1421 Mar 11 00:17 anaconda-ks.cfg
-rw-r--r--  1 root root   4902 Mar 11 23:36 kube.info

2、建立软链接 ln -s /opt/test test 解释 ln -s 真实目录 软连接目录

[root@master1 test]# ln -s /opt/test/ test
[root@master1 test]# ls
test
[root@master1 test]# ll
total 0
lrwxrwxrwx 1 root root 10 Mar 12 15:14 test -> /opt/test/

3、查看软连接对应的实际目录

[root@master1 test]# readlink -f test/
/opt/test

4、将两个文件合并

paste a b                                  # 将两个文件合并用tab键分隔开
paste -d'+' a b                            # 将两个文件合并指定'+'符号隔开

5、拷贝不提示

\cp a.txt b
[root@master1 ~]# cp a.txt b
[root@master1 ~]# cp a.txt b
cp: overwrite ‘b’? ^C
[root@master1 ~]# \cp a.txt b
[root@master1 ~]#

6、转换文件编码

iconv -f gbk -t utf8 source.txt > new.txt  # 转换编码
上一篇:解决org.apache.rat:apache-rat-plugin:0.8:check(default)onprojecthb
下一篇:完美解决IIS服务器无法加载应用程序'/LM/W3SVC/1/ROOT'。错误是'没有注册类别