Just make sure you don't have more than 10 partitions per disk if you use the ls method, it lost my partitions sda10 to sda14 here
true, so you need to add */? to the end to include sda[0-9]<whatever> because shell globbing works differently that grep regexes
or you can go with
Code:
ls -a [hs]d[a-z][0-9]{[0-9],}
or with
Code:
find -maxdepth 1 -name '[hs]d[a-z][0-9]'
either way ls-and-grep is not a good approach and people doing that love doing other bad things like
Code:
for f in $( ls | grep ... ); ...; done
Builtin patterns should be used as often as possible because they are foolproof and avoid the problem of whitespaces (which appears when parsing file lists by hand) completely.
Bookmarks