Linux command
fixfiles 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Restore
fixfiles restore
Example
fixfiles onboot
Force reset
fixfiles -F restore
Example
fixfiles -R package1,package2 restore
Example
fixfiles -N "2024-01-01" restore
Verbose
fixfiles -v restore
Bind mount
fixfiles -M restore
说明
fixfiles fixes file SELinux security contexts on the system. It is a wrapper script around restorecon and setfiles that provides convenient system-wide relabeling options.
参数
- -B
- Record current date for later use with restore to speed up labeling
- -F
- Force reset of context for customizable files
- -f
- Clear /tmp directory without confirmation
- -R PACKAGES
- Discover files within specific RPM packages and restore their contexts
- -C FILECONTEXT
- Compare with previous filecontext and restore affected files
- -N DATE
- Only process files created after specified date (YYYY-MM-DD HH:MM)
- -M
- Bind mount filesystems before relabeling
- -v
- Verbose mode; run restorecon with -v instead of -p
- restore
- Restore file contexts to defaults
- check
- Check file contexts without changing them
- onboot
- Schedule relabeling on next boot
- relabel
- Relabel entire filesystem
- verify
- Verify file contexts match policy
FAQ
What is the fixfiles command used for?
fixfiles fixes file SELinux security contexts on the system. It is a wrapper script around restorecon and setfiles that provides convenient system-wide relabeling options.
How do I run a basic fixfiles example?
Run `fixfiles restore` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -B do in fixfiles?
Record current date for later use with restore to speed up labeling