bash:files:list_files_excluding_some_files
Differences
This shows you the differences between two versions of the page.
bash:files:list_files_excluding_some_files [2021/01/26 12:15] – created peter | bash:files:list_files_excluding_some_files [2021/01/26 12:21] (current) – peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== BASH - Files - List files excluding some files ====== | ====== BASH - Files - List files excluding some files ====== | ||
- | Without enabled globbing files can be excluded by the second command of this code section: | + | Without enabled globbing, files can be excluded by the second command of this code section: |
<code bash> | <code bash> | ||
- | # See all files ending in .html | + | # List all files ending in .html. |
ls | grep " | ls | grep " | ||
- | # see all files not ending in .html | + | |
+ | # List all files not ending in .html. | ||
ls | grep -v " | ls | grep -v " | ||
</ | </ | ||
- | If extended globbing is turned on, one should be able to execute | + | ---- |
+ | |||
+ | If extended globbing is turned on: | ||
<code bash> | <code bash> | ||
Line 16: | Line 19: | ||
</ | </ | ||
- | in ksh and bash but I wasn' | + | <WRAP info> |
+ | **NOTE: | ||
+ | </ | ||
- | In zsh you enable globbing by inserting setopt extendedglob in .zshrc | ||
- | In the zsh this should work | + | This should work: |
<code bash> | <code bash> | ||
Line 26: | Line 30: | ||
</ | </ | ||
- | but I get zsh: number expected. | ||
- | |||
- | Even though it's not working yet it's worth to add these commands to this list as the issue can be fixed by reading some more documentation like [[http:// | ||
bash/files/list_files_excluding_some_files.1611663301.txt.gz · Last modified: 2021/01/26 12:15 by peter