命令行大全

pico

瑞兹 发表于 2020-11-09 09:09浏览次数:

在类似Unix的操作系统上,pico是一种简单的文本编辑器,具有pine电子邮件编写器的风格。

查看英文版

目录:

1 pico 运行系统环境

2 pico 描述

3 pico 语法

4 pico 例子

pico 运行系统环境

Linux

pico 描述

Pico(在现代Linux系统上以nano形式提供)是一个简单的,面向显示的文本编辑器。命令及其控制键快捷方式显示在屏幕底部。由于字符被键入他们立即插入文本。

使用控制键快捷方式输入编辑命令。作为吞下某些控制字符的通信程序的一种解决方法,您可以通过按两次Escape键,然后按所需的控制字符来模拟控制键。例如,“ Esc Esc c ”等同于输入ctrl-c。该编辑器具有五个基本功能:段落对齐,搜索,块剪切/粘贴,拼写检查器和文件浏览器。

在包含游标的段落中进行段落对正(或填充),或者如果游标在行之间,则在紧接其后的段落中进行。段落由空白行或以空格或制表符开头的行定界。对齐后可以使用Ctrl + U组合键立即进行不对齐。

字符串搜索对大小写不敏感。搜索从当前光标位置开始,并环绕在文本的结尾。在后续搜索中,默认提供最新的搜索字符串。

创造性地使用标记(ctrl- ^),删除(ctrl-k)和取消删除(ctrl-u)命令,可以移动,复制或删除文本块。delete命令将删除“标记”和当前光标位置之间的文本,并将其放置在“剪切”缓冲区中。undelete命令在当前光标位置产生“粘贴”。

拼写检查器检查文本中的所有单词。然后,它会在文本中突出显示每个拼写错误的单词以进行更正。拼写检查可以随时取消。或者,pico将用SPELL 环境变量定义的例程代替默认的拼写检查例程。替换例程应读取标准输入并写入标准输出。

文件浏览器是“读取文件”和“写出”命令提示符中的一个选项。它旨在帮助搜索特定文件和导航目录层次结构。呈现具有当前工作目录中大小和目录名称的文件名供选择。当前工作目录显示在显示屏的第一行,而可用命令列表占据底部的两个。支持几种基本的文件操作功能:文件重命名,复制和删除。

Pico (available on modern Linux systems as nano) is a simple, display-oriented text editor. Commands and their Control key shortcuts are displayed at the bottom of the screen. As characters are typed they are immediately inserted into the text.

Editing commands are entered using Control key shortcuts. As a workaround for communications programs that swallow certain control characters, you can emulate a control key by pressing Escape twice, followed by the desired control character. For example, "Esc Esc c" would be equivalent to entering a ctrl-c. The editor has five basic features: paragraph justification, searching, block cut/paste, a spelling checker, and a file browser.

Paragraph justification (or filling) takes place in the paragraph that contains the cursor, or, if the cursor is between lines, in the paragraph immediately below. Paragraphs are delimited by blank lines, or by lines beginning with a space or tab. Unjustification can be done immediately after justification using the control-U key combination.

String searches are not sensitive to case. A search begins at the current cursor position and wraps around the end of the text. The most recent search string is offered as the default in subsequent searches.

Blocks of text can be moved, copied or deleted with creative use of the command for mark (ctrl-^), delete (ctrl-k) and undelete (ctrl-u). The delete command will remove text between the "mark" and the current cursor position, and place it in the "cut" buffer. The undelete command effects a "paste" at the current cursor position.

The spell checker examines all words in the text. It then offers each misspelled word for correction while highlighting it in the text. Spell checking can be cancelled at any time. Alternatively, pico will substitute for the default spell checking routine a routine defined by the SPELL environment variable. The replacement routine should read standard input and write standard output.

The file browser is offered as an option in the "Read File" and "Write Out" command prompts. It is intended to help in searching for specific files and navigating directory hierarchies. File names with sizes and names of directories in the current working directory are presented for selection. The current working directory is displayed on the top line of the display while the list of available commands takes up the bottom two. Several basic file manipulation functions are supported: file renaming, copying, and deletion.

查看英文版

查看中文版

pico 语法

pico [ options ] [ file ]
选件
n 使pico以位于文件中n行的光标开始。(注意:“ + ”符号和数字之间不能有空格)
-a 显示所有文件,包括以句点(.)开头的文件。
-b 启用“替换文本匹配项”选项,该选项使用“哪里”命令找到。
-d 重新绑定“删除”键,使光标所在的字符(而不是其左侧的字符)被擦除。
-e 启用文件名完成。
-f 将功能键用于命令。仅与UW增强型NCSA telnet一起支持此选项。
-h 列出有效的命令行选项。
-j 在文件浏览器中启用“转到”命令。这使命令可以明确告诉飞行员要访问哪个目录。
-g 在文件浏览器中启用“显示光标”模式。使光标位于当前选择之前,而不是位于显示屏的左下方。
-k 使“剪切文本”命令从光标位置到行尾删除字符,而不是删除整行。
-m 启用鼠标功能。仅当从X Window System xterm窗口中运行pico时,这才起作用。
-n n -n ñ选项启用新邮件通知。该ñ参数是可选的,并且指定多久,在几秒钟内,您的邮箱中检查新邮件。例如,-n 60使pico每分钟检查一次新邮件。默认间隔为180秒,允许的最小间隔为30。(注意:“ n ”和数字之间没有空格)
-o dir 设置操作目录。仅可访问此目录中的文件。同样,文件浏览器仅限于指定的目录子树。
-r n 设置用于限制“ Justify”命令的右边距的列。
-s speller 指定拼写检查时要使用的备用程序拼写。
-t 启用“工具”模式。适用于在其他工具中将pico用作编辑器时使用。pico不会在退出时提示保存,也不会在“写出”命令期间重命名缓冲区。
-v 仅查看文件,不允许进行任何编辑。
-version 打印pico版本并退出。
-w 禁用自动换行(从而允许编辑长行)。
-X 在屏幕底部禁用键盘菜单。
-z 启用pico^ Z暂停。
-p 保留“开始”和“停止”字符,通常为Ctrl-QCtrl-S,它们有时在通信路径中使用,以控制以不同速度运行的设备之间的数据流。
-Q quotestr 设置引号字符串。撰写电子邮件时特别有用,设置此项可在对段落进行对齐时检查引号字符串。常见的引号字符串是“ > ”。
-q 输入转义序列的Termcap或terminfo定义优先于默认定义的序列使用。仅当在TERMCAP_WINS定义打开的情况下编译pico时,此选项才可用。
-setlocale_ctype 如果可用,请执行setlocale(LC_CTYPE)。默认为不执行此操作。
-no_setlocale_collate 不要执行setlocale(LC_COLLATE)。默认是这样做。

当正在运行的 pico 断开连接(即,收到SIGHUP信号)时,如果需要,pico 将在退出前保存当前工作。工作以当前文件名保存,并附加“ .save ”。如果当前作品未命名,则将其保存在文件名“ pico.save ”下。

pico [ options ] [ file ]

Options

+n Causes pico to be started with the cursor located n lines into the file. (Note: no space between "+" sign and number)
-a Display all files including those beginning with a period (.).
-b Enable the option to Replace text matches found using the "Where is" command.
-d Rebind the "delete" key so the character the cursor is on is rubbed out rather than the character to its left.
-e Enable file name completion.
-f Use function keys for commands. This option supported only in conjunction with UW Enhanced NCSA telnet.
-h List valid command line options.
-j Enable "Goto" command in the file browser. This enables the command to permit explicitly telling pilot which directory to visit.
-g Enable "Show Cursor" mode in file browser. Cause cursor to be positioned before the current selection rather than placed at the lower left of the display.
-k Causes "Cut Text" command to remove characters from the cursor position to the end of the line rather than remove the entire line.
-m Enable mouse functionality. This only works when pico is run from within an X Window System xterm window.
-nn The -nn option enables new mail notification. The n argument is optional, and specifies how often, in seconds, your mailbox is checked for new mail. For example, -n60 causes pico to check for new mail once every minute. The default interval is 180 seconds, while the minimum allowed is 30. (Note: no space between "n" and the number)
-o dir Sets operating directory. Only files within this directory are accessible. Likewise, the file browser is limited to the specified directory subtree.
-rn Sets column used to limit the "Justify" command's right margin.
-s speller Specify an alternate program spell to use when spell checking.
-t Enable "tool" mode. Intended for when pico is used as the editor within other tools. pico will not prompt for save on exit, and will not rename the buffer during the "Write Out" command.
-v View the file only, disallowing any editing.
-version Print pico version and exit.
-w Disable word wrap (thus allow editing of long lines).
-x Disable keymenu at the bottom of the screen.
-z Enable ^Z suspension of pico.
-p Preserve the "start" and "stop" characters, typically Ctrl-Q and Ctrl-S, which are sometimes used in communications paths to control data flow between devices that operate at different speeds.
-Q quotestr Set the quote string. Especially useful when composing email, setting this allows the quote string to be checked for when justifying paragraphs. A common quote string is "> ".
-q Termcap or terminfo definition for input escape sequences are used in preference to sequences defined by default. This option is only available if pico was compiled with the TERMCAP_WINS define turned on.
-setlocale_ctype Do setlocale(LC_CTYPE) if available. Default is to not do this.
-no_setlocale_collate Do not do setlocale(LC_COLLATE). Default is to do this.

When a running pico is disconnected (i.e., receives a SIGHUP signal), pico will save the current work if needed before exiting. Work is saved under the current file name with ".save" appended. If the current work is unnamed, it is saved under the file name "pico.save".

查看英文版

查看中文版

pico 例子

pico myfile.txt

启动pico编辑器,并打开文件myfile.txt进行编辑。

pico myfile.txt

Launches the pico editor, and opens the file myfile.txt for editing.

查看英文版

查看中文版