bash_notes
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
bash_notes [2022/04/06 22:23] – raju | bash_notes [2022/11/08 20:28] – [documentation links] raju | ||
---|---|---|---|
Line 1: | Line 1: | ||
===== tasks ===== | ===== tasks ===== | ||
- | ==== list file names within a specific range ==== | + | ==== dummy ==== |
- | Q: Given a set of files in a directory: | + | * [[list files within |
- | < | + | |
- | file1.txt | + | |
- | file2.txt | + | |
- | ... | + | |
- | file30.txt | + | |
- | ... | + | |
- | </ | + | |
- | how do I list files in a specific range, say 18 through 31? | + | |
- | A: | + | ===== dummy ===== |
- | < | + | ==== useful links ==== |
- | ls file{18..31}.txt | + | * https:// |
- | </code> | + | * https:// |
+ | * https:// | ||
+ | * http:// | ||
- | To run a command on each of them, use a for loop | + | ==== documentation links ==== |
- | < | + | * ignoredups, erasedups - https://www.gnu.org/ |
- | for file in file{18..31}.txt | + | |
- | ... | + | |
- | </ | + | |
- | This construct | + | ==== what is the difference between |
- | Ref: | ||
- | * https:// | ||
- | * https:// | ||
- | |||
- | tags | list file names with a range | ||
- | |||
- | ===== dummy ===== | ||
- | ==== useful links ==== | ||
- | * https:// | ||
===== getopts ===== | ===== getopts ===== | ||
==== useful articles ==== | ==== useful articles ==== |
bash_notes.txt · Last modified: 2023/12/28 08:49 by raju