Thread: grep returns errors with [0-9] at end
i'm sorry if repeated question, tried search on forums , inundated unrelated posts.
messing around in terminal , decided try find hard drive devices. changed /dev , entered "ls -a | grep [hs]d[a-z][0-9]"
lo , behold, this:
using sudo on ls , grep did nothing change that. tried putting ampersand after pipe--no dice. did work eliminating sort of bracket @ end of command--if put in "grep [hs]d[a-z]." period @ end instead of "[0-9]", grep returns perfectly. couldn't find explanation anywhere on internet or in man pages. know why it's acting way?grep: sda2: permission denied
grep: sda3: permission denied
grep: sda5: permission denied
grep: sda6: permission denied
grep: sda7: permission denied
edit: clear, when errors occur, there no stdout being displayed. piping 2> /dev/null returns nothing
i tried here home folder (not cd-ing /dev), found drives, needed sudo on grep, listing /dev without raising privileges seems work fine.
code:$ ls -a /dev | sudo grep [hs]d[a-z][0-9] [sudo] password *<my-local-username>*: sda1 sda10 sda11 sda12 sda13 sda14 sda2 sda3 sda5 sda6 sda7 sda8 sda9 sdb1 sdb2 sdb3 sdb4 sdc1 sdd1
Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [SOLVED] grep returns errors with [0-9] at end
Ubuntu
Comments
Post a Comment