丙午🐎年

acc8226 的博客

什么是 shell 脚本

shell 脚本其实就是为使用 shell 环境中的命令所编写的小型程序,可用于自动化那些通常没人愿意手动完成的任务,例如 Web 爬取、磁盘用量跟踪、天气数据下载、文件更名,等等。你甚至能够用 shell 脚本制作一些初级的游戏!脚本中可以加入简单的逻辑,例如在其他语言中出现的 if 语句,不过你很快就会看到,脚本的形式甚至可以更简单。

执行命令

bash 的核心功能是执行系统命令。来看一个简单的 “Hello World” 的例子。在 bash shell 中,echo 命令可以在屏幕上显示文本,例如:echo "Hello World"

如果有两个同名的命令分别位于 PATH 中两个不同的目录中,可能会由于目录出现的先后顺序产生不同的结果。如果在查找特定命令时碰到了麻烦,可以用 which 命令查看待查找命令在 PATH 中的位置‘

1
2
3
4
$ which ruby
/usr/bin/ruby
$ which echo
/bin/echo
阅读全文 »

什么是 PowerShell

PowerShell 是一种跨平台的任务自动化解决方案,由命令行 shell、脚本语言和配置管理框架组成。PowerShell 目前已经支持在 Windows、Linux 和 macOS 上运行。

mac 安装 PowerShell

PowerShell 7.3.4
x64 processors - powershell-7.3.4-osx-x64.pkg
https://github.com/PowerShell/PowerShell/releases/download/v7.3.4/powershell-7.3.4-osx-x64.pkg

M1 processors - powershell-7.3.4-osx-arm64.pkg
https://github.com/PowerShell/PowerShell/releases/download/v7.3.4/powershell-7.3.4-osx-arm64.pkg

示例

要确定当前目录位置的路径,请输入命令 Get-Location

阅读全文 »

前提知识

命令提示符介绍

命令提示符是在操作系统中,提示进行命令输入的一种工作提示符。在不同的操作系统环境下,命令提示符各不相同。在 windows 环境下,命令行程序为 cmd.exe,微软 Windows 系统基于 Windows 上的命令解释程序,类似于微软的 DOS 操作系统。

四种文件类别

  • cpl:全称:Control PaneL extension 控制面板扩展程序
  • msc:全称:MicoSoft management Console 微软管理控制台
  • exe:全称:executable 可执行程序
  • vbs:全称:Visual Basic script 微软发布的一种可执行程序
阅读全文 »

发布线上电子书

目前 npm gitbook 项目已不再更新,请使用  GitBook.com / GitHub integration。

As the efforts of the GitBook team are focused on the GitBook.com platform, the CLI is no longer under active development.
All content supported by the CLI are mostly supported by our GitBook.com / GitHub integration.
Content hosted on the legacy.gitbook.com will continue working until further notice. For differences with the new vesion, check out our documentation.

导出为 word 文件

前提条件:下载 Releases·jgm/pandoc https://github.com/jgm/pandoc/releases。或者使用 typora。

不带模板的导出 word

阅读全文 »

Gitlab 搭建

CentOS 平台

硬件要求

Omnibus GitLab 软件包需要大约 2.5 GB 的存储空间用于安装。

4 核 是推荐的最小核数,支持多达 500 名用户

4GB RAM 是必需的最小内存,支持多达 500 名用户

PostgreSQL 是唯一支持的数据库,捆绑在 Omnibus GitLab 软件包中。您也可以使用外部 PostgreSQL 数据库。

通过下载包安装

1
2
3
4
5
rpm -i gitlab-ce-13.11.1-ce.0.el7.x86_64.rpm
vim /etc/gitlab/gitlab.rb
# 重新生成配置
gitlab-ctl reconfigure
gitlab-ctl restart
阅读全文 »
0%