OS Manuals

fish_is_root_user(1)

fish_is_root_user - check if the current user is root

FISH_IS_ROOT_USER(1) fish-shell FISH_IS_ROOT_USER(1)

fish_is_root_user - check if the current user is root

fish_is_root_user

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.

A simple example:

function example --description 'Just an example'

if fish_is_root_user
do_something_different
end end


fish-shell developers

October 15, 2026 4.9

fish 4.9.3-r3 · os · ingested 2026-10-16