摘要: fopen, fclose#include <stdio.h>FILE *fopen(const char *path, const char *mode);int fclose(FILE *fp);fread, fwrite#include <stdio.h>size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream);size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream);fgetc, getc, getchar 阅读全文
posted @ 2012-07-22 09:30 kimiz 阅读(134) 评论(0) 推荐(0)
摘要: 读写与打开 1 #include <unistd.h> 2 3 ssize_t write(int fd, const void *buf, size_t count); 4 ssize_t read(int fd, void *buf, size_t count); 5 6 7 #include <sys/types.h> 8 #include <sys/stat.h> 9 #include <fcntl.h>10 11 int open(const char *pathname, int flags);12 int open(const ch 阅读全文
posted @ 2012-07-17 20:48 kimiz 阅读(135) 评论(0) 推荐(0)
摘要: 语法格式find [path] [options] [tests] [actions]options -depth Process each directory's contents before the directory itself. -follow 跟随链接符号 -maxdepths 最多搜索N层目录 -mount 不搜索其他文件系统中到目录tests -name pattern 文件名匹配正则模式pattern,pattern尽量用引号 -newer otherfile 比otherfile新 -type f 文件类型是普通... 阅读全文
posted @ 2012-07-10 20:23 kimiz 阅读(130) 评论(0) 推荐(0)
摘要: 管道和重定向1 重定向输出>2 重定向输入<3 管道|变量1 用户变量2 环境变量3 参数变量 参数变量 说明 $0 shell脚本的名字 $$ shell脚本的进程号 $1, $2, ... 各个参数 $# 参数个数 $* 列出所有参数 $@ 列出所有参数(不受IFS改变) 条件测试命令test或[字符串比较 string1 = string2 string1 != string2 -n string 字符串不为空,则为真 -z st... 阅读全文
posted @ 2012-07-10 19:56 kimiz 阅读(133) 评论(0) 推荐(0)
摘要: 文本编辑器可以选择Vim和或者GNU Emacs1 http://www.vim.org/2 http://www.gnu.org/software/emacs/编译器GCC1 http://gcc.gnu.org/shell程序搜索到目录路径储存在shell变量PATH中1 $ echo $PATH2 /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games头文件(-I指定搜索路径)1 /usr/include库文件(-L指定搜索路径,-l指定库文件)1 /lib和/usr/lib总结:掌握以下命令1 gc 阅读全文
posted @ 2012-07-08 12:50 kimiz 阅读(146) 评论(0) 推荐(0)
摘要: 1 使用u盘方式进入 ubuntu live cd2 sudo su3 fdisk -l4 找到linux的分区,如 /dev/sda65 mount /dev/sda6 /mnt6 grub-install --root-drectory=/mnt /dev/sda7 重启,可以看到 启动菜单了。8 进入ubuntu: update-grub9 OK 阅读全文
posted @ 2012-07-08 11:52 kimiz 阅读(107) 评论(0) 推荐(0)
摘要: 1 #include <errno.h> 2 #include <math.h> 3 #include <stdio.h> 4 #include <stdlib.h> 5 #include <string.h> 6 #include <net/if.h> 7 #include <sys/ioctl.h> 8 9 10 /* 11 * === FUNCTION ======================================================================12 * Na 阅读全文
posted @ 2012-07-08 10:20 kimiz 阅读(275) 评论(0) 推荐(0)
摘要: 1 #include <errno.h> 2 #include <math.h> 3 #include <stdio.h> 4 #include <stdlib.h> 5 #include <string.h> 6 #include <pthread.h> 7 #include <unistd.h> 8 9 pthread_mutex_t mutex;10 pthread_cond_t cond;11 int x;12 int y;13 14 15 /* 16 * === FUNCTION ========== 阅读全文
posted @ 2012-07-08 10:18 kimiz 阅读(388) 评论(0) 推荐(0)