How to see the Size of a Directory Within LINUX? – All Commands

How to see the Size of a Directory Within LINUX?  - All Commands

How to see the Size of a Directory Within LINUX? – All Commands

The Linux operating system allows you to use a robust terminal to know the size of files, folders and even see partitions and disks without the need to use an interface. For this reason, if you are interested in knowing how to see the size of a directory within LINUXin this valuable tutorial we show you the procedure to achieve it.

What ways can you see the size of the directory in LINUX?

If you decide to download Ubuntu Linux or any other version, you should know that the space occupied by files and directories is allocated in blocks within the system.

In this regard, two measures are used: the first defines the real size, while the second reflects the number of bytes that the file or directory occupies. This last one is the number of file system blocks that are required for storage.

Read This Now:   How to install Nvidia graphics drivers in Pop_OS - Easy Steps

There are two ways to see the size of the directory in LINUX. One of the options is to use commands in the terminal with long format although you can also see them by classification. One way or another, you can get length of directory in blocks de bytes, kilobytes y megabytes.

in long format

It is possible to see the size of a directory within LINUX in long format. For this, open a terminal by pressing the ‘Ctrl + Alt + T’ keys. Type the command ls –l folder_name and press ‘Enter’ to see permission information, owner name, group name, size, creation date and time of the files.

See them by classification

Likewise, it is possible to see the size of a directory within LINUX by classification. To achieve this, open a terminal using the ‘Ctrl + Alt + T’ key combination and access a particular directory. Then, type ls –F and press the ‘Enter’ key. In this way, you will be able to see the type of user that has access to a particular directory.

What methods are there to see the weight of a directory within LINUX?

Just as it is possible to change the size of folders in Windows, methods can also be used to see the size of a directory within LINUX by means of the ls command and du command with its variants. The ls command has several parameters in order to access the long format, by classification or the human format to see the size in bytes and MB.

With the 1s command

The command allows them display the list of files and directories that are in a specific location on computers with the LINUX system. This command has various parameters such as the ‘ls –a’ command that is used to view hidden files and folders or ls –t which is used to sort files by modification date.

Read This Now:   How to Bypass iCloud Activation Lock - Simple Guide

Also, the command displays detailed information about a directory such as permissions, user and group names, the size of the files along with the date and time of creation using ‘ls –l’. Another parameter is ‘ls –lh’ which will be used to see the size in KB, MB and GB and ‘ls –R’ which allows showing the subdirectories in recursive mode.

see the dimensions of a directory in linux

The ‘du’ command and its variants

The ‘du’ command allows you to see the amount of space occupied by files and directories that are specified in a LINUX terminal. If the location of a directory is entered, the command will take care of displaying the space occupied by each subdirectory on the hard drive. If the path is not indicated, only the space occupied by the current directory is displayed.

The ‘du’ command by itself only displays the space in bytes that both the current directory and its subdirectories occupy on the hard drive. You can even add several variants such as ‘du s’ to show the total size of a particular directory, ‘du h’ to see the size in MB or GB and du /var to see the directory path.

Read This Now:   How to change the default web browser on Android - Easy Steps

With the ‘du’ command you can access top-level subdirectories by typing du -shc /var/*. What’s more, it’s possible view a report about using top-level subdirectories on disk via the du –h –max depth = 1 /var command. If you prefer to see the apparent size of a directory you should type du –sh –apparent –size /var.


Notice: ob_end_flush(): failed to send buffer of zlib output compression (1) in /home/gamefeve/bitcoinminershashrate.com/wp-includes/functions.php on line 5420

Notice: ob_end_flush(): failed to send buffer of zlib output compression (1) in /home/gamefeve/bitcoinminershashrate.com/wp-includes/functions.php on line 5420