How to use ncdu to check disk space in Ubuntu
If so, you'll want to see how the ncdu command can help solve this problem.
Here's how to use ncdu to check disk space usage on Ubuntu and make disk space management an easy task.
Prerequisites: Install ncdu on Ubuntu
First, open terminal and update your system package information:
sudo apt update
Next, install ncdu on your Ubuntu system:
sudo apt install ncdu
To check if you can now run ncdu, just display its version:
ncdu -version
How to use ncdu on Ubuntu
ncdu is a modern replacement for the classic du command. This utility helps you analyze the disk usage of any folder.
Let's explore some practical use cases of the ncdu command.
1. Check the disk usage of the current folder
Running ncdu without any options displays the current directory's drive usage:
ncdu
2. Display subfolder details
To select a subfolder, you can use the up and down arrow keys. Then, press the i key to check the information of that subfolder such as Name, Path, Type, Disk usage and Apparent size:
3. Navigate to a specific subfolder
To navigate to the selected subfolder, simply press the right arrow key:
View relevant drive usage details and press the left arrow key to switch back to the parent folder.
4. Check the disk space of the root directory
To check the disk usage of the root directory, use the -x option with a forward slash /.
sudo ncdu -x /
The -x option instructs ncdu to only include files on the same file system:
The ongoing scan will take a few seconds to complete and then display the results:
5. Check the disk usage of a specific folder
To visualize the disk usage of any given folder, specify the relative or absolute path, just like you did with the root folder. For example:
ncdu ~/snap
By mastering ncdu, you can easily test and manage your memory, which makes your Ubuntu experience more efficient. So, take control of your system's efficiency and organization, and implement these tips to enjoy an optimized Ubuntu experience like never before.
You should read it
- How to check available memory in Ubuntu
- Ways to install Ubuntu on Windows, run in parallel or run separately
- Check out the most interesting features in Ubuntu 12.10
- How to install Ubuntu in parallel with Windows using USB
- Why is Ubuntu LTS preferred over regular distros?
- What's new in Ubuntu 18.04 LTS just released?
- How to prolong the life of Ubuntu 18.04 installation with Ubuntu Pro
- What is the difference between Ubuntu Desktop and Ubuntu Server?
May be interested
- How to run a program periodically using the Watch command on Linuxusing the watch command, you can monitor real-time system activities such as user login information, network status, memory and cpu usage, disk space, etc.
- How to Install XAMPP on Linuxtoday's tipsmake will show you how to install and run xampp software on a linux computer.
- How to Install Ubuntu on VirtualBoxthis article shows you how to install ubuntu linux on your computer using virtualbox. the virtualbox program allows you to install additional operating systems without changing the main operating system of your computer.
- Is it possible to run .exe files on Linux?you don't need to trade the appeal of windows software for the stability, security, ease of customization (and even great classic appearance) of linux. in this article, you will be shown how to run windows exe (possibly executable) files and software using the linux operating system. these methods can be applied to any linux distribution, including ubuntu, kali linux, centos and many others.
- How to Install Tor on Linuxtoday's tipsmake will show you how to download and install the tor browser on a linux computer.
- How to Install Linuxlinux is the foundation of thousands of open source operating systems designed to replace windows and mac os. linux allows users to download and install it for free on any computer. because this is an open source platform, the number of available versions or distributions is very diverse and is developed by many different organizations. follow the basic instructions below to install all linux versions, especially some of the most popular distributions.