linux系统编程
星星之火可以燎源
始终保持快乐激情,在这段美好的青春时光,不留下遗憾
展开
-
linux环境搭建之samba服务器
Samba 安装配置 卸载 sudo apt-get autoremove samba samba-common sudo apt-get autoremove system-config-samba 安装 sudo apt-get install samba samba-common sudo apt-get install system-config-samba cifs-u...原创 2019-05-22 09:39:39 · 207 阅读 · 0 评论 -
linux环境搭建之tftp tftpd服务器
一、搭建TFTP服务器 1)sudo apt-get install xinetd 2)sudo apt-get install tftp tftpd 3)建立TFTP配置文件,sudovi /etc/xinetd.d/tftp配置一下内容,其中server_args 为服务器目录,客户端需要的文件要放到此处,否则找不到 service tftp { ...原创 2019-05-22 11:04:10 · 5311 阅读 · 0 评论 -
linux经常用的代码模块之目录扫描
1、使用scandir接口 bool getDirentInfo(char *dirName) { struct dirent **namelist; int num; struct stat tStat; num = scandir(dirName, &namelist, NULL, alphasort); if (num < 0) { printf("scand...原创 2019-05-17 10:17:59 · 241 阅读 · 0 评论 -
linux常用的代码模块之常用接口
1、strcasecmp 字符串比较(不区分大小写) 2、判断文件是否存在 1)access接口 if(access(name,F_OK)==0){ printf("文件存在\n"); } else { printf("文件不存在\n"); } 2)stat if (stat(namelist[num]->d_name, &tSt...原创 2019-05-17 10:19:37 · 395 阅读 · 0 评论 -
中文编码格式
一、在ubuntu中可以使用(unicode 大)查看UTF-8,如下图原创 2019-05-23 17:49:46 · 695 阅读 · 0 评论 -
linux常用命令
1、dpkg是一个Debian的一个命令行工具,它可以用来安装、删除、构建和管理Debian的软件包 dpkg -l 显示所有已经安装的Deb包(例如:dpkg -l |grep ssh) ...原创 2019-05-28 17:13:38 · 116 阅读 · 0 评论 -
socketpair的用法和理解
socketpair()头文件: SYNOPSIS #include <sys/types.h> /* See NOTES */ #include <sys/socket.h> int socketpair(int domain, int type, int protocol, int sv[2]); so...转载 2019-05-28 17:52:44 · 1224 阅读 · 0 评论