Merge pull request #9527 from MjSeven/master

20180718 How to check free disk space in Linux.md 翻译完毕
This commit is contained in:
Xingyu.Wang 2018-07-21 23:52:11 +08:00 committed by GitHub
commit d255e86b31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 69 additions and 67 deletions

View File

@ -1,3 +1,6 @@
Translating by MjSeven
How To Force User To Change Password On Next Login In Linux
======
When you created the users account with a default password, you have to force the users to change their password on next login.

View File

@ -1,67 +0,0 @@
Translating by MjSeven
How to check free disk space in Linux
======
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/find-file-linux-code_magnifying_glass_zero.png?itok=E2HoPDg0)
Keeping track of disk utilization information is on system administrators' (and others') daily to-do list. Linux has a few built-in utilities that help provide that information.
### df
The `df` command stands for "disk-free," and shows available and used disk space on the Linux system.
`df -h` shows disk space in human-readable format
`df -a` shows the file system's complete disk usage even if the Available field is 0
![](https://opensource.com/sites/default/files/uploads/df-ha.png)
`df -T` shows the disk usage along with each block's filesystem type (e.g., xfs, ext2, ext3, btrfs, etc.)
`df -i` shows used and free inodes
![](https://opensource.com/sites/default/files/uploads/df-ti.png)
### du
`du` shows the disk usage of files, folders, etc. in the default kilobyte size
`du -h` shows disk usage in human-readable format for all directories and subdirectories
`du -a` shows disk usage for all files
`du -s` provides total disk space used by a particular file or directory
![](https://opensource.com/sites/default/files/uploads/du-has.png)
The following commands will check your total space and your utilized space.
### ls -al
`ls -al` lists the entire contents, along with their size, of a particular directory
![](https://opensource.com/sites/default/files/uploads/ls-al.png)
### stat
`stat <file/directory> `displays the size and other stats of a file/directory or a filesystem.
![](https://opensource.com/sites/default/files/uploads/stat.png)
### fdisk -l
`fdisk -l` shows disk size along with disk partitioning information
![](https://opensource.com/sites/default/files/uploads/fdisk.png)
These are most of the built-in utilities for checking file space in Linux. There are many similar tools, like [Disks][1] (GUI), [Ncdu][2], etc., that also show disk space utilization. Do you have a favorite tool that's not on this list? Please share in the comments.
--------------------------------------------------------------------------------
via: https://opensource.com/article/18/7/how-check-free-disk-space-linux
作者:[Archit Modi][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/architmodi
[1]:https://wiki.gnome.org/Apps/Disks
[2]:https://dev.yorhel.nl/ncdu

View File

@ -0,0 +1,66 @@
如何检查 Linux 中的可用磁盘空间
======
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/find-file-linux-code_magnifying_glass_zero.png?itok=E2HoPDg0)
跟踪磁盘利用率信息是系统管理员和其他人的日常待办事项列表之一。Linux 有一些内置的使用程序来帮助提供这些信息。
### df
`df` 命令意思是 “disk-free”显示 Linux 系统上可用和已使用的磁盘空间。
`df -h` 以人类可读的格式显示磁盘空间。
`df -a` 显示文件系统的完整磁盘使用情况,即使 Available可用 字段为 0
![](https://opensource.com/sites/default/files/uploads/df-ha.png)
`df -T` 显示磁盘使用情况以及每个块的文件系统类型例如xfs, ext2, ext3, btrfs 等)
`df -i` 显示已使用和未使用的 inodes
![](https://opensource.com/sites/default/files/uploads/df-ti.png)
### du
`du` 显示文件,目录等的磁盘使用情况,默认情况下以 kb 为单位显示
`du -h` 以人类可读的方式显示所有目录和子目录的磁盘使用情况
`du -a` 显示所有文件的磁盘使用情况
`du -s` 提供特定文件或目录使用的总磁盘空间
![](https://opensource.com/sites/default/files/uploads/du-has.png)
以下命令将检查 Linux 系统的总空间和使用空间。
### ls -al
`ls -al` 列出了特定目录的全部内容及大小。
![](https://opensource.com/sites/default/files/uploads/ls-al.png)
### stat
`stat <文件/目录> `显示文件/目录或文件系统的大小和其他统计信息。
![](https://opensource.com/sites/default/files/uploads/stat.png)
### fdisk -l
`fdisk -l` 显示磁盘大小以及磁盘分区信息。
![](https://opensource.com/sites/default/files/uploads/fdisk.png)
这些是用于检查 Linux 文件空间的大多数内置实用程序。有许多类似的工具,如 [Disks][1]GUI 工具),[Ncdu][2] 等,它们也显示磁盘空间的利用率。你有你最喜欢的工具而它不在这个列表上吗?请在评论中分享。
--------------------------------------------------------------------------------
via: https://opensource.com/article/18/7/how-check-free-disk-space-linux
作者:[Archit Modi][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[MjSeven](https://github.com/MjSeven)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/architmodi
[1]:https://wiki.gnome.org/Apps/Disks
[2]:https://dev.yorhel.nl/ncdu