This is a simple function that can be called from the command line, just like if it was a regular command. It is a quick way of taking notes and storing them in a text file.
Just add the following lines to your ~/.bashrc
:
# My function to take quick notes on useful commands
notes() {
echo $1 >> $HOME/notes.md
}
It can be used like this:
$ notes "my_command -which -I -want -to remember"
You can read your notes like this:
$ more ~/notes.md
Oldest comments (28)
This would definitely come in handy!
Nice idea! Something a bit more elaborate (just for fun):
With this function we can use the heredoc syntax to write multi-line notes:
You also don't need to quote your notes anymore:
Good call.
Excellent Jonathan! Really nice addition.
You mean stdin here, right?
Yea, sorry I guess I was thinking from a different perspective.
Hi Jonathan, I just tried your code and I was suprised to find that when I call the
notes
command without parameters, it doesn't show the content of thenotes.md
file. Instead it expects me to introduce the note content itself, and it doesn't write it to file till I do Ctrl + C. Hmm... I'll find out how to fix this.That looks like it's the intended behaviour to make it easy to write multi-line notes. If you'd rather have it just show the notes, then change the second branch of the
if
statement to justcat "$HOME/notes.md
.You are absolutely right Michael. I misread the comment and thought that, in absence of paramenters, the expected behavior was to display the file content. My apologies for the mistake Jonathan.
a plain text note file is the very best idea you can ever have. Just looked it up, i started mine april 2006, so with more than 10 yrs in it now. Think about it, that was a time when lots of URL web based note taking services where all en vouge, all the craze. Most of them long gone. My plain text notes still there. But while we're talking, as i'm working from the command line, i prefer jotting my notes directly from inside vim. It's easy to have it open in a screen pane on its own all the time. Editing features, especially multi-line, are much more robust when working from vim. I also had this notes alias once, but found i hardly any improvments in convenience. What i'm working on though is sharing the notes txt file to smartphone mobile view, for distributed view/edits and to build a browser plugin so i can append urls and comments directly from chrome. But that is a story for another time,
Thanks for sharing. Just started taking my notes through this simple command. Pretty helpful
Simple & beautiful, even more so with your additions, Jonathan.
However my single notes file was growing bigger and bigger. One day I had to split it into topic-based files. And I wanted to share the notes between multiple devices. Meanwhile I got rid of my files in favour of Google Notes with one note for each topic. But of course I miss the shell interface.
One of my colleagues has also taken a web based approach for his notes including a workflow from Evernote to Trello, thus migrating notes into tasks. I am tempted to do the same, but with Asana as the destination for my notes. If only I could re-establish the console as the starting point once again...?
This project does essentially this: github.com/alphapapa/bucket/
@ricardomol this is a great idea thanks for sharing
@alphapapa just trying it out and it looks great
And here a version with timestamps (setup for vimwiki):
Awesome, @konstantin Stadler!
Believe me or not, I was about to make the same suggestion you did!
\o
@Ricardo Molina,
Pretty useful idea. Thanks a lot!
Awesome work - clean and simple. I had the same idea a while back, and I made a massive, over-complicated bash script which handles multiple file categories, searching and sorting, as well as adding, editing, and removing lines or strings. More of a make-work hobby project but it was fun to make.
Feel free to check it out github.com/p-mcgowan/cmdPlanner and suggestions are always welcome.
Nice! I created a similar thing for PowerShell just a while back.
``
And in Windoze Cmd its..
copy con mynotes.txt
with Shift + F6 to exit. :)Wow nice!, this is so useful.
You could also make this into a time journal to note how you feel on certain time, it's the same thing.
I've created the system only for me since I don't to deal with auth and stuff. It has two versions, one on the web and the other one on terminal running on NodeJS. I use Firebase as my database.
I love this - and ran away with it a bit - here is a version that also allows editing in vim and making the notes distributable with git. Also lets you serve a pretty version with grip if you have it.
that's how i did it:
in .bash_aliases
to add an entry
how() { echo "$@" | tee -a ~/Dropbox/howto.txt; }
to display the notes taken
alias howto='more ~/Dropbox/howto.txt'