HomeSoftware EngineeringDepend Information in Listing on Linux

Depend Information in Listing on Linux


If you should rely what number of recordsdata are in a listing on Linux, then you should use a mix of the ls command to checklist all of the recordsdata, and the wc command to rely what number of strains are printed:

Choice 1 – Utilizing wc

ls | wc -l

You’ll be able to specify a listing as follows:

ls <listing> | wc -l

Choice 2 – Utilizing discover

You’ll be able to rely recordsdata recursively through the use of the discover command:

discover <listing> -type f | wc -l

Choice 3 – Utilizing tree

Utilizing the tree command will print out the quantity of directories and recordsdata discovered, but when utilized in a big listing, then this may print quite a lot of output to the display screen, so watch out with this one.

tree

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

tree -a <listing>
RELATED ARTICLES

Most Popular

Recent Comments