QUESTION 1 (13 marks)
On gaul, change your working directory to /bin/
(a)What will you get when executing pwd command? Explain why did you get that output?
(b) Use a Unix command to display the file names (do not display any of the directory contents, if any) in the current
working directory whose names:
I. (2 marks) are of length exactly 15 characters
This is the only one I can not get done on my assignment, i wrote two regular expressions but i can not tell which one is correct
ls /bin/ | grep -c ‘([0-9])([a-z])*{1,15}’
8
ls /bin/ | grep -c ‘[0-9][a-z]*{1,15}’
45
it has to only be characters A-Z, 0-9 and _
I think the following ls command is enough for your problem:
from ls man page:
and 15 “?” means, the name of dir/file should be exactly length of 15.