Showing posts with the label Linux Find Command

Featured Post

SQL Query: 3 Methods for Calculating Cumulative SUM

SQL provides various constructs for calculating cumulative sums, offering flexibility and efficiency in data analysis. In this article, we explore three distinct SQL queries that facilitate the computation of cumulative sums. Each query leverages different SQL constructs to achieve the desired outcome, catering to diverse analytical needs and preferences. Using Window Functions (e.g., PostgreSQL, SQL Server, Oracle) SELECT id, value, SUM(value) OVER (ORDER BY id) AS cumulative_sum  FROM your_table; This query uses the SUM() window function with the OVER clause to calculate the cumulative sum of the value column ordered by the id column. Using Subqueries (e.g., MySQL, SQLite): SELECT, t1.value, SUM(t2.value) AS cumulative_sum FROM your_table t1 JOIN your_table t2 ON >= GROUP BY, t1.value ORDER BY; This query uses a self-join to calculate the cumulative sum. It joins the table with itself, matching rows where the id in the first table is greater than or

How to Find Folder Space in Linux Easily

Here's an example that shows how to use find command to get directory utilized space in Linux. Many of a time during production support, or when crontab jobs failed, the reasons behind is space shortage of a directory. The find is handy you can use to get utilized space of a directory. That helps you to delete unnecessary files (that actually make some space). Linux find command Here's the find command that I  have used in our project . You will find here the detailed explanation of this command and how to use it. find  /home/srini -xdev -ls | sort +6rn | head -20 Part#1: Directory path In the first part,  after the find you need to give the directory's path for which  folder you are going to find  space. Part#2: Option -xdev The second part is  -xdev , which gives the space usage of all the subdirectories. Part#3: Option -ls The next part is the -ls option that provides a sorted list of all the subdirectories.  Part#4: Sort command Then, the sort command sorts based on the