Help with Linux please read the question. i know how to use basic commands. thes
ID: 3841891 • Letter: H
Question
Help with Linux
please read the question. i know how to use basic commands. these answers require globbing, which i cant seem to get right.
using ubuntu
5. What command, issued from your home directory, will output the number of directories and files in /usr/share/man which contain at least one digit in their extensions?
ls -ld *.[0-9] /usr/share/man
didnt work
7. What ls command used with a globbing expression will list those files in /tmp/notes which contain three fours in the basename portion (pre-extension part) of the filename? (Must use globbing expression--no grep!)
tried ls *444* /tmp/notes
ls *[444]. /tmp/notes tells me - ls: *444*#: No such file or directory
Explanation / Answer
5
ls /usr/share/man |egrep '.*..*[0-9].*' |wc -l
7
ls /tmp/notes |egrep '.*444.*..*' |wc -l
NOTE:
. (dot) represents any character
. (back slash)(dot) represents a dot as character
[c-f] - the dash within the square brackets operates as a range. In this case it means either the letters c, d, e or f.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.