摘要:
1 int main() 2 { 3 4 int arr[] = {1,2,3,4,5,6,7,8}; 5 int *p=arr; *(p++)+=123; 6 *p+=123; p++; 7 printf("%d,%d\n", *p,*(++p)); 8 9 10 } 第一行,定义数组arr,元素 阅读全文
摘要:
静态库 程序所要用到的库函数代码在链接时全部被copy到程序,如果有多个进程在内存中同时运行,并且使用了相同的库函数,那么就会有多份拷贝,这就是对空间的浪费。(静态链接库以*.a为后缀) 建立mylib.c int add(int a,int b) { return a+b; } 编译文件并输出目标 阅读全文
摘要:
# 按文件名排序 ls |sort -n # 递归显示子目录 ls -R # 按文件大小排序 ls -lS # 查看文件大小和时间 ls -lh # 按时间逆序排序 ls -ltr # 只显示目录,不会显示子目录文件 ls -d *htmls # 列出文件或目录的节点号 ls -i# 把文件切割每个 阅读全文
摘要:
查看9090端口是否启用 netstat -nl | grep 9090 netstat -apn|grep 80 阅读全文
摘要:
ip=$(ifconfig |grep broadcast|awk 'NR<2 {print $2}') echo $ip ifconfig注:在配置crontab定时任务时,ifconfig为生效,可在脚本上加入 . /etc/profile 使环境变量生效 阅读全文
摘要:
查看磁盘 lsblk 查看磁盘是否格式化 blkid /dev/vda1 格式化磁盘 mkfs -t ext4 /dev/vda1 查看UUID blkid # 查看挂载点是否存在 ls -ld /opt/local/data # 创建挂载目录 mkdir -p /opt/local/data # 阅读全文
![](/skins/gray/images/separator.gif)