tldr/pages/windows/attrib.md

29 lines
898 B
Markdown
Raw Normal View History

2017-11-13 05:40:05 +00:00
# attrib
2022-08-23 20:20:07 +01:00
> Display or change attributes of files or directories.
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/attrib>.
2017-11-13 05:40:05 +00:00
2022-08-23 20:20:07 +01:00
- Display all set attributes of files in the current directory:
2017-11-13 05:40:05 +00:00
`attrib`
2022-08-23 20:20:07 +01:00
- Display all set attributes of files in a specific directory:
2017-11-13 05:40:05 +00:00
2022-08-23 20:20:07 +01:00
`attrib {{path\to\directory}}`
2017-11-13 05:40:05 +00:00
2022-08-23 20:20:07 +01:00
- Display all set attributes of files and [d]irectories in the current directory:
2017-11-13 05:40:05 +00:00
2022-08-23 20:20:07 +01:00
`attrib /d`
2017-11-13 05:40:05 +00:00
2022-08-23 20:20:07 +01:00
- Display all set attributes of files in the current directory and [s]ub-directories:
2017-11-13 05:40:05 +00:00
2022-08-23 20:20:07 +01:00
`attrib /s`
2017-11-13 05:40:05 +00:00
2022-08-23 20:20:07 +01:00
- Add the `[r]ead-only` or `[a]rchive` or `[s]ystem` or `[h]idden` or `not content [i]ndexed` attribute to files or directories:
2017-11-13 05:40:05 +00:00
2022-08-23 20:20:07 +01:00
`attrib +{{r|a|s|h|i}} {{path\to\file_or_directory1 path\to\file_or_directory2 ...}}`
2017-11-13 05:40:05 +00:00
2022-08-23 20:20:07 +01:00
- Remove a specific attribute of files or directories:
2017-11-13 05:40:05 +00:00
2022-08-23 20:20:07 +01:00
`attrib -{{r|a|s|h|i}} {{path\to\file_or_directory1 path\to\file_or_directory2 ...}}`