Describe Chmod command with example. 

1 Answer

Answer :

In Unix-like operating systems, the chmod command sets the permissions of files or directories. On Unix-like operating systems, a set of flags associated with each file determines who can access that file, and how they can access it. These flags are called file permissions or modes, as in "mode of access." The command name chmod stands for "change mode." It restricts the way a file can be accessed.

In general, chmod command take the form: chmod options permissions file name

If no options are specified, chmod modifies the permissions of the file specified by file name to the permissions specified by permissions. Permissions defines the permissions for the owner of the file (the "user"), members of the group who owns the file (the "group"), and anyone else ("others"). There are two ways to represent these permissions: with symbols (alphanumeric characters), or with octal numbers (the digits 0 through 7).

Syntax :

chmod [reference][operator][mode] file...

Example: chmod u=rwx,g=rx,o=r myfile

The letters u, g, and o stand for "user", "group", and "other". The equals sign ("=") means "set the permissions exactly like this," and the letters "r", "w", and "x" stand for "read", "write", and "execute", respectively. The commas separate the different classes of permissions, and there are no spaces in between them.

The equivalent command using octal permissions notation:

chmod 754 myfile 

Here the digits 7, 5, and 4 each individually represent the permissions for the user, group, and others, in that order. Each digit is a combination of the numbers 4, 2, 1, and 0:

4 stands for "read",

2 stands for "write",

1 stands for "execute", and

0 stands for "no permission."  

Related questions

Description : The Octal number to be given alogn with chmod command to make a file readable, writable and executable to the owner, readable and executable to group and others is: A. 000 B. 755 C. 744 D. 555 E. None of the above

Last Answer : B. 755

Description : Which command is used to remove the read permission of the file 'note' from both the group and others? A. chmod go+r note B. chmod go+rw note C. chmod go-x note D. chmod go-r, 4-x note E. None of the above

Last Answer : D. chmod go-r, 4-x note

Description : Which command is used to change protection mode of files starting with the string emp and ending with 1,2, or 3? A. chmod u+x emp[l-3] B. chmod 777 emp* C. chmod u+r ??? emp D. chmod 222 emp? E. None of the above

Last Answer : A. chmod u+x emp[l-3]

Description : In Unix, the command to enable execution permission for file “mylife” by all is ................ (A) Chmod ugo+X myfile (B) Chmod a+X myfile (C) Chmod +X myfile (D) All of the above

Last Answer : (D) All of the above

Description : Do htaccess / chmod rules exclude each other?

Last Answer : answer:First.. You are fucked… This is beyond being fixed. Just plan starting from scratch. Do you have a backup of the database? For all I know they have root on the server so short of nuking the server still leaves you vulnerable. Fixing wordpress puts food in my belly

Description : Explain the command line arguments with suitable example.

Last Answer : Java Command Line Argument: The java command-line argument is an argument i.e. passed at the time of running the java program. The arguments passed from the console can be received in the java program ... [0]); } } compile by > javac CommandLineExample.java run by > java CommandLineExample sonoo

Description : What is a command button ?

Last Answer : The OK, Cancel, Help, etc. buttons in the dialog box are called command buttons. Clicking on the OK button using various options in the dialog box takes effect on the Change or other selected ... the dialog box. Click on the Help button to get information about the various buttons and options.

Description : In a relational database, this is a data structure that organizes the information about a single topic into rows and columns. 1) Block 2) Record 3) Tuple 4) Table 5) Command line interface

Last Answer : Answer :4

Description : What do you call a program in execution? a) Command b) Process c) Task d) Instruction

Last Answer : Answer: b Explanation: Option Process is correct. A program is a set of instructions. A program in execution is called a process

Description : What do you call a a specific instruction designed to do a task? a) Command b) Process c) Task d) Instruction

Last Answer : Answer: a Explanation: A program is a set of instructions. A command is given to do a specific job. A program in execution is called a process

Description : A set of microinstructions for a single machine instruction is called ___________ a) Program b) Command c) Micro program d) Micro command

Last Answer : Answer: c Explanation: For every micro-operation, a set of microinstructions are written which indicate the control signals to be activated. A set of microinstructions is a micro program. The address of the next microinstruction is given by a Microprogram counter

Description : PCL stands for _________ A. Print Code Language B. Printer Code Language C. Printer Character Language D. Printer Command Language

Last Answer : D. Printer Command Language

Description : The control unit controls other units by generating control and _______ A. Command Signals B. Timing signals C. Transfer signals D. None of the Above

Last Answer : B. Timing signals

Description : The Command to access the memory or the I/O device is carried by ______ A. Address Bus B. Data Bus C. Control Bus D. None of the Above

Last Answer : C. Control Bus

Description : _____toolbar contains short cuts to some of the most frequently used command found under the FORMAT menu item: a) Status Bar b) Formatting Toolbar c) Standard Toolbar d) None of These

Last Answer : b) Formatting Toolbar

Description : In MS - Word ever command is available in: a) Printer b) Menu c) Desktop d) None of The Above

Last Answer : b) Menu

Description : What is the difference between cold booting and warm booting: a) Cold Booting uses a floppy for booting while warm booting uses a hard disk for booting b) Cold booting is starting the computer from the power ... CAD command or reset button when it hangs c) Both of The Above d) None of The Above

Last Answer : b) Cold booting is starting the computer from the power off position and warm booting is the restarting the computer with CAD command or reset button when it hangs

Description : Which command is used to quit power point: a) Alt + F4 b) Alt + Shift + F4 c) F4 d) Either (a) or (b) e) None of The Above

Last Answer : a) Alt + F4

Description : In MS - Word every command is available in: a) Printer b) Menu c) Letter d) None of The Above

Last Answer : b) Menu

Description : What is the use of sections in a word document: a) To divide the document into parts so that each part may be independently printed when the print command is given. b) To divide the document into ... document into parts and then allow formatting of each part the way you want. d) None of The Above

Last Answer : To vary the layout of a document within a page or between pages by dividing the document into parts and then allow formatting of each part the way you want.

Description : What is a shell: a) It is a hardware component b) It is a command Interpreter c) It is a part in computer d) None of The Above

Last Answer : b) It is a command Interpreter

Description : What is the significance of a faded (dimmed) command in a pull-down menu? a) The command is not currently accessible b) A dialog box appears if the command is selected c) A help window ... the command is selected d) There are no equivalent keystrokes for the particular command e) None of these

Last Answer : d) There are no equivalent keystrokes for the particular command

Description : The Assistant is -. 1) an application that allows you to take notes and save them in a file 2) an animated character that provides help and suggestions 3) a button on the standard Toolbar that executes the Print command 4) a collection of frequently misspelled words in a dictionary file

Last Answer : 2) an animated character that provides help and suggestions

Description : To find and load a file that has been saved - 1) select the Close command 2) select the New command 3) select the Save command 4) select the Open command

Last Answer : 4) select the Open command

Description : For creating a document, you use ..... command at File Menu. 1) Open 2) Close 3) New 4) Save

Last Answer : 3) New

Description : Which file in MS-DOS contains internal commands that are loaded during Booting process? 1) IO.SYS 2) MSDOS.SYS 3) COMMAND.COM 4) CONFIG.SYS

Last Answer : 4) CONFIG.SYS

Description : Which switch should be used in the DIR command to view files in all directories ? 1) /P 2) /W 3) /S 4) /L

Last Answer : 3) /S

Description : What is the switch that is used to make sure that the COPY command copied files correctly 1) /A 2) /C 3) /S 4) /V

Last Answer : 4) /V

Description : Which command can be used to recreate the disk's tracks and sectors ? 1) FDISK 2) FORMAT 3) CHKDSK 4) ATTRIB

Last Answer : 2) FORMAT

Description : After booting process which file executes automatically 1) config.sys 2) command.com 3) autoexec.bat 4) io.sys

Last Answer : 3) autoexec.bat

Description : Which file in MS-DOS contains internal commands that are loaded during Booting process? 1 IO.SYS 2 MSDOS.SYS 3 COMMAND.COM 4 CONFIG.SYS

Last Answer : 4 CONFIG.SYS

Description : Which switch should be used in the DIR command to view files in all directories ? 1 /P 2 /W 3 /S 4 /L

Last Answer : 3 /S

Description : What is the switch that is used to make sure that the COPY command copied files correctly 1 /A 2 /C 3 /S 4 /V

Last Answer : 4 /V

Description : Which command can be used to recreate the disk's tracks and sectors ? 1 FDISK 2 FORMAT 3 CHKDSK 4 ATTRIB

Last Answer : 2 FORMAT

Description : After booting process which file executes automatically 1 config.sys 2 command.com 3 autoexec.bat 4 io.sys

Last Answer : 3 autoexec.bat

Description : Which command is used to test network connectivity and provide a response to each packet received by the remote host? a.test b.tracer c.ping d.connect

Last Answer : c.ping

Description : ACL stands for. a. Application Control Language b. Application Control list c. Access control List d. Access Command List

Last Answer : d. Access Command List

Description : The messageChannel class declares the _________ class attribute that defines the key string. a) command_key b) command-key c) commandkey d) Key_command

Last Answer : a) command_key

Description : With suitable examples differentiate between grep and fgrep command.

Last Answer : grep command fgrep command grep is an acronym that stands for "Global Regular Expressions Print". fgrep is an acronym that stands for "Fixed-string Global Regular Expressions ...   Example: fgrep support myfile.txt Search for support in the myfile.txt

Description : To find and load a file that has been saved on a computer, which of the given options is used ? (1) Select the close command (2) Select the new command (3) Select the save command (4) Select the open command

Last Answer :  Select the open command

Description : Which of the following is an Disk Operating System (DOS) command ? (1) LIST (2) CHANGE (3) DUPLICATE (4) FORMAT

Last Answer : FORMAT

Description : What MS-DOS command is used to create a subdirectory ? (1) DIR/MK (2) MKDIR (3) CHDIR (4) RMDIR

Last Answer : MKDIR

Description : Which command is not used to switch off the computer ? (1) Turn off (2) Log off (3) Shut Down (4) Hibernate

Last Answer : Hibernate

Description : Which one of the following is an MS-DOS external command ? (1) DIR (2) COPY (3) FORMAT (4) PROMPT 

Last Answer : FORMAT

Description : Describe working of RAID-0 and RAID-1 with suitable example.

Last Answer : RAID 0 (Striped Disk Array Without Fault Tolerance):  This level strips the data into multiple available drives equally giving a very high read and write performance but offering no fault tolerance or redundancy.  ... No. of Disk: 2 Size of each disk: 100GB Usable Disk size: 100GB

Description : Describe working of diff and cmp file handling commands with example.

Last Answer : Diff command: diff stands for difference. This command is used to display the differences in the files by comparing the files line by line. it tells us which lines in one file have is to be changed to make the two files ... $ cat file1 abcd xyz $ cat file2 Abed wxy $_  

Description : Describe cat and rm file handling commands with example.

Last Answer : cat Command: Cat(concatenate) command is very frequently used in Linux. It reads data from the file and gives their content as output. It helps us to create, view, concatenate files. cat is ... and will delete all the files and sub-directories recursively of the parent directory. $ rm -r 

Description : Describe use of following commands with example: i) route ii) net stat

Last Answer : Route: Packets are transmitted from one computer to another. The route determines where the process starts and what computer system needs to send the packet for it to reach its destination. In ... or softwaredefined network interface) and network protocol statistics. Options of Netstat:

Description : Describe expr statement with example.

Last Answer : The expr command is used to evaluate an arithmetic expression from the command line.  The expr command can be used to perform arithmetic operations, comparison operations and string operations. The following table specify the way how to ... $a * $b' $ echo $c 170 $ expr 5 * 10 50