Tuesday, June 6, 2023
HomeSoftware EngineeringMethods to Rely Information in Listing on Linux

Methods to Rely Information in Listing on Linux

If it’s worthwhile to rely what number of information are in a listing on Linux, then you need to use a mix of the ls command to checklist all of the information, and the wc command to rely what number of strains are printed:

Possibility 1 – Utilizing wc

ls | wc -l

You may specify a listing as follows:

ls <listing> | wc -l

Possibility 2 – Utilizing discover

You may rely information recursively through the use of the discover command:

discover <listing> -type f | wc -l

Possibility 3 – Utilizing tree

Utilizing the tree command will print out the quantity of directories and information discovered, but when utilized in a big listing, then it will print lots of output to the display, so watch out with this one.


This command won’t rely hidden information, so add the -a attribute to incorporate them:

tree -a <listing>


Please enter your comment!
Please enter your name here

Most Popular

Recent Comments