Linux CLI Terminal: Free Memory & Free Disk Space

How to Check Free Memory Space on Linux

========

How to Check Free Memory Space on Linux [Terminal]

==================================

Method 1: Using meminfo

cat /proc/meminfo

grep MemTotal /proc/meminfo

=================
=================

Method 2: Using free, top and Other Commands
1
Typing free in your command terminal provides the following result:
free
2
Use:
top
htop
3
Provides general information about processes, memory, paging, block IO, traps, and CPU activity.
vmstat

=================

How to Check Free Disk Space on Linux

========

How to Check Free Disk Space on Linux [Terminal]

==================================

Method 1: Using df 
The df command stands for disk-free and quite obviously, it shows you the free and available disk space on Linux systems.
1
With -h option, it shows the disk space in human-readable format (MB and GB).
df -h
2
View the disk usage with more details like filesystem type and blocks, you can use the command:
df -T
3
Shows the file system's complete disk usage even if the Available field is 0
df -a 

=================

Method 2: Using du, ls, and Other Commands
While df command is quite popular and should be enough for the use case, there are other alternatives that you can try including:

du -h → Shows disk usage in human-readable format for all directories and subdirectories.
du -a →Shows disk usage for all files.
du -s Provides the total disk space used by a particular file or directory.
ls -al →Lists the entire contents, along with their size, of a particular directory.
stat <file/directory> →Displays the size and other stats of a file/directory or a file system.
fdisk -l →Shows disk size along with disk partitioning information (may require sudo privileges).
dust  → An interesting alternative to the du command written in Rust, available for Arch Linux in the repositories. For other Linux distros, you can refer to its GitHub releases section.

=================

Bootstrap 5.x Pop-overs As Fast As 3-Steps

Official Docs located here:

https://getbootstrap.com/docs/5.1/components/popovers/

Production Example here:

http://michaeleliasphotovoltaicsystems.com/products.php

STEP-1 [in the place of Popovers – HTML5]:

                    <div class="justify-content-md-center">
                        <h1 class="text-center spacer_bottom">LUXOR SOLAR - Solar Panels</h1>

                        <div class="row justify-content-md-center">
                            <div class="col-xxl-6 col-xl-6 col-lg-6 col-md-12 col-sm-12 col-12">
                                <button id="myPopover1" type="button" class="btn btn-secondary" data-bs-container="body" data-bs-toggle="popover" data-bs-placement="top" >
                                    <img style="max-height: 1000px; height: 100%;" class="img-fluid" src="https://clients2021.s3.eu-central-1.amazonaws.com/Solar/assets/images/JPGs/Solar-Panels/Solar-Panel_LUXOR_Eco_Line_HC_M120_FB_365-385W_166cs-1.jpg" alt="Solar-Panel_LUXOR_Eco_Line_HC_M120_FB_365-385W_166cs" />
                                </button>
                            </div>
                            <div class="col-xxl-6 col-xl-6 col-lg-6 col-md-12 col-sm-12 col-12">
                                <button id="myPopover2" type="button" class="btn btn-secondary" data-bs-container="body" data-bs-toggle="popover" data-bs-placement="top" >
                                    <img style="max-height: 1000px; height: 100%;" class="img-fluid" src="https://clients2021.s3.eu-central-1.amazonaws.com/Solar/assets/images/JPGs/Solar-Panels/Luxor-Solar-Panel-Warramty-LX-PWEX-15plus-EN-1.jpg" alt="Luxor-Solar-Panel-Warramty-LX-PWEX-15plus years" />
                                </button>
                            </div>
                        </div>
                    </div>

STEP-2 [Bottom, Below The Footer]:

<!--===== script start =====-->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/popper.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>

STEP-3 [Bottom, Below/After Step-2]:

<script>

    $(document).ready(function(){

        $("#myPopover1").popover({
            title: '<h6 class="custom-title"><i class="bi-info-circle-fill"></i> LUXOR SOLAR More info</h6>',
            content: '<div><a target="_blank" href="/LX_EL_HC_M120_340-360W_1684x1002x35_SF_158cs_en_low.pdf">Link Doc PDF</a> &nbsp; - &nbsp; <a target="_blank" href="https://www.luxor.solar/en/index-en.html">Luxor Web-Site</a></div>',
            html: true
        });

        $("#myPopover2").popover({
            title: '<h6 class="custom-title"><i class="bi-info-circle-fill"></i> LUXOR SOLAR More info</h6>',
            content: '<div><a target="_blank" href="/LX-PWEX-15plus-EN.pdf">Link Doc PDF</a> &nbsp; - &nbsp; <a target="_blank" href="https://www.luxor.solar/en/index-en.html">Luxor Web-Site</a></div>',
            html: true
        });
   });

</script>

That’s it…!!!

========================