DeveloperBreeze

File Management Development Tutorials, Guides & Insights

Unlock 3+ expert-curated file management tutorials, real-world code snippets, and modern dev strategies. From fundamentals to advanced topics, boost your file management skills on DeveloperBreeze.

Finding the Top 10 Biggest Files on an Ubuntu Server

Tutorial August 11, 2024
bash

sudo find /path/to/directory -type f -exec du -h {} + | sort -rh | head -n 10
  • sudo: Runs the command with superuser privileges, which might be necessary for accessing certain files or directories.
  • find /path/to/directory -type f: Searches for files (-type f) in the specified directory and its subdirectories. Replace /path/to/directory with the target directory, or use / to search the entire file system.
  • -exec du -h {} +: Executes the du (disk usage) command for each file found, with -h providing human-readable sizes (e.g., MB, GB).
  • sort -rh: Sorts the files in reverse order by size, with the largest files listed first.
  • head -n 10: Displays the top 10 files from the sorted list.

Batch File Renaming Using os Module

Code January 26, 2024
python

No preview available for this content.

List Files in a Directory Using os Module

Code January 26, 2024
python

No preview available for this content.