![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Linux
zhuzhuxia-480
哈哈
展开
-
Linux学习笔记之---文件
1:文件系统结构 1.1: 获取文件属性函数: #include #include int stat (const char *path, struct stat *buf); int fstat (int fildes, struct stat *buf); int ls原创 2015-03-10 19:39:06 · 248 阅读 · 0 评论 -
shell编程---变量的定义
为了更好地控制变量的相关属性,bash 提供了一个 名称为declare的命令来声明变量,该命令的基本语法如下: declare attribute variable 其中,attribute表示变量的属性,常用的属性有如下所述。 -p:显示所有变量的值。 -i:将变量定义为整数。在之后就可以直接对表达式求值,结果只能是整数。如果 求值失败或者不是整数,就设置为0。 -r原创 2015-04-03 17:24:47 · 452 阅读 · 0 评论 -
Shell编程之多行注释
在Shell中可以使用#对某一行进行注释,但有时候需要对多行进行注释 这时候可以使用“:”配合here document: : ...注释内容 BLOCK #----------------------------example.sh---------------------------- #! /bin/sh : 本脚本的作用是输出一行字符串 作者:zhuzh原创 2015-04-03 16:18:45 · 424 阅读 · 0 评论 -
Linux学习笔记之---消息队列
9:消息队列 9.1 ipc结构 struct ipc_perm { uid_t uid; gid_t gid; uid_t cuid; gid_t cgid;原创 2015-03-10 19:49:11 · 334 阅读 · 0 评论 -
Linux学习笔记之---时钟和信号
7:时钟和信号 7.1 UNIX中存在三种格式的时间: 1.系统时间: 1970,1,1到现在的秒数(time_t) 2.高分辨率时间:精确到微妙的时间(timeval结构体) 3.日历时间:“年,月,日,时,分,秒“类型(tm结构) 7.2 系统时间原创 2015-03-10 19:46:26 · 446 阅读 · 0 评论 -
Linux学习笔记之---基于TCP的通信程序的设计
12:基于TCP的通信程序的设计 12.1 套接字的类型 1.流套接字SOCK_STREAM 是双向的,可靠的,顺序的,不重复的,面向连接的,tcp协议 2.数据报套接字SOCK_DGRAM 无连接,独立的,无序的,不保证可靠性,udp协议原创 2015-03-10 19:50:17 · 346 阅读 · 0 评论 -
Linux学习笔记之---管道
8:管道 8.1 无名管道 无名管道通常直接称之为管道,它占用两个文件描述符,不能被非血缘关系 的进程共享,一般应用在父子进程中 8.2 无名管道的建立 #include int pipe (in原创 2015-03-10 19:48:29 · 286 阅读 · 0 评论 -
Linux学习笔记之---信号量
10:信号量 10.1 信号量的存储结构 struct semid_ds { struct ipc_permsem_perm; 访问权限 struct sem *base; 信号量集合中信号量指针原创 2015-03-10 19:48:33 · 292 阅读 · 0 评论 -
Linux学习笔记之---标准文件库编程
2:标准文件编程库 2.1: 创建,打开,关闭,删除函数族 #include FILE *fopen (const char *filename, cnost char *type) FILE *freopen (const char *filename, const char*type, FILE *原创 2015-03-10 19:42:27 · 298 阅读 · 0 评论 -
Linux学习笔记之---进程
6:进程控制 6.1: 读取进程ID号 #include #include pid_t getpid(); 当前进程ID; pid_t getpgrp(); 当前进程组ID; pid_t getppid();原创 2015-03-10 19:46:47 · 282 阅读 · 0 评论 -
Linux学习笔记之---基于UDP的通信程序设计
13:基于UDP的通信程序设计 13.1 UDP数据的收发 1.数据发送函数sendto #include #include int sendto(int s,const void *msg,int len,int flags,原创 2015-03-10 19:52:12 · 468 阅读 · 0 评论 -
Linux学习笔记之--低级(底层)文件库编程
3:低级文件编程库(底层文件编程库) 3.1: 文件的打开与创建 #include int open(const char *filename, int oflag, .../*[mode_t mode]*/) 本函数共有三个参数:要打开或创建文件的路径名;oflag指定打开或创建原创 2015-03-10 19:44:00 · 503 阅读 · 0 评论 -
Linux学习笔记之---目录文件编程库
4:目录文件编程库 4.1: 读取工作目录 #include char *getcwd(char *buf, size_t size); char *getwd(char *pathname); getcwd获取当前工作目录的绝对路径存入buf失败返回NULL原创 2015-03-10 19:45:58 · 265 阅读 · 0 评论 -
shell编程-----引用和替换
-----------------------常用引用符号-------------------- 双引号--------除美元符号($),单引号( ' ),反引号( ` ),反斜线( \ )外,其他字符保持字面意义 ------------------------------------------------------------- 单引号--------所有的字符都将保持字面意义原创 2015-04-03 18:40:27 · 366 阅读 · 0 评论