Linux command
nushell 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Start the shell
nu
Run a command string and exit
nu -c "[command]"
Run a script file
nu [path/to/script.nu]
Start as a login shell
nu --login
Start without loading config files
nu -n
List files as structured data
ls | where size > 1mb | sort-by modified
Convert JSON to a table
open [data.json] | select name age | sort-by age
说明
nushell (command: nu) is a modern shell that treats data as structured information rather than plain text. It brings spreadsheet-like data manipulation to the command line with built-in support for JSON, CSV, YAML, SQLite, Excel, and more. Nu pipelines use structured data so you can safely select, filter, and sort the same way every time. It draws inspiration from PowerShell, functional programming languages, and modern CLI tools. It is cross-platform with first-class support for Windows, macOS, and Linux.
参数
- -c, --commands _COMMAND_
- Execute a command string and exit.
- --config _FILE_
- Specify a configuration file (config.nu).
- --env-config _FILE_
- Specify an environment configuration file (env.nu).
- -n, --no-config-file
- Start without loading config files.
- --login, -l
- Start as a login shell.
- --stdin
- Redirect stdin for scripts.
- --table-mode _MODE_
- Table display mode (rounded, basic, compact, etc.).
FAQ
What is the nushell command used for?
nushell (command: nu) is a modern shell that treats data as structured information rather than plain text. It brings spreadsheet-like data manipulation to the command line with built-in support for JSON, CSV, YAML, SQLite, Excel, and more. Nu pipelines use structured data so you can safely select, filter, and sort the same way every time. It draws inspiration from PowerShell, functional programming languages, and modern CLI tools. It is cross-platform with first-class support for Windows, macOS, and Linux.
How do I run a basic nushell example?
Run `nu` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -c, --commands _COMMAND_ do in nushell?
Execute a command string and exit.