How do I find out what is consuming space on Linux?

du command – Display the amount of disk space used by the specified files and for each subdirectory. btrfs fi df /device/ – Show disk space usage information for a btrfs based mount point/file system.

How do you check what is taking up space on Linux?

To find out where disk space is being used:

  1. Get to the root of your machine by running cd /
  2. Run sudo du -h –max-depth=1.
  3. Note which directories are using a lot of disk space.
  4. cd into one of the big directories.
  5. Run ls -l to see which files are using a lot of space. Delete any you don’t need.
  6. Repeat steps 2 to 5.

How do I check disk usage per directory in Linux?

The df and du command line utilities are the two best tools we have to measure disk consumption on Linux. For checking disk usage by folder, the du command is particularly useful. When running du without any extra options, keep in mind that it will check the total disk usage of each subdirectory, individually.

Which directory is consuming space in Linux?

Using du to Find Directory Disk Usage: The du command is available in all modern Linux distribution by default. You don’t have to installing anything extra. The du command with the options -s (–summarize) and -h (–human-readable) can be used to find out how much disk space a directory is consuming.

How do I clean up Linux?

All three commands contribute to free up disk space.

  1. sudo apt-get autoclean. This terminal command deletes all . …
  2. sudo apt-get clean. This terminal command is used to free up the disk space by cleaning up downloaded . …
  3. sudo apt-get autoremove.

How do I manage disk space in Linux?

How to Check and Manage Disk Space in Linux

  1. df – This reports the amount of disk space on a system.
  2. du – This shows the amount of space used by specific files.

How do I find the top 10 files in Linux?

The procedure to find largest files including directories in Linux is as follows:

  1. Open the terminal application.
  2. Login as root user using the sudo -i command.
  3. Type du -a /dir/ | sort -n -r | head -n 20.
  4. du will estimate file space usage.
  5. sort will sort out the output of du command.

How do I view open files in Linux?

You can run lsof command on Linux filesystem and the output identifies the owner and process information for processes using the file as shown in the following output.

  1. $ lsof /dev/null. List of All Opened Files in Linux. …
  2. $ lsof -u tecmint. List of Files Opened by User. …
  3. $ sudo lsof -i TCP:80. Find Out Process Listening Port.

How do I tell if a process is running in Linux?

Check running process in Linux

  1. Open the terminal window on Linux.
  2. For remote Linux server use the ssh command for log in purpose.
  3. Type the ps aux command to see all running process in Linux.
  4. Alternatively, you can issue the top command or htop command to view running process in Linux.

What is using disk space Linux?

df command – Shows the amount of disk space used and available on Linux file systems. du command – Display the amount of disk space used by the specified files and for each subdirectory. btrfs fi df /device/ – Show disk space usage information for a btrfs based mount point/file system.

How do I list directories in Linux?

See the following examples:

  1. To list all files in the current directory, type the following: ls -a This lists all files, including. dot (.) …
  2. To display detailed information, type the following: ls -l chap1 .profile. …
  3. To display detailed information about a directory, type the following: ls -d -l .

What does du command do in Linux?

The du command is a standard Linux/Unix command that allows a user to gain disk usage information quickly. It is best applied to specific directories and allows many variations for customizing the output to meet your needs.

Like this post? Please share to your friends:
OS Today