歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux服務器 >> 就是一行命令10秒鐘架設一個blog站點

就是一行命令10秒鐘架設一個blog站點

日期:2017/3/2 16:42:57   编辑:Linux服務器

在Ubuntu Linux下,你在命令終端下輸入:nb,回車,系統會提示你:

The program 'nb' is currently not installed. You can install it by typing:
sudo apt-get install nanoblogger
bash: nb: command not found(意思是nb程序未安裝,你可以通過輸入命令sudo apt-get install nanoblogger安裝它)
那就輸入命令:
sudo apt-get install nanoblogger

沒過一會,就十幾秒的時間(nb程序體積很小,僅80多k),nb程序自動下載並安裝了。然後我們再看看使用方法:
nb --help

輸出幫助信息為:

NanoBlogger - Console weblog engine.
Version 3.3, by Kevin Wood <[email protected]>

Usage:
nb [-b blog_dir] [options]

Options:
-a, --add create new entry, category, or weblog
(directory).
-b, --blogdir <directory> specify weblog directory.
-B, --body <text> deprecated, please use '-T' or '--text'
instead.
-c, --category <ID,cat> specify category (for '--add',
'--delete', '--edit', '--list',
'--update', and '--update-cache').
--cfgfile <file> specify an alternate configuration file.
--configure configure weblog (for '--update').
--datadir <directory> specify weblog's data directory.
-d, --delete <ID,cat> delete an entry or category.
-D, --desc <text> set text of description (for '--add',
'--draft', '--makefile' and
'--makepage').
-e, --edit <ID,cat> edit an entry or category.
-E, --draft <file> edit or create metafile.
-f, --file <file> specify metafile to import as entry
(for '--add').
-h, --help show this help message.
-i, --interactive <1=on/0=off> toggle interactive mode (for '--add',
'--delete', '--preview', '--publish',
and '--update').
-l, --list <all,cat,DATE,max> list entries or categories (defaults to
max).
--manual view the manual.
-m, --move <ID> move an entry to a specified
category (for '--category').
-M, --makepage <file1> <file2> create new weblog page (file2) from
metafile (file1).
--makefile <file> create new metafile.
-n, --author <text> set text of author (for '--add',
'--draft', '--makefile' and
'--makepage').
--plugindir <directory> specify weblog's plugin directory.
-p, --preview run command to preview weblog.
-P, --publish run command to publish weblog.
-q, --query <DATE> specify a query to run (for '--edit' and
'--delete').
--template <file> specify file to load as template (for
'--draft', '--makepage' and
'--makefile').
--template-dir <directory> specify weblog's template directory.
-t, --title <text> set text of title (for '--add',
'--category', '--draft',
'--makefile' and '--makepage').
--tag <TAG> specify tag (for '--add', '--draft',
'--edit', '--makefile' and
'--makepage').
--tag-text <text> set text of tag (for '--tag').
-T, --text <text> set text of body (for '--add',
'--draft', '--makefile' and
'--makepage').
-U, --update-cache <all,DATE,max,expired>
force update of weblog's cache removing
specified cached data (defaults to
'expired').
-u, --update <all,DATE,main,max> force update of weblog's files updating
specified weblog data (defaults to
'max').
-v, --verbose <1=on/0=off> toggle level of verbosity.
-V, --version display version information.

-c,-d,-e,-m accepts multiple ID numbers seperated by commas (e.g. 1,2,3).

--list and --update can match entries by date (irrelevant of entry id(s)).
date = YYYY-MM-DD, YYYY-MM, YYYY

Examples:

specify the weblog directory to create or add new entry
nb -b ~/public_html/weblog -a

create new category and title it "News"
nb -b ~/public_html/weblog -t "News" -c new -a

create new entry using nothing but command line options!
nb -b ~/public_html/weblog -n 'myname' -t 'Title' -T 'Text!' -a

More info:
URL: http://nanoblogger.sourceforge.net


哦,提示不少可用命令操作。先建立一個博客吧,在本地服務器的blog目錄下建立一個blog(可以多用戶哦),命令是:
nb -b /var/www/blog/ -a
然後就可以通過浏覽器訪問咯:

就是一行命令10秒鐘架設一個blog站點!

至於怎麼寫blog,可以通過命令行直接寫,也可以用任意編輯器撰寫好再導入,那都不是難題。
這個NanoBlogger對空間需求不高,不需要任何數據庫,純靜態HTML空間就可以了。功能還是很全面的,還有插件支持哦。博客升級就更簡單了,博客可以直接在系統更新時升級。

現在你知道什麼是nb了吧?

Copyright © Linux教程網 All Rights Reserved