Jrnl：你的 Linux 终端数字日记
日记 终端
![](/data/attachment/album/202201/30/234157xxoo76bdxb7xxbgl.jpg)


想象一下：有人伤了你的心，而你想要的是心无旁骛地在日记中写下你的感受。你明白这种感受吗？没有吗？我也不知道。我没有心碎过（或者也许我心碎了，但我不想告诉你）。


但我还是想向你展示一个奇妙的极简的开源的记事应用来保存日记。


这个方便的小程序是 [Jrnl](https://jrnl.sh/en/stable/)，它可以让你在终端中直接创建、搜索和查看日记条目。


用 Jrnl 创建新的笔记就像下面一样简单：



```
jrnl yesterday: I read an amazing article on It’s FOSS. I learn about a minimalist app called Jrnl, I should try it.

```

看起来很简单，不是吗？关键字 “yesterday” 在这里是一个触发器，它把你的笔记保存到昨天的日期。记住，它被称为 Jrnl（日记）是有原因的。它的主要目的是保存日记。


如果你喜欢把你的想法写成日记，或者只是想尝试一下，让我分享一下安装和使用的一些细节。


### 在你的 Linux 系统上安装和使用 Jnrl


Jrnl 可以用 pipx 或 Homebrew 包管理器安装。


我在测试中使用了 Homebrew，所以我将列出这些步骤。首先获取 Homebrew：



```
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

```

![Installing Homebrew on your system](/data/attachment/album/202201/30/234216zrvnsgkkwnaxswgb.png)


这就好了！如果你需要更多的信息，我们有一个关于 [在 Linux 上安装 Homebrew](https://itsfoss.com/homebrew-linux/) 的详细教程。


当你安装了 Homebrew 包管理器后，用它来安装 Jrnl：



```
brew install jrnl

```

![Installing Jrnl with Homebrew](/data/attachment/album/202201/30/234217f2kjnbpp9o9bxboz.png)


安装后，只要初始化 jrnl 并开始写你的随机想法。


你还记得本文开头的第一个例子吗？让我们再来看看它吧！



```
jrnl yesterday: I read an amazing article in It’s FOSS. I learn about a minimalist app called Jrnl, I should try it.

```

![Writing an entry](/data/attachment/album/202201/30/234217i7j9ie6z95a5ki7h.png)


在这一行中，我用命令 `jrnl` 在一个时间戳旁启动程序，在这个例子中是 `yesterday`。我写了一个冒号 `:`，表示我将开始写一些东西，在第一个句子标记 `.?!:`（在这里是句号 `.`）之前包含的所有内容将是标题。最后，这个句号旁边的所有内容将被视为文件的主体。


目前，Jnrl 有两种模式：撰写和查看；前面的步骤用于撰写条目，但如果你想查看，例如，之前写过的条目，语法也很简单，你只需输入下一行。



```
jrnl -on yesterday

```

![Viewing an entry](/data/attachment/album/202201/30/234217f4g5949ukn1dumt5.png)


认为有人可能会阅读你的日记和想法？你也可以对你的条目进行加密。


这就好了！ 当然，Jrnl 还有很多功能，你可以通过下面这行轻松找到：



```
jrnl --help

```

你也可以参考 [其官方网站](https://jrnl.sh/en/stable/overview/) 上的文档。记住，在这样的一个开源项目中，文档是你最好的朋友。享受它吧！


### 总结


当然，Jrnl 并不适合所有人。大多数命令行工具都不适合。但如果你在终端中生活和呼吸，并喜欢记录你的想法，它就适合你。


请不要忘记在评论中与我们分享你的个人经验，或者更好的是，如果你想让更多的人了解这个项目，你可以在各个社区和论坛上分享这个帖子。




---


via: <https://itsfoss.com/jrnl/>


作者：[Marco Carmona](https://itsfoss.com/author/marco/) 选题：[lujun9972](https://github.com/lujun9972) 译者：[geekpi](https://github.com/geekpi) 校对：[wxy](https://github.com/wxy)


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


OK
Imagine this: somebody has broken your heart and what you want is to write your feelings in a journal without distraction. Did you get the idea? No? Neither do I. I am not heartbroken (or maybe I am and I don’t want to tell you).

But I would still like to show you a wonderful minimalistic open-source, note-taking application to keep journal entries.

This handy little program is [Jrnl](https://jrnl.sh/en/stable/) and it lets you create, search and view journal entries right in the terminal.

Creating new notes with Jrnl is as simple as writing this:

`jrnl yesterday: I read an amazing article on It’s FOSS. I learn about a minimalist app called Jrnl, I should try it.`


Looks easy, isn’t it? The keyword yesterday is a trigger here and it saves your note to yesterday’s date. Remember that it’s called Jrnl (journal) for a reason. Its main aim is to keep journal.

If you like to keep a diary of your thoughts or simply want to try it out, let me share a few details on the installation and its usage.

## Installing and using Jnrl on your Linux system

Jrnl can be installed using pipx or Homebrew package managers.

I used Homebrew for my testing so I’ll list those steps. Get Homebrew first:

`/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"`


![installing brew](https://itsfoss.com/content/images/wordpress/2021/11/Installing_brew-800x131.png)

That’s all! If you need more information, we have a detailed tutorial on [installing Homebrew on Linux](https://itsfoss.com/homebrew-linux/).

Once you have Homebrew package manager installed, use it to install Jrnl:

`brew install jrnl`


![installing jrnl](https://itsfoss.com/content/images/wordpress/2021/11/installing_jrnl-800x490.png)

Once you have it installed, just initialize jrnl and start writing your random thoughts.

Do you remember the first example at the beginning of this article? Let’s take a look at it again!

`jrnl yesterday: I read an amazing article in It’s FOSS. I learn about a minimalist app called Jrnl, I should try it.`


![writing an entry](https://itsfoss.com/content/images/wordpress/2021/11/Writing_an_entry-800x211.png)

In this line, I’m starting the program with the command `jrnl`

next to a timestamp, which in this case is `yesterday`

. I write a colon `:`

to indicate that I will start writing something, and everything contained until a first sentence mark `.?!:`

(in this case a period `.`

) will be the title. Finally, everything next to this sentence mark will be considered the body of the file.

Currently, Jnrl has two modes: composing and viewing; the steps before are used to compose an entry but if what you want to view, for example, the entry that was written before, the syntax is also easy, what you only have to type is the next line.

`jrnl -on yesterday`


![viewing an entry](https://itsfoss.com/content/images/wordpress/2021/11/Viewing_an_entry-800x159.png)

Think that someone may read your journal and thoughts? You can also encrypt your entries.

That’s it! Of course, Jrnl has a lot more function, which can easily be found with the next line:

`jrnl --help`


You can also refer to the documentation on [its official website](https://jrnl.sh/en/stable/overview/). Remember, the documentation is your best friend in an open-source project like this one. Enjoy it!

## Conclusion

Of course, Jrnl is not for everyone. Most command line utilities are not. But if you live and breath in the terminal and like to record your thoughts

Please don’t forget to share with us your personal experience in the comments; or even better, if you want to get this project to many more people you can share this post in various communities and forum.