linux基础之vim快速入门
linux基础之vim快速入门_基本linux vim-CSDN博客https://blog.csdn.net/ypxcan/article/details/119878137?ops_request_misc=&request_id=&biz_id=102&utm_term=vim%E7%BC%96%E8%BE%91%E5%99%A8%E5%A4%8D%E5%88%B6%E7%B2%98%E8%B4%B4%E4%BA%94%E9%81%8D&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduweb~default-1-119878137.142%5Ev100%5Epc_search_result_base3&spm=1018.2226.3001.4187
vi和vim快捷键
快捷键使用练习
拷贝当前行 yy,拷贝当前行向下的5行, 5yy,并粘贴(输入p)
删除当前行 dd,删除当前行下面的5行, 5dd
在文件中查找某个单词[命令行下/关键字,回车查找,输入n就是查找下一个]
设置文件的引号,取消文件的行号[命令行下 :set nu 和 :set nonu]
./mycod
0:Success
1:Operation not permitted
2:No such file or directory
3:No such process
4:Interrupted system call
5:Input/output error
6:No such device or address
7:Argument list too long
8:Exec format error
9:Bad file descriptor
10:No child processes
11:Resource temporarily unavailable
12:Cannot allocate memory
13:Permission denied
14:Bad address
15:Block device required
打印错误码
cat mycod.c
#include<stdio.h>
#include<string.h>
int main(int argc,char* argv[],char* env[])
{//int i=0;extern char** environ;//for(i = 0; i<argc; i++)//for(i = 0;env[i]; i++)//for(int i=0;environ[i];i++)for(int i=0;i<100;i++){//printf("argv[%d] -> %s\n",i,argv[i]);//printf("env[%d]:%s\n",i,env[i]);//printf("%d:%s\n",i,environ[i]);printf("%d:%s\n",i,strerror(i));}return 0;
}
echo $?
0
进程如何退出?
1.main函数调用return返回
2.任意地方调用exit()
3._exit()
exit:终止进程,主动刷新缓冲区
_exit: 不会刷新缓冲区
ps ajc | head -1PPID PID PGID SID TTY TPGID STAT UID TIME COMMAND
ps ajx | head -1 && ps axj | grep mytestPPID PID PGID SID TTY TPGID STAT UID TIME COMMAND2413 27283 27282 2104 pts/0 27282 R+ 1000 0:00 grep --color=auto mytest
将grep进程去除:
ps ajx | head -1 && ps axj | grep mytest | grep -v grepPPID PID PGID SID TTY TPGID STAT UID TIME COMMAND