CHMOD

NAME
SYNOPSIS
DESCRIPTION

NAME

chmod - changes the permissions on a list of files

SYNOPSIS

chmod LIST

DESCRIPTION

Changes the permissions of a list of files. The first element of the list must be the numerical mode, which should probably be an octal number, and which definitely should not a string of octal digits: 0644 is okay, ’0644’ is not. Returns the number of files successfully changed. See also the oct entry in the perlfunc manpage, if all you have is a string.

$cnt = chmod 0755, ’foo’, ’bar’;
chmod 0755, @executables;
$mode = ’0644’; chmod $mode, ’foo’; # !!! sets mode to --w----r-T
$mode = ’0644’; chmod oct($mode), ’foo’; # this is better
$mode = 0644; chmod $mode, ’foo’; # this is best