Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

count files in directory linux

ls | wc -l
Comment

linux count files in directory

#count files in a directory faster with:
ls -f | wc -l
Comment

bash script count directories in directory

#count dirs in current dir.  ex. dir tree:  /a/b/c, /a/c/b, /a/d/
dirCount() { echo $(find "$1"* -maxdepth 0 -type d | wc -l); }
declare -l _path="/a/"
echo $(dirCount "$_path") #outputs: 3
Comment

Count files and directories using shell script

find /path/to/directory | wc -l
Comment

PREVIOUS NEXT
Code Example
Shell :: remove yarn 0.32+git 
Shell :: Unsupported file ./google-chrome-stable_current_amd64.deb kali 
Shell :: install freetype globally on ubuntu 
Shell :: return to previous directory terminal 
Shell :: how to push newly created branch in git bash 
Shell :: how to delete file from git command 
Shell :: Sublime Text install Ubuntu/Debian 
Shell :: Installing the virtualenv module 
Shell :: install amplify cli on mac 
Shell :: ubuntu list disks 
Shell :: teamviewer raspberry pi command line 
Shell :: get out of venv 
Shell :: ssh scp 
Shell :: How do I sync local and remote branches? 
Shell :: list enviroment variables 
Shell :: how to install winehq in ubuntu?? 
Shell :: how to reset source list ubuntu 
Shell :: docker make container run forever 
Shell :: how to install git in ubuntu ? 
Shell :: Error: Cannot tap homebrew/cask: invalid syntax in tap! 
Shell :: rmdir directory not empty 
Shell :: github commit 
Shell :: node js TypeError [ERR_INVALID_ARG_TYPE]: The argument must be of type string. Received undefined 
Shell :: install tomcat on mac brew 
Shell :: store credential cache git 
Shell :: This site can’t be reached 
Shell :: where is path on klai linux 
Shell :: bash how to run remote command 
Shell :: github create repo 
Shell :: aws s3 download file 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =