902 B
902 B
| title | seo_description | date | draft | snippet_types | ||
|---|---|---|---|---|---|---|
| bash extract file name | How to use basename command to extract just file name from full path | 2022-03-17T15:08:43+01:00 | false |
|
Comparing the following shows how to use basename to extract just the file name from a full path.
$ for file in ./content/**/*.md ; do echo $file ; done | head -10
./content/_index.de.md
./content/_index.en.md
./content/_index.ru.md
./content/blog/_index.de.md
./content/blog/_index.en.md
./content/blog/ahrn-valley/index.en.md
./content/blog/archiving-corona-cal/index.en.md
./content/blog/arco/index.de.md
./content/blog/arco/index.en.md
./content/blog/armycookbot/index.de.md
$ for file in ./content/**/*.md ; do file=$(basename $file) && echo $file ; done
_index.de.md
_index.en.md
_index.ru.md
_index.de.md
_index.en.md
index.en.md
index.en.md
index.de.md
index.en.md
index.de.md