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

I need to select the statements that are true. Example a,b,c. 1. Select all of t

ID: 3878383 • Letter: I

Question

I need to select the statements that are true. Example a,b,c.

1. Select all of the following statements that are true. The shell's PATH variable lists file system paths that the shell will scarch when trying to find a program. In Bash, one way to display the value of the PATH variable is the following command: echo SPATH a. b, Linux permissions dictatethings you may do with a file, read, write and execute. They as. s ened to in Linux by a single letter each. r read - you may view the contents of the file. Write-you may change the contents of the file. execute you may execute or run the file if it is a program or script. owner - a single person who owns the file. (typically the person who created the file but thers- everyone else who is not in the group or the owner c. For every file we define 3 sets of people for whom we may specify permissions. ownership may be granted to some one else by certain users) up every file belongs to a single group. d. The following command gives all members of the file's group executable permissions for the file, whizbam The following permissions may be used for directories but they have a slightly different behavior compared to their use with ordinary files e. r - you have the ability to read the contents of the directory (ie do an ls) w- you have the ability to write into the directory (ie create files and directories) xyou have the ability to enter that diretoryic cd) f. If the current working directory is writable, the following command creates a directory named limtutorialwork in the current working directory:

Explanation / Answer

a. TRUE

When you try to execute a program just by giving its name, the shell searches for that program in the paths listed in the PATH variable. To see the paths listed, you can just type echo $PATH in the shell

b. TRUE

We can see the file permissions by typing ls -l filename in the shell. Each letter specified in the question is represents read, write and execute for user, group and others

c. TRUE

In linux, there are 3 sets of people represented by u, g and o

d. TRUE

To modify a files permissions we use the chmod command. Doing chmod g+x filename, gives everyone in the user's group executable permissions.

e. TRUE

For directories, rwx are treated in a slightly different manner than for files. Whatever is mentioned in the question is true

f. TRUE

mkdir directory is used to create new directories. If the current directory has write permissions, we can create a directory, otherwise it throws an error

g. FALSE

The syntax of mv command is mv SOURCE DESTINATION. Doing mv foo foo3 changes the name of file foo to foo3

h. FALSE

The first part of the statement is true that it deletes all files/directories named backups and everything inside them. But the command doesn't prompt the user for confirmation. To have a prompt, we should use the -i option. Eg: rm -irf backups

i. TRUE

Assuming all files, directories have read/listing permissions, ls -R . lists the files and sub-directories and their contents recursively except the hidden files.

j. TRUE

< is the input redirection operator which redirects the contents of file through STDIN

k. TRUE

Works as mentioned in the question

l. FALSE

To redirect STDERR to file, we should use the 2> operator and not 3> operator. 3> operator creates a new file desciptor with handle 3

m. TRUE

The use of > operator is same as mentioned

n. TRUE

o. TRUE

Here also, if the file doesn't exist,it will be created

p. cat /usr/include/*.h > filename

cat command prints contents of all specified files. Using the > operator we write it into a new file.

Hope this helps. Do Upvote! :)