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 ~]#

  • 相关阅读:
    hadoop 2.5.1 、Hadoop 2.7 Hadoop 2.6
    二 JDK + mysql + yum + rpm
    一 SSH 无密码登陆 & Linux防火墙 & SELinux关闭
    ZooKeeper 配置注意事项 zoo.cfg
    ZooKeeper 特性
    分布式锁
    悲观锁和乐观锁
    windows上配置mysql主从复制
    C# 同步调用、异步调用、异步回调
    C#方法回调
  • 原文地址:https://www.cnblogs.com/pigwan7/p/9629315.html
Copyright © 2011-2022 走看看