# info > msgattrib

---
type: CommandReference
command: msgattrib
mode: info
section: ""
source: info
---

## Quick Reference

- `msgattrib [OPTION] [INPUTFILE]` — filter messages by attribute, manipulate attributes
- `msgattrib --translated` — keep only translated messages
- `msgattrib --untranslated` — keep only untranslated messages
- `msgattrib --no-fuzzy` — remove fuzzy messages
- `msgattrib --only-fuzzy` — keep only fuzzy messages
- `msgattrib --fuzzy` — keep only fuzzy messages and clear their fuzzy mark
- `msgattrib --obsolete` — keep only obsolete messages and make them non-obsolete
- `msgattrib --set-fuzzy` — mark all messages fuzzy
- `msgattrib --clear-fuzzy` — mark all messages non-fuzzy

## Name

`msgattrib` — filter messages of a translation catalog according to attributes and manipulate those attributes

## Synopsis

`msgattrib [OPTION] [INPUTFILE]`

## Options

### Input file location

- `INPUTFILE` — Input PO file. If omitted or `-`, read from stdin.
- `-D DIRECTORY`, `--directory=DIRECTORY` — Add DIRECTORY to search list for source files. Output relative to current directory.

### Output file location

- `-o FILE`, `--output-file=FILE` — Write output to FILE. If omitted or `-`, write to stdout.

### Message selection

- `--translated` — Keep translated messages, remove untranslated.
- `--untranslated` — Keep untranslated messages, remove translated.
- `--no-fuzzy` — Remove fuzzy marked messages.
- `--only-fuzzy` — Keep fuzzy marked messages, remove all others.
- `--no-obsolete` — Remove obsolete `#~` messages.
- `--only-obsolete` — Keep obsolete `#~` messages, remove all others.

### Attribute manipulation

Attributes are modified after message selection. If `--only-file` or `--ignore-file` is given, attribute changes apply only to messages listed in the given file(s).

- `--set-fuzzy` — Mark all messages fuzzy.
- `--clear-fuzzy` — Mark all messages non-fuzzy.
- `--set-obsolete` — Mark all messages obsolete.
- `--clear-obsolete` — Mark all messages non-obsolete.
- `--previous` — When setting fuzzy, keep “previous msgid” of translated messages.
- `--clear-previous` — Remove “previous msgid” (`#|`) comments from all messages.
- `--empty` — When removing fuzzy mark, also set `msgstr` empty.
- `--only-file=FILE` — Limit attribute changes to entries listed in FILE (PO or POT).
- `--ignore-file=FILE` — Limit attribute changes to entries not listed in FILE (PO or POT).
- `--fuzzy` — Synonym for `--only-fuzzy --clear-fuzzy`: keep only fuzzy messages and remove their fuzzy mark.
- `--obsolete` — Synonym for `--only-obsolete --clear-obsolete`: keep only obsolete messages and make them non-obsolete.

### Input file syntax

- `-P`, `--properties-input` — Assume input is Java `.properties` syntax.
- `--stringtable-input` — Assume input is NeXTstep/GNUstep `.strings` syntax.

### Output details

- `--color`, `--color=WHEN` — Use colors and text attributes (WHEN: `always`, `auto`, `never`).
- `--style=STYLE_FILE` — CSS style file for `--color`.
- `--force-po` — Always write output file even if empty.
- `-i`, `--indent` — Write indented PO file.
- `--no-location` — Omit `#: FILENAME:LINE` lines.
- `-n`, `--add-location=TYPE` — Generate `#: FILENAME:LINE` lines (default). TYPE: `full`, `file`, or `never`.
- `--strict` — Write strict Uniforum PO file (avoid, lacks GNU extensions).
- `-p`, `--properties-output` — Write Java `.properties` syntax (no plural forms, drops obsolete messages).
- `--stringtable-output` — Write NeXTstep/GNUstep `.strings` syntax (no plural forms).
- `-w NUMBER`, `--width=NUMBER` — Set output page width; long strings split to fit.
- `--no-wrap` — Do not break long message lines (except file reference lines).
- `-s`, `--sort-output` — Sort output (harder for translators).
- `-F`, `--sort-by-file` — Sort output by file location.

### Informative output

- `-h`, `--help` — Display help and exit.
- `-V`, `--version` — Output version information and exit.

## See Also

- [gettext manual](https://www.gnu.org/software/gettext/manual/) — `msgattrib` is part of GNU gettext tools.
- `msgcmp` — compare two PO files.
- `msgen` — create English translation catalog.
- `msgfilter` — apply filter to translations.
- `msgfmt` — compile PO to MO.
- `msgmerge` — merge PO files.
- `msgunfmt` — decompile MO to PO.
- `xgettext` — extract translatable strings.