FISH\_IS\_ROOT\_USER(1) fish-shell FISH\_IS\_ROOT\_USER(1)

# [NAME](#NAME)

fish\_is\_root\_user - check if the current user is root

# [SYNOPSIS](#SYNOPSIS)

```
fish_is_root_user
```

# [DESCRIPTION](#DESCRIPTION)

**fish\_is\_root\_user** will check if the current user is root. It can be useful for the prompt to display something different if the user is root, for example.

# [EXAMPLE](#EXAMPLE)

A simple example:

```
function example --description 'Just an example'


    if fish_is_root_user


        do_something_different


    end
end
```

# [Copyright](#Copyright)

fish-shell developers

October 15, 2026 4.9

---

Document: fish_is_root_user(1) from fish 4.9.3-r3 (Chainguard OS)
Source: https://github.com/fish-shell/fish-shell
