SECON(1) General Commands Manual SECON(1)

# [NAME](#NAME)

secon - See an SELinux context, from a file, program or user input.

# [SYNOPSIS](#SYNOPSIS)

**secon** \[**-hVurtscmPRfLp**] \[*CONTEXT*]  
\[**--file**] *FILE*  
\[**--link**] *FILE*  
\[**--pid**] *PID*

# [DESCRIPTION](#DESCRIPTION)

See a part of a context. The context is taken from a file, pid, user input or the context in which **secon** is originally executed.

[**-V**, **--version**](#V)

shows the current version of secon

[**-h**, **--help**](#h)

shows the usage information for secon

[**-P**, **--prompt**](#P)

outputs data in a format suitable for a prompt

[**-C**, **--color**](#C)

outputs data with the associated ANSI color codes (requires -P)

[**-u**, **--user**](#u)

show the user of the security context

[**-r**, **--role**](#r)

show the role of the security context

[**-t**, **--type**](#t)

show the type of the security context

[**-s**, **--sensitivity**](#s)

show the sensitivity level of the security context

[**-c**, **--clearance**](#c)

show the clearance level of the security context

[**-m**, **--mls-range**](#m)

show the sensitivity level and clearance, as a range, of the security context

[**-R**, **--raw**](#R)

outputs the sensitivity level and clearance in an untranslated format.

[**-f**, **--file**](#f)

gets the context from the specified file FILE

[**-L**, **--link**](#L)

gets the context from the specified file FILE (doesn't follow symlinks)

[**-p**, **--pid**](#p)

gets the context from the specified process PID

[**--pid-exec**](#pid)

gets the exec context from the specified process PID

[**--pid-fs**](#pid~2)

gets the fscreate context from the specified process PID

[**--pid-key**](#pid~3)

gets the key context from the specified process PID

[**--current**, **--self**](#current)

gets the context from the current process

[**--current-exec**, **--self-exec**](#current~2)

gets the exec context from the current process

[**--current-fs**, **--self-fs**](#current~3)

gets the fscreate context from the current process

[**--current-key**, **--self-key**](#current~4)

gets the key context from the current process

[**--parent**](#parent)

gets the context from the parent of the current process

[**--parent-exec**](#parent~2)

gets the exec context from the parent of the current process

[**--parent-fs**](#parent~3)

gets the fscreate context from the parent of the current process

[**--parent-key**](#parent~4)

gets the key context from the parent of the current process

Additional argument *CONTEXT* may be provided and will be used if no options have been specified to make **secon** get its context from another source. If that argument is *-* then the context will be read from stdin.  
If there is no argument, **secon** will try reading a context from stdin, if that is not a tty, otherwise **secon** will act as though **--self** had been passed.

If none of **--user**, **--role**, **--type**, **--level** or **--mls-range** is passed. Then all of them will be output.

# [EXAMPLE](#EXAMPLE)

```
Show SElinux context of the init process
# secon --pid 1
Parse the type portion of given security context
# secon -t system_u:object_r:httpd_sys_rw_content_t:s0
```

# [SEE ALSO](#SEE_ALSO)

[**chcon**(1)](/man/enterprise-packages/policycoreutils/chcon.1)

# [AUTHORS](#AUTHORS)

```
James Antill (james.antill@redhat.com)
```

April 2006 Security Enhanced Linux

---

Document: secon(1) from policycoreutils 3.11-r2 (Chainguard OS)
Source: https://github.com/SELinuxProject/selinux.git
