|
CS469 - Linux and Unix Administration and Networking
| Displaying exercises/e3/files/e3.txt
Exercise #3
Using a UNIX text editor of your choice, edit this file and answer the following
questions. Use the "man" command to reference any of the named commands. When
asked how to do something, write out the command you would use to do it.
1. Write the "grep" (man 1 grep) regular expression (and just the regex) to do
the following:
a) Match a line that has at least one character on it:
b) Match all lines containing a two-digit number:
c) Match all lines beginning with a word ending in et, st, xt or ft:
(you may assume the words only contain letters)
d) Match all lines beginning with a lowercase letter and ending with a number:
(and may contain 0 or more characters between these two)
e) Match all lines beginning with either root or bin:
f) Match all lines that contain .gif, .png or .jpg:
g) Match any line that starts with 'cs' followed by between 3 to 5 digits:
h) All lines containing an email address (assume email addresses may contain
lower and uppercase letters, numbers, dot (.), underscore (_) and hyphen (-)),
in addition to the at (@) sign separating the local-name from the domain:
2. List the command(s) to set the following ACL's on the directory 'dir1':
a) Both a default and normal user ACL for apache that allows it to
read and search:
b) A group ACL for class that allows full access + set permissions for
other to none:
|