mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-22 00:42:08 +02:00
compgen, eval, export, file: move to common (#6508)
This commit is contained in:
parent
efeee14594
commit
ac46610ce6
13 changed files with 2 additions and 78 deletions
|
@ -1,7 +1,7 @@
|
|||
# compgen
|
||||
|
||||
> 用于在 bash 中自动完成的内置命令,按两次 tab 键即可调用该命令。
|
||||
> 更多信息:<https://www.cyberciti.biz/open-source/command-line-hacks/compgen-linux-command/>.
|
||||
> 更多信息:<https://www.gnu.org/software/bash/manual/bash.html#index-compgen>.
|
||||
|
||||
- 显示所有可以执行的命令:
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
# export
|
||||
|
||||
> 命令为当前 shell 中的子进程进行环境变量设置。
|
||||
> 更多信息:<https://ss64.com/osx/export.html>.
|
||||
> 更多信息:<https://www.gnu.org/software/bash/manual/bash.html#index-export>.
|
||||
|
||||
- 设置为新的环境变量:
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
# compgen
|
||||
|
||||
> A built-in command for auto-completion in Bash, which is called on pressing TAB key twice.
|
||||
> More information: <https://www.cyberciti.biz/open-source/command-line-hacks/compgen-linux-command/>.
|
||||
|
||||
- List all commands that you could run:
|
||||
|
||||
`compgen -c`
|
||||
|
||||
- List all aliases:
|
||||
|
||||
`compgen -a`
|
||||
|
||||
- List all functions that you could run:
|
||||
|
||||
`compgen -A function`
|
||||
|
||||
- Show shell reserved keywords:
|
||||
|
||||
`compgen -k`
|
||||
|
||||
- See all available commands/aliases starting with 'ls':
|
||||
|
||||
`compgen -ac {{ls}}`
|
|
@ -1,12 +0,0 @@
|
|||
# eval
|
||||
|
||||
> Execute arguments as a single command in the current shell and return its result.
|
||||
> More information: <https://ss64.com/osx/eval.html>.
|
||||
|
||||
- Call `echo` with the "foo" argument:
|
||||
|
||||
`eval "{{echo foo}}"`
|
||||
|
||||
- Set a variable in the current shell:
|
||||
|
||||
`eval "{{foo=bar}}"`
|
|
@ -1,16 +0,0 @@
|
|||
# export
|
||||
|
||||
> Command to mark shell variables in the current environment to be exported with any newly forked child processes.
|
||||
> More information: <https://ss64.com/osx/export.html>.
|
||||
|
||||
- Set a new environment variable:
|
||||
|
||||
`export {{VARIABLE}}={{value}}`
|
||||
|
||||
- Remove an environment variable:
|
||||
|
||||
`export -n {{VARIABLE}}`
|
||||
|
||||
- Append something to the PATH variable:
|
||||
|
||||
`export PATH=$PATH:{{path/to/append}}`
|
|
@ -1,24 +0,0 @@
|
|||
# file
|
||||
|
||||
> Determine file type.
|
||||
> More information: <https://github.com/file/file>.
|
||||
|
||||
- Give a description of the type of the specified file. Works fine for files with no file extension:
|
||||
|
||||
`file {{filename}}`
|
||||
|
||||
- Look inside a zipped file and determine the file type(s) inside:
|
||||
|
||||
`file -z {{foo.zip}}`
|
||||
|
||||
- Allow file to work with special or device files:
|
||||
|
||||
`file -s {{filename}}`
|
||||
|
||||
- Don't stop at first file type match; keep going until the end of the file:
|
||||
|
||||
`file -k {{filename}}`
|
||||
|
||||
- Determine the mime encoding type of a file:
|
||||
|
||||
`file -I {{filename}}`
|
Loading…
Add table
Reference in a new issue