Here are a few methods to find and delete big files on a Linux system:
- Using the find command:
find / -type f -size +100M
This command searches for files larger than 100MB starting from the root directory ("/"). You can replace "100M" with the desired file size.
- Using the du command:
du -ah / | sort -rh | head -n 10
This command lists the top 10 largest files/directories on your system. You can replace "10" with the desired number.
- Once you have identified the big files, you can delete them using the rm command:
Replace "/path/to/file" with the actual path of the file you want to delete. If you have multiple files, you can use wildcards to delete them all at once. For example:
Note: Please exercise caution when deleting files using the command line, as it permanently removes them and there is no undo. Double-check the files you are deleting to avoid accidental data loss.