学习笔记
command -options -args ls -a /usr 为例
- short option -a -l -h
- long option -all -list
- short option combine -alh
file filename(用于辨识该文件的类型)
less filename
- j.k.d.u.space
- q退出
- 星号 0,1,more char
- ? 1 char
- [character] one character in set
- [!character] no one character in set
- [[:class:]] one char in class
- [:digit:] number
- [:lower:] lower char
- [:upper:] upper char
- [:alnum:] num + alpha
- [:alpha:] lower + upper
mkdir directory....
- cp item1 item2(当前目录当中复制一个文件)
- cp items... directory
- -a(archive) -i(interactive) -r(recursive递归的) -u(update) -v(verbose)
ln file link //创建硬链接 ln -s item link //创建软链接
编辑一个其中文件,所有的文件都会变化,且删除任何一个文件不会影响其他文件
相当于windows的快捷方式,编辑一个其中文件,所有的文件都会变化,删除源文件,链接中断
- execute binary 可执行二进制文件()
- buildin bash (内建bash)
- shell function (内嵌的shell)
- alias (别名)
分析工具
该命令的一般形式为:nohup command &
&的意思是在后台运行, 什么意思呢? 意思是说, 当你在执行 ./a.out & 的时候, 即使你用ctrl C, 那么a.out照样运行(因为对SIGINT信号免疫)。 但是要注意, 如果你直接关掉shell后, 那么, a.out进程同样消失。 可见, &的后台并不硬(因为对SIGHUP信号不免疫)。 nohup的意思是忽略SIGHUP信号, 所以当运行nohup ./a.out的时候, 关闭shell, 那么a.out进程还是存在的(对SIGHUP信号免疫)。 但是, 要注意, 如果你直接在shell中用Ctrl C, 那么, a.out进程也是会消失的(因为对SIGINT信号不免疫) 所以, &和nohup没有半毛钱的关系, 要让进程真正不受shell中Ctrl C和shell关闭的影响, 那该怎么办呢? 那就用nohua ./a.out &吧, 两全其美。 如果你懂守护进程, 那么nohup ./a.out &颇有点让a.out成为守护进程的感觉。