ServerCake India

How to find the total number of files in a folder in linux via SSH?


In a Linux Directory file system, each and every folder, files, directories are treated as an inode. Linux system directories and files are structured in a tree-like structure. In Linux system, every data and programs are stored in the file and these files are structured in organized directories. A directory is nothing but a file that contains other files or folders (directories).

When a file is created, it can be fully and uniquely identified by the full name of the file, including all directories to which the files belongs. Through this way, a file can be easily identified for its proper operation of the system. When we want to count the total number files present inside the directory we can use the below command just by neglecting the -R recursive flag. It means that the counting should be done inside the particular opened directory.

If you want to know the overall file count under the particular user, you can run the below command.

Command to find the total number of files,

ls -RL | wc -l

Editorial Team

Editorial Team at ServerCake India Blog is a team of experts in Server Administration, Business Development, Management, SEO Analyst & Graphic Designers with more than 5+ years of expertise.

Add comment