zoukankan      html  css  js  c++  java
  • 10.4

        □ [root@wen ~]# ifconfig |awk 'NR==2 {print $3}' | awk -F ":" '{print $2 }'
    192.168.59.255
    
    
        □ Linux 正则表达式三剑客
        ^    以……什么开头    ^d,以d开头
        $    以……什么结尾    /$,以/结尾
        /    转义符    还原本身含义
        .    代表任意单个字符    
        cd -    返回上一目录    
    一. 查找目录方法
        1. 根据颜色区分目录和文件
        2. ^d,以什么开头的
        - [root@wen data]# ls -l |grep "^d"
        drwxr-xr-x. 3 root root 4096 10月  3 01:52 926
        drwxr-xr-x. 2 root root 4096 9月  19 05:44 __pycache__
        drwxr-xr-x  2 root root 4096 10月  3 02:47 qq
        3. ll ,第二例inode大于1的都是目录
        - [root@wen data]# ll |awk '{if($2>1) print $0}'  #$0输入整行
        drwxr-xr-x. 3 root root 4096 10月  3 01:52 926
        drwxr-xr-x. 2 root root 4096 9月  19 05:44 __pycache__
        drwxr-xr-x  2 root root 4096 10月  3 02:47 qq
        4. ls -F,给不同文件结尾加标识   #ls -p 只给目录加标识
        - [root@wen data]# ls -F| grep "/$"
        926/
        __pycache__/
        qq/
        - [root@wen data]# ls -p | grep "/$"
        926/
        __pycache__/
        qq/
        5. 用find加深度
        [root@wen etc]# find ./ -type d
        - [root@wen data]# find ./ -maxdepth 1 -type d            #深度
        ./
        ./926
        ./qq
        ./__pycache__
        - [root@wen data]# find ./* -maxdepth 1 -type d ! -name "."   #不包括当前目录
        ./926
        ./926/test
        ./__pycache__
        ./qq
        6. [root@wen data]# ls -l|sed -n '/^d/p'
        drwxr-xr-x. 3 root root 4096 10月  3 01:52 926
        drwxr-xr-x. 2 root root 4096 9月  19 05:44 __pycache__
        drwxr-xr-x  2 root root 4096 10月  3 02:47 qq
        7. [root@wen data]# ll|awk '/^d/'
        drwxr-xr-x. 3 root root 4096 10月  3 01:52 926
        drwxr-xr-x. 2 root root 4096 9月  19 05:44 __pycache__
        drwxr-xr-x  2 root root 4096 10月  3 02:47 qq
        8. [root@wen data]# ls -F |awk '//$/'
        926/
        __pycache__/
        qq/
        - [root@wen data]# ls -F|sed -n '//$/p'
        926/
        __pycache__/
        qq/
        9. [root@wen data]# ls -a|grep '.'
        .
        ..
        selectors.py
        [root@wen data]# ls -a|grep '.'
        .
        ..
        926
        __pycache__
        qq
        selectors.py
        test_from_windows
        #./ 目录及目录本身
         ./*目录下的东西
        
    二. 第二关
        1. [root@wen data]#  date
        2017年 10月 03日 星期二 14:17:26 CST
        [root@wen data]#  date -s '2017/10/04 12:27'
        2017年 10月 04日 星期三 12:27:00 CST
  • 相关阅读:
    [转]Magento刷新索引的几种方法
    [转]centos7 移动mysql5.7.19 数据存储位置
    [转]解决Magento批量导入带图片的商品的问题
    [转]【mysql监控】查看mysql库大小,表大小,索引大小
    [转]Centos系统中查看文件和文件夹大小
    [转]Magento 2.2 Developer Documentation
    [转]Magento2开发教程
    [转]Magento Configurable Product
    [转]论magento1和magento2的速度性能优化问题
    [转]本地 Windows 计算机密码登录 登录 腾讯云 Linux 实例
  • 原文地址:https://www.cnblogs.com/wenyule/p/7625494.html
Copyright © 2011-2022 走看看