zoukankan      html  css  js  c++  java
  • Shell学习——列出当前路径下所有目录

    1、ls -d */
    [root@client02 ~]# ls -d */
    Desktop/ Documents/ Downloads/ jq-1.5/ Music/ Pictures/ Public/ Templates/ Videos/ zookeeper/
    [root@client02 ~]#
    2、ls -F | grep /$
    [root@client02 ~]# ls -F | grep '/$'
    Desktop/
    Documents/
    Downloads/
    jq-1.5/
    Music/
    Pictures/
    Public/
    Templates/
    Videos/
    zookeeper/
    [root@client02 ~]#
    -F:附加文件类别:符号在文件名最后,/表明是一个目录;@表明是符号链接;*表明是一个可执行文件。
    3、ls -l|grep ^d
    [root@client02 ~]# ls -l|grep ^d
    drwxr-xr-x. 2 root root 6 Apr 17 2017 Desktop
    drwxr-xr-x. 2 root root 6 Apr 17 2017 Documents
    drwxr-xr-x. 2 root root 6 Apr 17 2017 Downloads
    drwxr-xr-x. 9 1002 1002 4096 Aug 19 19:53 jq-1.5
    drwxr-xr-x. 2 root root 6 Apr 17 2017 Music
    drwxr-xr-x. 2 root root 6 Apr 17 2017 Pictures
    drwxr-xr-x. 2 root root 6 Apr 17 2017 Public
    drwxr-xr-x. 2 root root 6 Apr 17 2017 Templates
    drwxr-xr-x. 2 root root 6 Apr 17 2017 Videos
    drwxr-xr-x. 4 root root 29 Apr 11 20:08 zookeeper
    [root@client02 ~]#
    4、find . -maxdepth 1 -type d -print
    [root@client02 ~]# find . -maxdepth 1 -type d -print
    .
    ./.cache
    ./.dbus
    ./.config
    ./.ssh
    ./Desktop
    ./Downloads
    ./Templates
    ./Public
    ./Documents
    ./Music
    ./Pictures
    ./Videos
    ./.local
    ./.ansible
    ./zookeeper
    ./jq-1.5
    ./.pki
    [root@client02 ~]#

  • 相关阅读:
    《代码阅读与实践》阅读笔记*part1
    HDFS JAVA API
    《需求工程》阅读笔记*part3
    《需求工程》阅读笔记*part2
    HDFS文件命令
    HOG特征+SVM行人检测
    winchecksec安装踩坑
    加壳:挂起方式创建进程
    内存写入注入
    远程线程注入
  • 原文地址:https://www.cnblogs.com/pigwan7/p/9629315.html
Copyright © 2011-2022 走看看