Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

home / study / engineering / computer science / questions and answers / Linux /

ID: 3854361 • Letter: H

Question

home / study / engineering / computer science / questions and answers / Linux / Unix: Please Help As Much As You Can. Thanks. ...

Your question has been answered

Let us know if you got a helpful answer. Rate this answer

Question: Linux / Unix: please help as much as you can. Than...

Linux / Unix: please help as much as you can. Thanks.

(1) What do the following commands do? Explain in detail.

a. cat <Enter> # ie when you type carriage return after typing cat
b. chmod -R 700 $HOME

(2) Identify command options and arguments in the following

$ ls -a -r /tmp /usr .
$ fold -80 /etc/passwd > /tmp/passwd
$ uname -S amazon
$ cat -A /tmp

(3) List name(s) of commands available in Unix system for the following

a. to create a directory structure project.d/project.d/project.d from your home directory without using    

multiple commands.
b. to list the first 20 lines in a file

(4) Explain what we do in the following set of commands.

$ pwd
/home/john
$ echo $HOME
/home/john
$ ln -s $HOME /tmp/$HOME.$$ <--- Explain this
$ cd /usr/src/cmd/usr/src/cmd
$ pwd
/usr/src/cmd/usr/src/cmd
$ cd ../../cmd/bin/usr/src <--- Explain this

(5) Using chmod write cmds for the following.

a. change the file perms to read and write by user and no other perms for others.
b. Add perms to a file to be readable by other and group.

Explanation / Answer

1.

(a) cat <filename> unix command prints contents of the file it is given. If no file is given, it will print from standard input. So after typing cat and hitting enter, whatever u type in terminal will simply be displayed in the next line

(b) $HOME is the variable name for the home directory of the system. chmod is used to change permissions of the directory. -R command applies chmod command recursively to every folder inside the given folder as well. 700 means owner of the folder has permissions to read, write and execute files in the folder, the group and others have no permissions at all.

2.

(a) It lists the files in given directory. -a is argument to include hidden files as well. -r is to reverse the order and print

(b) Fold command makes the lines wrap, that is if width of line is more than 80, then it puts a line break there

(c) Print system information, -s command to print kernel name.

(d) Cat -A is used to show all

3.

(a). Use command mkdir -p project.d/project.d/project.d

-p command creates the entire directory structure

(b) head -n 20 filename

4. ln -s creates a symbolic link between a folder and some target