本 Wiki 开启了 HTTPS。但由于同 IP 的 Blog 也开启了 HTTPS,因此本站必须要支持 SNI 的浏览器才能浏览。为了兼容一部分浏览器,本站保留了 HTTP 作为兼容。如果您的浏览器支持 SNI,请尽量通过 HTTPS 访问本站,谢谢!
常用的 bash 命令
ls
:查看当前目录下的所有文件ls -a
:查看当前目录下所有文件,包括隐藏的目录和文件ls -l
:以完整信息的模式查看ls -t
:按上次修改的时间排序drwxr-xr-x 5 cc eng 4096 Jun 24 16:51 action Access rights. These indicate the read, write, and execute permissions on the file or directory allowed to the owner, the group, and all users. You can read more about file permissions. Number of hard links. This number counts the number of child directories and files. This number includes the parent directory link (..) and current directory link (.). The username of the file’s owner. Here the username is cc. The name of the group that owns the file. Here the group name is eng. The size of the file in bytes. The date & time that the file was last modified. The name of the file or directory
pwd
:显示当前目录路径cd + folder_name
:打开当前目录下的文件夹cd ..
:返回上一级文件夹mkdir + dir_name
:新建目录touch + file_name
:新建文件cat + file_name
:读取文件中的内容cp + file_name + path
:拷贝文件到目标位置cp + file_name + file_name + path
:拷贝多个文件到目标位置cp * path
:wildcard 通配符拷贝mv file_name + path
移动文件到指定位置mv file file + path
移动多个文件到指定位置mv file rename
重命名文件并移动到指定位置rm -f filename
删除文件rm -r folder
删除文件夹以及其目录底下所有文件echo + string
打印 str> file name
(重定向)输出文件 cat + >
覆盖文件|
接受左边的 Input 输出到右边的 outputwc
: 输出 lines | words | character 的数量sort
接受一个 Input, 对文件内容进行 alphabet 排序uniq
对相邻的两个相同的内容消除掉一个grep
global regular expression print, 按 pattern 搜索。默认区分大小写, -i
取消区分大小写, -R
搜索所有匹配的关键字文件,-Rl
搜索匹配的文件名sed
查找并且替换:s/snow/rain/g s 代表 substitution 替换, 查找的关键词是 snow, 替换的关键词是 rain, g 代表 global,意思是替换所有。如果只需要在终端打印的时候替换,使用 -i
Nano 的操作
~
代表 Home 目录.
代表影藏文件nano ~/.bash_profile
修改该文件, 在里面写 echo
会在 terminal 打开的时候打印source ~/.bash_profile
立刻激活,不用关闭终端alias
: 可以配置快捷键alias pd = “pwd”
pd 会具有 pwd 的功能