Modes (Unix) - String Mode Examples

String Mode Examples

For example, the following command would be used to add the read and write permissions to the user and group classes of a file or directory named sample:

$ chmod ug+rw sample $ ls -ld sample drw-rw---- 2 unixguy unixguy 96 Dec 8 12:53 sample

This command removes all permissions, allowing no one to read, write, or execute the file named sample.

$ chmod a-rwx sample $ ls -l sample ---------- 2 unixguy unixguy 96 Dec 8 12:53 sample

The following command changes the permissions for the user and the group to read and execute only (no write permission) on sample.

Sample file permissions before command $ ls -ld sample drw-rw---- 2 unixguy unixguy 96 Dec 8 12:53 sample $ chmod ug=rx sample $ ls -ld sample dr-xr-x--- 2 unixguy unixguy 96 Dec 8 12:53 sample

Read more about this topic:  Modes (Unix)

Famous quotes containing the words string, mode and/or examples:

    A culture may be conceived as a network of beliefs and purposes in which any string in the net pulls and is pulled by the others, thus perpetually changing the configuration of the whole. If the cultural element called morals takes on a new shape, we must ask what other strings have pulled it out of line. It cannot be one solitary string, nor even the strings nearby, for the network is three-dimensional at least.
    Jacques Barzun (b. 1907)

    Poor John Field!—I trust he does not read this, unless he will improve by it,—thinking to live by some derivative old-country mode in this primitive new country.... With his horizon all his own, yet he a poor man, born to be poor, with his inherited Irish poverty or poor life, his Adam’s grandmother and boggy ways, not to rise in this world, he nor his posterity, till their wading webbed bog-trotting feet get talaria to their heels.
    Henry David Thoreau (1817–1862)

    Histories are more full of examples of the fidelity of dogs than of friends.
    Alexander Pope (1688–1744)