CentOS only allows you to view folders.

Source: Internet
Author: User
Directory structure: # ll/home/mysql/total97280drwxr-xr-x.2mysqlmysql4096Mar917: 35binlogdrwxr-xr-x.10mysqlmysql4096Jun1811: 44data-rw-rw ----. 1mysqlmysql0Jul

Directory structure:

# ll /home/mysql/total 97280drwxr-xr-x.  2 mysql mysql     4096 Mar  9 17:35 binlogdrwxr-xr-x. 10 mysql mysql     4096 Jun 18 11:44 data-rw-rw----.  1 mysql mysql        0 Jul  1 09:59 error.logdrwxr-xr-x.  2 mysql mysql     4096 Jan 19 10:50 ib_logfile-rw-rw----   1 mysql mysql        5 Mar  9 17:35 mysql.piddrwxr-xr-x.  2 mysql mysql     4096 Jan 19 10:49 relaylog-rw-rw----.  1 mysql mysql     3143 Jun 28 08:58 slow.log


Method:
Method 1: ls-d highlights the folder

# ls -d /home/mysql/*/home/mysql/binlog  /home/mysql/error.log   /home/mysql/mysql.pid  /home/mysql/slow.log/home/mysql/data    /home/mysql/ib_logfile  /home/mysql/relaylog


Method 2: If the-maxdepth parameter is not added, the sub-directories are listed.

# find /home/mysql/ -maxdepth 1 -type d/home/mysql//home/mysql/ib_logfile/home/mysql/binlog/home/mysql/relaylog/home/mysql/data


Method 3: run the linux pipeline command and grep to find the directory ending with '/$'

# ls -F /home/mysql/| grep '/$'binlog/data/ib_logfile/relaylog/


Method 4: This method is also easy to remember.-l lists the complete attributes, such as drwxr-xr-x .... In this way, if a directory is used, there will be a d

# ls -l /home/mysql/| grep '^d'drwxr-xr-x.  2 mysql mysql     4096 Mar  9 17:35 binlogdrwxr-xr-x. 10 mysql mysql     4096 Jun 18 11:44 datadrwxr-xr-x.  2 mysql mysql     4096 Jan 19 10:50 ib_logfiledrwxr-xr-x.  2 mysql mysql     4096 Jan 19 10:49 relaylog

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.