bash:get_number_of_files_or_directories
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
bash:get_number_of_files_or_directories [2019/12/17 19:28] – created peter | bash:get_number_of_files_or_directories [2021/01/26 15:21] (current) – removed peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== BASH - Get Number of Files or Directories ====== | ||
- | |||
- | <code bash> | ||
- | #!/bin/bash | ||
- | |||
- | if [ -d " | ||
- | echo "Files found: $(find " | ||
- | echo " | ||
- | else | ||
- | echo " | ||
- | exit 1 | ||
- | fi | ||
- | </ | ||
- | |||
- | Pass the directory name where you want to search for files from the command-line. | ||
bash/get_number_of_files_or_directories.1576610888.txt.gz · Last modified: 2020/07/15 09:30 (external edit)