ubuntu系统常见API

版权声明: https://blog.csdn.net/dadan1314/article/details/86673799

分类

关于路径

getcwd    运行程序的路径

readlink   运行的程序所在的路径

realpath   相对路径转绝对路径

char runpath[1024] = { 0 };
getcwd(runpath, 1024);

char exepath[1024] = { 0 };
readlink("/proc/self/exe", exepathuf, 1024);

char relative_path[1024] = "./";
char absolute_path[1024] = {0};
realpath(relative_path, absolute_path);

 命令

缓存apt-cache

# 列出所有的软件包
apt-cache pkgnames

# 查找软件包
apt-cache search

处理apt-get

# 安装
apt-get install 

参考

linux的getcwd和readlink的区别

猜你喜欢

转载自blog.csdn.net/dadan1314/article/details/86673799