Home Explore Blog CI



nushell

commands/docs/is-admin.md
d80e0249a8a798cf3dd7a1e85df9d6e8b5306027c8caee3a0000000300000343
---
title: is-admin
categories: |
  core
version: 0.104.0
core: |
  Check if nushell is running with administrator or root privileges.
usage: |
  Check if nushell is running with administrator or root privileges.
editLink: false
contributors: false
---
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->

# `is-admin` for [core](/commands/categories/core.md)

<div class='command-title'>Check if nushell is running with administrator or root privileges.</div>

## Signature

```> is-admin {flags} ```


## Input/output types:

| input   | output |
| ------- | ------ |
| nothing | bool   |
## Examples

Return 'iamroot' if nushell is running with admin/root privileges, and 'iamnotroot' if not.
```nu
> if (is-admin) { "iamroot" } else { "iamnotroot" }
iamnotroot
```

Chunks
6cf683a5 (1st chunk of `commands/docs/is-admin.md`)
Title: untitled
Summary
--- title: is-admin categories: | core version: 0.104.0 core: | Check if nushell is running with administrator or root privileges. usage: | Check if nushell is running with administrator or root privileges. editLink: false contributors: false --- <!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. --> # `is-admin` for [core](/commands/categories/core.md) <div class='command-title'>Check if nushell is running with administrator or root privileges.</div> ## Signature ```> is-admin {flags} ``` ## Input/output types: | input | output | | ------- | ------ | | nothing | bool | ## Examples Return 'iamroot' if nushell is running with admin/root privileges, and 'iamnotroot' if not. ```nu > if (is-admin) { "iamroot" } else { "iamnotroot" } iamnotroot ```