Linux common disk Operation Commands

Source: Internet
Author: User
Linux commonly used disk operation command [java] # sort by directory size warrior top 15 directories or files du-xBM -- max-depth2/var | sort-rn | head-n15 # List all current subdirectories file size du-h -- max-depth1 # column... commonly used disk operation commands in linux [java] # sort the top 15 directories or files of the warrior by directory size du-xB M -- max-depth = 2/var | sort-rn | head -n 15 # list the file sizes of all subdirectories du-h -- max-depth = 1 # list the 10 largest du-s * of the current file or directory | sort-n | tail # sort by directory size from large to small du-B -- max-depth 1 | sort-nr | perl-pe's {([0-9] + )} {sprintf "%. 1f % s ", $1> = 2 ** 30? ($1/2 ** 30, "G"): $1> = 2 ** 20? ($1/2 ** 20, "M"): $1> = 2 ** 10? ($1/2 ** 10, "K"): ($1 ,"")} e '# list the file tree du-h/path in the path directory | sort-h # monitor the file size change in the corresponding directory every 60 s watch-n60 du/var/log/messages # recursively delete all subdirectories in the current directory. svn directory find. -type d-name '. svn '-print0 | xargs-0 rm-rdf # list current disk usage df-P | column-t # monitor disk usage watch-d-n 5 df # List current inode usage df-I # Df-h | grep-v ^ none | (read header; echo "$ header"; sort-rn-k 5) # view the usage of a physical disk df-x tmpfs | grep-vE "(gvfs | procbususb | rootfs) "# view the current size and usage of all disks df-H # view the usage of all partitions fdisk-l/dev/sda # display all the partitions of the system or the given partitions fdisk-l # display, display the number of sectors rather than the number of cylinders fdisk-u # display the number of blocks for the specified partition fdisk-s partition # View disk read/write capacity iostat-m-d/dev/sda1 # Test disk hdparm-t/dev/sda # View all links to a file find-L/-samefile/path/to/file-exec ls-ld {}+ # view the maximum find. -type f-exec ls-s {}\; | sort-n-r | head-5 # view the files created 365 days ago and delete find. /-type f-mtime + 365-exec rm-f {}\; # view the find file larger than MB. -type f-size + 100 M

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.