zoukankan      html  css  js  c++  java
  • 一些实用的linux命令

    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  # 转换编码
  • 相关阅读:
    Ext.Net多表头跨行跨列
    操作文件
    HighMaps
    HighCharts动态读取显示
    SAP CRM 项目笔记(一) SOW(工作说明书)讨论
    .net 动态编译解决考勤计算问题
    CPU的大小端模式
    将一个数转化为任意进制的数
    关于内存对齐
    常量指针与指针常量
  • 原文地址:https://www.cnblogs.com/xlovepython/p/14524253.html
Copyright © 2011-2022 走看看