To create a new note, simply run "note". You can enter
the note (the length is by default limited to 4096 bytes,
which you can change from your config file if you are using
the binary backend, therwise there is no limitation).
End by typing a . on a line itself. note will tell you the
number of the note.
If you want to view the note, type "note 1", if the notenumber
was 1.
If you want to get an overview of all notes, type "note -l".
You will get a list of all notes, containing the number,
the first line and the creation date. If topic-support is
turned on (which is by default), then all subtopics under the
current topic will be displayed first.
To edit a certain note, type "note -e 1". It will invoke your
editor (vi or pico). You can edit it, after saving, note
will store the changed note to the database.
Of course you can drop a certain note: "note -d 1" deletes
note number 1. If a note in the middle or the beginning of
the database will be deleted, note will recount the other
existent notes. For example there are 3 notes, number 1, 2
and 3. If you delete number 2, then number 3 will become
number 2.
If you cannot remember, which note you are looking for, you
can use the search capability of note: "note -s
Instead of using note from the commandline you can use the
interactive mode. Run note with "note -i". If you need assistance
type "?" or "h" at the ">" prompt. The interactive mode
provides you the most functions of note.
You can also dump the contents of your note-database into a
ASCII-textfile(-D). You can use this file later to import it into
your note-database(-I). This is usefull, if you want quickly trans-
fer your notes from one host to another (i.e. you could mail
your note-dump form your office to home and import it there
for further use).
If you are in interactive mode, you can "cd" to a different note simply
by typing it's name at the command-prompt, or you can use the well-known
syntax "cd topic".
You can create at any time from any point a new topic. Just create a new
note and type the name of the new topic bordered by slashes (or TopicSeparator)
at the first line of this note. After saving, there will be available a
new topic with one note in it.
You can create as many subtopics as you like, the format is similar to a
filesystem-path. An example, say, you want to create such a structure:
Then you may create those 4 new notes:
If a note does not contain the "magic" /topic/ construction on the first
line, it will be listed under the "root" of note, that is the point you are
at the startup of note.
You can subsequently move a note without a topic to a certain topic. Simply
edit it and insert at the first line the above mentioned construction.
Note: Please don't forget the prepending and appending a slash of a topic.
You will get strange results without it!
The following colors are available:
black, red, green, yellow, blue, magenta, cyan and white.
Beside colorizing text, you can also create bold or underlined text! If you decide
to use this (additional) feature, you need to set the Config-Option "FormatNotes"
to 1 which turns it on.
Here are the possibilies you have:
You can add a new note through a pipe, another commands output becomes
note's input:
Suppose you are using encryption. You might wonder, how note will get your
passphrase? The solution: You need to set up an environment variable which
contains the password:
Another thingy you might find useful is the -r (--raw) command-line flag. This
turns note into raw mode , which means it will only print the
data without any formatting. Raw mode is available for list and display,
since it makes no sense, interactive mode doe not support raw mode.
Decription
If you don't know, how to run note, try "note -h" first.
It will tell you all available commandline options.
If you want to get a listing of all
If you want to see the timestamps, use "-L" instead of "-l".
Read more about topics below in the section "Topics".
You can also specify the topic which notes you want to see:
"-l mytopic" does the trick.
Additional, you might want to get an overview of your topic-
strcture. You can use the command "-t" in this case, which
will display a tree-view of your tpic-structure. You can
use the command "-T" if you want to see the notes under each
topic too. "-T" will also show the number of each note.
You can also make use of the extended delete-syntax:
To delete note 1 and 2, use "-d 1,2"
To delete note 1,2 and 3, use "-d 1-3".
The dumps from the two versions of note are in the same format.
Using dumps it is also possible to reinitialize your database. You
can use the "-o" switch whcih causes note to overwrite your existing
database. This is very handy if you changed heavily your config. And
it is required, if you changed: encryption, db-driver, (binary-format)
and the password. You can use the following command for reinitializing:
$ note -D - | note -o -I -
What the hell, does it?! Step by step:
Before you use the "-o" switch, I consider yuo to make a backup!
Topics
If topic-support is turned on (which is by default), the various
notes are sorted under various topics. There is no special database
field for the topic. Instead the topic will be stored right in the
note.
If the first line of your note contains some text bordered by slashes
(or whatever you prefer, set "TopicSeparator" in your config! default is slash),
then note will consider it as the topic of this certain note. For examle:
/TodoList/
If you are using topics, no data after the topic is allowed, if there
is any text, note will consider it as a subtopic! Therefore, don't for-
get to put a newline after the topic-line.
The list-command will only show you notes under this topic. If you create
a new note, it will automagically inserted under the current topic (note
will prepend the string "/topicname/" to the text of your note).
(root - top level)
|
|----test
| |----subtopic
| | |--note 1
| | |--note 2
| |
| |--note 4
|
|--note 3
--- snip ---
/test/subtopic/
note 1
--- snip ---
/test/subtopic/
note 2
--- snip ---
note 3
--- snip ---
/test/
note 4
--- snip ---
I hope, you got the point ;-)
Formatting of notes
Another very nice feature is the possibility to format the note-text (as much as
shell allows it). First, you can use the note-internal "magic-strings" for color-
izing. Those strings looks much like HTML:
i
"
Usage is very straightforward, if a word (a word is defined as some text with at least
one space surrounded) is between a magic mark-character. Here are the available
things, you can do:
bold: **word**
underlined: __word__
inverse: {{word}}
The text will be formatted using the actually note-color.
Scripting
Since version 1.0.3 there are some additions which allows you to use note in
scripts, without user-interaction. You might run a special script as cronjob,
which adds a note under a certain topic every week. Or the like.
$ cat /var/spool/news/daily | note -
This command adds the content of a file "daily" as a new note. Note the dash.
it stands for "Standard Input". Note will be completely silent and it will not
ask for something.
$ export NOTE_PASSWD=secret
If the variable is present, note will not ask you for a passphrase!
Format of the notedb (binary backend)
The database where the notes are stored is a binary fixed record length file
of the following format:
It consists of three fixed length fields per entry. The fields
have the following types:
You can change the sizes of the fields "Note" and "Time" in
the configfile "~/.noterc". If it does not exist, the above
defaults will be used.
If the data to be stored is smaller then the size of the field,
it will be filled with ZERO's ("\0"). The Note and the Time
fields will be uuencoded before storage. Of course, this is
no security, never mind...
The note-database (mysql backend)
The sql-database for the mysql version has the following design:
+--------+---------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------+---------+------+-----+---------+----------------+
| number | int(10) | | PRI | 0 | auto_increment |
| note | text | YES | | NULL | |
| date | text | YES | | NULL | |
+--------+---------+------+-----+---------+----------------+