1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-06-09 01:46:00 +02:00
tldr/pages/linux/restorecon.md
Managor 79b8d3e3b8
*: replace … with individual dots and refresh pages (#16368)
Co-authored-by: Darío Hereñú <magallania@gmail.com>
Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com>
2025-05-04 10:20:26 +03:00

825 B

restorecon

Restore SELinux security context on files/directories according to persistent rules. See also: semanage-fcontext. More information: https://manned.org/restorecon.

  • View the current security context of a file or directory:

ls {{[-dlZ|--directory -l --context]}} {{path/to/file_or_directory}}

  • Restore the security context of a file or directory:

restorecon {{path/to/file_or_directory}}

  • Restore the security context of a directory recursively, and show all changed labels:

restorecon -R -v {{path/to/directory}}

  • Restore the security context of a directory recursively, using all available threads, and show progress:

restorecon -R -T {{0}} -p {{path/to/directory}}

  • Preview the label changes that would happen without applying them:

restorecon -R -n -v {{path/to/directory}}