Is there a way to free disk space in Linux?

Is there a way to free disk space in Linux?

Please note these examples are run on a Red Hat Linux system (but should suffice if you are on a different distribution) and you should have sudo access to run these as root for maximum efficiency. This is the most basic command of all; df can display free disk space.

How can I free up space in my root drive?

Removing 3 or 4 older kernels will usually free up about a GB of space in your root drive. It finds all files bigger than 50 MB and ” du -h ” make a better list of files and “sort -n ” after pipe make list numerically sorted by file size.

How to check disk space in CentOS Linux?

Use the sudo command to elevate your privileges: Note: If you’re working on CentOS Linux, you may need to use the su command to switch to the root user to access protected directories. You should now understand how to use df and du commands to check disk space on your Linux system.

How is disk space divided up in Linux?

However, operating systems divide that space up so that 1024 bytes = 1 kilobyte. Because of this, a 1000-gigabyte hard drive ends up with roughly 930 gigabytes of usable storage. The du command displays disk usage. This tool can display disk usage for individual directories in Linux, giving you a finer-grained view of your disk usage.

How to wipe a hard drive on Linux?

How to Wipe a Hard Drive on Linux? 1 wipe. As the name suggests, the command is used to wipe data from a magnetic disk. 2 shred. This is one of the best ways to protect your private data on a Linux system. 3 dd. If you are running short on time, then consider using the “dd” command to erase disk on a Linux system. 4 scrub.

How to check hard drive space in Linux?

You can display disk usage in units of 1000 instead of 1024: This can address a point of confusion in storage technology. Hard drive manufacturers sell hard drives in sizes based on 1000 bytes = 1 kilobyte. However, operating systems divide that space up so that 1024 bytes = 1 kilobyte.