It is a simple task and a very common task for a VPS user. You have a VPS, and want to know the disk usage of your data and system. You are also want to know which folder takes the biggest disk space.
The command is du
du takes a single argument, specifying a pathname for du to work; if it is not specified, the current directory is used. The SUS mandates for du the following options:
-a, display an entry for each file (and not directory) contained in the current directory
-c, display a grand total of the disk usage found by the other arguments
-d #, the depth at which summing should occur. -d 0 sums at the current level, -d 1 sums at the subdirectory, -d 2 at sub-subdirectories, etc.
-H, calculate disk usage for link references specified on the command line
-k, show sizes as multiples of 1024 bytes, not 512-byte
-L, calculate disk usage for link references anywhere
-s, report only the sum of the usage in the current directory, not for each file
-x, only traverse files and directories on the device on which the pathname argument is specified.
Above command usage method retrieved from Wikipedia.
It is a general test on a Centos 6.4 system. The benchmark script is made by http://www.php-benchmark-script.com/. The first time I run it on the updated default Centos6.4. The php version is 5.3.3. I think it has Xcache installed. The test result is Total time: 8.482 sec.Breakdown as below:
test_math 2.332 sec.
test_stringmanipulation : 2.321 sec.
test_loops : 2.346 sec.
test_ifelse : 1.483 sec.
Then I upgrade or replace the php 5.3 by php 5.5. I follow the guide on Webtactic. http://www.webtatic.com/packages/php55/ Continue reading
Yesterday, when I sign in one of my VPS webmin control panel, it displayed an upgrade button. Look at the folowwing screen shot and just click the button underneath, Upgrade Webmin Now.
It is a update with new features and bug fixes. Worth to upgrade.
Then, I click Upgrade Webmin Now button to upgade Webmin from 1.630 to 1.640. see following release notes of this new version of Webmin.
Version 1.640 (13th August 2013)
Even more German translation updates thanks to Raymond Vetter, Norwegian updates thanks to Stein-Aksel Basma, Polish from Piotr Kozica, and Catalan from Jaume Badiella.
UI consistency improvements in the Linux Firewall and Xinetd modules.
Support for new Apache 2.4 features, such as IncludeOptional, the removal of NameVirtualHost and use of apachectl to get enabled modules.
Improved error detection and better handling of disks that don’t start on cylinder 1 in the Fdisk module.
Support for growing a logical volume to the maximum size possible in the LVM module.
Fixes for total and free memory detection under OpenVZ / Virtuozzo.
Mandriva Linux improvements in the Bootup and Shutdown and other modules.
Fix for a bug that could cause /etc/webmin to be deleted following a failed upgrade on Debian.
Improved support for FreeBSD 8, bringing it into sync with FreeBSD 9.
htop is an interactive process viewer for Linux. It is a text-mode application (for console or X terminals) and requires ncurses.
If you used top command before, I would like to tell you that htop is a replacement of top, but even better.
Since I have rpmforge Repository on my VPS, the installation is as simple as one command.
When using a SSD to hold the system with the fresh installation, 4K alignment is a key point to improve the performance.
Ensure that your new partition layout is aligned with the 4KB sectors of such drives (older hard drives used 512B alignment). If your partition is not “4K aligned”, then you will have performance issues as the logical and physical sector boundaries will not line up, causing two physical write/erase cycles to happen for each logical one.
Based on IBM article, Linux has same issue when you use SSD.
When use Ubuntu Live CD to do the partition, it will make 4K alignment automatically. See the screen below.
2048 (default since fdisk 2.17.2) means that my SDD is aligned correctly. Any other value divisible by 8 is good as well.
LILO (Linux Loader) and GRUB (GRand Unified Bootloader) are both configured as a primary boot loader (installed on the MBR) or secondary boot loader (installed onto a bootable partition). First question, what is a boot loader.
The simple answer: a boot loader loads the operating system.
When your machine loads its operating system, the BIOS reads the first 512 bytes of your bootable media (which is known as the master boot record, or MBR). For more information of MBR, see MBR at Wikipedia.
The task is to delete files from the folder and sub-folders, maybe sub-sub-folder.
Say I want to delete .htaccess from every folder, but keep all others no-touch.
It is hard to go into each folder and delete the file. It takes time and also very easy to miss some folders.
There is one command in Linux. Great tool for it.
One line to do the job.