UNIX tip: chmod's +X option

UNIX tip: from chmod(1): “The letters ‘rwxXstugo’ select the new permissions for the affected users […one option is:] execute only if the file is a directory or already has execute permission for some user (X)”. That is, when, for whatever reason, you’ve got a whole tree of files and directories, and you can’t enter some number of sub-directories because their execute bit isn’t set, you can either execute chmod -R u+x my_dirs, or, you can (now) execute chmod -R u+X my_dirs. The former will make all the files executable (Bad™) while the latter will make only directories enterable (or, otherwise-executable files executable for you). Handy to know.

Reply

Join the conversation! Tell me what you think:
The content of this field is kept private and will not be shown publicly.
  • You can use Markdown syntax to format and style the text.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <apachelog>, <bash>, <c>, <cfdg>, <cpp>, <cpp-qt>, <csharp>, <css>, <drupal5>, <drupal6>, <haskell>, <html4strict>, <io>, <java-generic>, <java>, <javascript>, <latex>, <lisp>, <mysql>, <ocaml>, <ocaml-breif>, <perl>, <php>, <php-breif>, <python>, <rails>, <robots>, <ruby>, <smalltalk>, <sql>, <text>, <xml>.
  • Syntax: [amazon title|cover|info asin] Example: [amazon cover B0007M123K]
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

Be sure to read my comment policy.

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
3 + 11 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.
bk