小编gar*_*ncn的帖子

为什么 df 和 du 报告的磁盘使用情况存在差异?

我有一台Linux CentOS服务器,使用的 OS+ 包大约5GB。然后,我将97GB 的数据从 Windows 服务器传输到这台 Linux 服务器上的两个文件夹,计算磁盘使用后,我看到两个文件夹的总大小大于磁盘使用大小。

du -sh在每个文件夹上运行,一个使用50GB,另一个使用47GB

但是运行起来df -h,使用的空间是96GB。( 50GB + 47GB + 5GB ) > 96GB

有什么问题吗?这两个文件夹包含大量文件(100 万+)。谢谢。

linux centos disk-usage

13
推荐指数
2
解决办法
1万
查看次数

Rename Multiple files and add date before the files

I have a folder contains one or more tar.gz files. I want to add current date before each files when the script run.

For example:

Two file name(those files will be created each day, but the name will remain the same):

file1.tar.gz 
file2.tar.gz
Run Code Online (Sandbox Code Playgroud)

In first day(2011-10-07), those two files will be renamed to:

2011-10-07_file1.tar.gz
2011-10-07_file2.tar.gz
Run Code Online (Sandbox Code Playgroud)

In next day(2011-10-08), they are changed to:

2011-10-08_file1.tar.gz
2011-10-08_file2.tar.gz
Run Code Online (Sandbox Code Playgroud)

Finally, the folder contains the following files:

2011-10-07_file1.tar.gz
2011-10-07_file2.tar.gz
2011-10-08_file1.tar.gz
2011-10-08_file2.tar.gz
Run Code Online (Sandbox Code Playgroud)

How to achieve this using …

bash rename

1
推荐指数
1
解决办法
1万
查看次数

标签 统计

bash ×1

centos ×1

disk-usage ×1

linux ×1

rename ×1