(a) Use the UNIX command cat to create a ?le named id that has exactly two lines
ID: 3628949 • Letter: #
Question
(a) Use the UNIX command cat to create a ?le named id that has exactly two lines.
The ?rst line is your student id, while the second line is your name;
(b) Use cat to show the content of the ?le created;
(c) Enter a UNIX command to verify that this ?le has exact two lines. This command
should generate only a single line of output that contains the line number (as part
of the output);
(d) Enter a UNIX command to show the permissions of only the ?le id;
(e) Remove group and others read permissions from this ?le;
(f) Enter a UNIX command to show the permissions of only the ?le id again to verify
that this task has been performed successfully;
(g) Make a copy of this ?le and name the copy id.bak;
(h) Delete the ?le i
Explanation / Answer
(a) cat > id id name CTRL D (b)cat id (filename) (c)wc -l id (filename) (d)ls -lrt id (filename) (e)chmod go-r id (filename) (f)ls -lrt id (filename) (g)cp id id.bak (h)rm id
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.