4 个 Linux 下的命令行笔记程序
笔记

> 
> 这些工具可以让你在 Linux 命令行下简单而有效地记录笔记和保存信息。
> 
> 
> 


![](/data/attachment/album/201805/09/004244j526299tzvqz4lbq.jpg)


当你需要保存代码段或 URL、想法或引用时，可能会启动文本编辑器或使用[桌面](https://opensource.com/life/16/9/4-desktop-note-taking-applications)或[基于 Web 的](https://opensource.com/alternatives/evernote)笔记记录工具。但那些不是你唯一的选择。如果你在终端窗口中工作，则可以使用 Linux 命令行下的许多笔记记录工具之一。


我们来看看这四个程序。


### tnote


![](/data/attachment/album/201805/09/004244rzyqa3rpph6m326o.png)


[tnote](https://github.com/tasdikrahman/tnote) 使在终端窗口中记笔记很简单 —— 几乎太简单了。


tnote 是一个 Python 脚本。首次启动时，它会要求你输入密码和口令来加密存储笔记的 [SQLite 数据库](http://en.wikipedia.org/wiki/SQLite)。完成之后，按 `A` 创建一个笔记。输入你的笔记，然后按 `CTRL-D` 保存。


一旦你有几个（或多个）笔记，你可以查看它们或搜索特定的笔记，单词或短语或标签。tnote 没有很多功能，但它确实实现了任务。


### Terminal Velocity


![](/data/attachment/album/201805/09/004244f7au13uz2r2hhr5w.png)


如果你使用过 Mac OS，你可能会看到一个名为 [Notational Velocity](http://notational.net/) 的流行开源笔记程序，这是一种记录笔记的简单有效方法。[Terminal Velocity](https://vhp.github.io/terminal_velocity/) 在将 Notational Velocity 体验带入命令行方面做得很好。


Terminal Velocity 打开你的默认文本编辑器（由你的 `.profile` 或 `.bashrc` 文件中的 `$EDITOR` 变量设置）。输入你的笔记，然后保存。该笔记出现在 Terminal Velocity 窗口的列表中。


使用键盘上的箭头键滚动查看你的笔记列表。要查看或编辑笔记，请按回车键。如果你有一长串笔记，则可以在 `Find or Create` 字段中输入笔记标题的前几个字符以缩小列表的范围。在那里滚动笔记并按下回车键将其打开。


### pygmynote


![](/data/attachment/album/201805/09/004245e3h7xau6h66fhr7d.png)


在本文中的四个应用中，[pygmynote](https://github.com/dmpop/pygmynote) 可能是最不用户友好的。然而，它是最灵活的。


像 tnote 一样，pygmynote 将你的笔记和附件保存在 SQLite 数据库中。当你启动它时，pygmynote 看起来并不特别有用。在任何时候，输入 `help` 并按下回车键获取命令列表。


你可以添加、编辑、查看和搜索笔记，并在笔记中添加[标签](https://en.wikipedia.org/wiki/Tag_(metadata))。标签使找到笔记更容易，特别是如果你有很多笔记的时候。


pygmynote 的灵活性在于它能够将附件添加到笔记中。这些附件可以是任何东西：图像、文本、word、PDF、电子表格或与笔记相关的任何其他内容。


### jrnl


![](/data/attachment/album/201805/09/004246uqe33nzx4n7zoqz7.png)


[jrnl](http://jrnl.sh/) 是这里的一个奇怪应用。正如你可能从它的名字中猜到的那样，jrnl 意在成为一种日记工具。但这并不意味着你不能记笔记。 jrnl 做得很好。


当你第一次启动 jrnl 时，它会询问你想把文件 `journal.txt` （它存储你的笔记）保存的位置以及是否需要密码保护。如果你决定添加密码，那么你在应用内的操作都需要输入密码。


你可以通过两种方式输入笔记：直接从命令行或使用计算机的默认编辑器。你可以将标签（例如，`@opensource.com`）添加到笔记中，并指定日期和时间戳。如果你有很多笔记的话，添加标签和日期可以帮助搜索你的笔记（jrnl 有一个相当不错的搜索功能）。


由于 jrnl 将你的笔记保存为纯文本文件，因此你可以使用 [ownCloud](https://owncloud.com/)、[Nextcloud](https://nextcloud.com/) 或任何你喜欢的文件共享/同步服务在设备间同步它。


你有没有喜欢的工具或自制的命令行笔记工具？请发表评论，随时与社区分享。




---


via: <https://opensource.com/article/18/3/command-line-note-taking-applications>


作者：[Scott Nesbitt](https://opensource.com/users/scottnesbitt) 译者：[geekpi](https://github.com/geekpi) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
When you need to save a code snippet or a URL, an idea or a quote, you probably fire up a text editor or turn to a [desktop](https://opensource.com/life/16/9/4-desktop-note-taking-applications) or [web-based](https://opensource.com/alternatives/evernote) note-taking tool. But those aren't your only options. If you spend time working in terminal windows, you can use one of the many note-taking tools available for the Linux command line.

Let's take a look at four of those apps.

## tnote

![tnote tnote](https://opensource.com/sites/default/files/images/life-uploads/tnote.png)

[tnote](https://github.com/tasdikrahman/tnote) makes taking notes in a terminal window very simple—almost too simple.


tnote is a single Python script. When you start it for the first time, it asks you to enter a password and a passphrase to encrypt the [SQLite database](http://en.wikipedia.org/wiki/SQLite) that stores your notes. Once you've done that, press "A" to create a note. Type your note, then press CTRL-D to save it.

Once you have a few (or more than a few) notes, you can view them or search for specific ones, words or phrases, or tags. tnote doesn't pack a lot of features, but it does get the job done.

## Terminal Velocity

![terminal velocity terminal velocity](https://opensource.com/sites/default/files/images/life-uploads/terminal_velocity.png)

If you've used Mac OS, you might have come across a popular open source note-taking application called [Notational Velocity](http://notational.net/), a simple and effective way to take notes. [Terminal Velocity](https://vhp.github.io/terminal_velocity/) does a good job of bringing the Notational Velocity experience to the command line.

Terminal Velocity opens your default text editor (set by the `$EDITOR`

variable in your `.profile`

or `.bashrc`

file). Type your note, then save it. The note appears in the list in the Terminal Velocity window.

Use the arrow keys on your keyboard to scroll through your list of notes. To view or edit a note, press Enter. If you have a long list of notes, you can enter the first few characters of the note's title in the `Find or Create`

field to narrow down the list. From there, scroll to the note and press Enter to open it.

## pygmynote

![pygmynote pygmynote](https://opensource.com/sites/default/files/images/life-uploads/pygmynote.png)

Of the four applications in this article, [pygmynote](https://github.com/dmpop/pygmynote) is probably the least user-friendly. It is, however, the most flexible.

Like tnote, pygmynote saves your notes and attachments in an SQLite database. When you fire it up, pygmynote doesn’t look particularly useful. At any time, type `help`

and press Enter to get a list of commands.

You can add and edit notes, view and search for them, and add [tags](https://en.wikipedia.org/wiki/Tag_(metadata)) to your notes. Tags make finding notes easier, especially if you have a lot of them.

What gives pygmynote flexibility is its ability to add attachments to your notes. Those attachments can be anything: an image, a text or word processor file, a PDF, a spreadsheet, or anything else relevant to the note.

## jrnl

![jrnl screenshot jrnl screenshot](https://opensource.com/sites/default/files/images/life-uploads/jrnl.png)

[jrnl](http://jrnl.sh/) is the odd application out here. As you've probably guessed from its name, jrnl is intended to be a journaling tool. But that doesn't mean you can't take notes with it. jrnl does that job very well.

When you first start jrnl, it asks you where you want to put the file `journal.txt`

(which stores your notes), and if you want to password-protect the file. If you decide to add a password, you need to enter it whenever you do anything with the application.

You can enter notes in two ways: directly from the command line, or with your computer's default editor. You can add tags—for example,`@opensource.com`

—to your notes, and give them a date and timestamp. Adding tags and dates can help you search for your notes (jrnl has a pretty decent search feature) if you have a lot of them.

Since jrnl saves your notes in a plain text file, you can sync it across your devices using [ownCloud](https://owncloud.com/), [Nextcloud](https://nextcloud.com/), or whatever file sharing/syncing service your prefer.

Do you have a favorite tool or hack for taking notes at the command line? Feel free to share it with the community by leaving a comment.

## 4 Comments