> For the complete documentation index, see [llms.txt](https://hexo.course.90byte.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hexo.course.90byte.com/mu-lu/index/2.-ji-ben-ming-ling.md).

# 1.2 基本命令

记住以下命令基本就足够应付日常Hexo的使用了。

* `hexo help` 获取帮助；
* `hexo init [folder]` 初始化Hexo项目目录，默认当前目录；
* `hexo new [layout] <title>` layout选填，默认使用 `_config.yml` 中的 default\_layout 参数代替；
* `hexo publish [layout] <filename>` 发表草稿；
* `hexo g` 生成静态页面；
  * `hexo g -d` 生成文章后立即部署；
* `hexo s` 启动hexo服务，在本地可以通过`http://localhost:4000`来访问页面；
  * `hexo s -p 3000` 修改端口号为3000；
  * `hexo s -g` 启动本地服务前，先执行`hexo g`;
* `hexo d` 部署hexo，前提是你已经配置了部署环境，通常是使用Git部署至Github或者Coding上；
  * `hexo d -g` 部署前，先执行`hexo g`;
* `hexo clean` 清空产生的静态网站，也就是删除项目中`public`文件夹，在调试页面的时候通常要用到，很多情况，修改了hexo配置文件，hexo服务并不能实时显示出来。建议部署到服务器上之前，都使用一下此命令；
* `hexo version` 查看环境以及版本；

掌握这些基本命令就足以应付日常使用了，更多功能请查看官方[Docs](https://hexo.io/zh-cn/docs/).
