Getting top 5 folder sizes (recursive) in the current directory
du -hs * | sort -rh | head -5
Recursive File Count In A Directory
This command is useful for finding a cache directory with 1000's of files.
find . -type f | wc -l
Replace .
with path if you want a count from other than the current directory.
Empty File Content by Redirecting to Null
The easiest way to empty or blank a file content is by using shell redirect null (non-existent object) to the file:
root@server# > access.log
https://askubuntu.com/questions/87035/how-to-check-hard-disk-performance
sudo hdparm -Tt /dev/sda
RAID Resize Array
- Launch RAID utility
- Create a new logical array with 1 or more drives
- Launch OS from USB
- Copy disk, including all partitions from old array
- Remove old array and reboot without USB to make sure it works
- Launch OS (with GParted) from USB and resize partitions as needed
- Resize LVM to fill partition
- Resize file system to fill LVM
Create a directory that also creates parent paths
mkdir -p foo/bar/baz