---
title: 'Linux Tips'
url: 'https://www.twelvetone.tv/docs/technology-links/tips/linux-tips'
markdown: 'https://www.twelvetone.tv/docs/technology-links/tips/linux-tips.md'
date: '2026-09-25'
description: "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 dir…"
taxonomy:
  category:
    - docs
---

[](#)  [ Home ](https://www.twelvetone.tv/docs/)     [ Technology Links ](https://www.twelvetone.tv/docs/technology-links)     [ Tips ](https://www.twelvetone.tv/docs/technology-links/tips)      Linux Tips    

# Getting top 5 folder sizes (recursive) in the current directory

```sh
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.

```bash
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
```

# Checking Disk Performance

<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

```bash
mkdir -p foo/bar/baz
```

---

## Navigation

- Parent: [Tips](https://www.twelvetone.tv/docs/technology-links/tips.md)
- Next: [LVM](https://www.twelvetone.tv/docs/technology-links/tips/lvm.md)
