Linux获取当前时间
1. Linux下与时间有关的结构体
struct timeval
{
int tv_sec;
int tv_usec;
};
其中tv_sec是由凌晨开始算起的秒数,tv_usec则是微秒(10E-6 second)。
struct timezone
{
int tv_minuteswest;
int tv_dsttime;
};
tv_minuteswest是格林威治时间往西方的时差,tv_dsttime则是时间的修正方式。
struct timespec
{
long int tv_sec;
long int tv_nsec;
};
tv_nsec是nano second(10E-9 second)。
struct tm
{
int tm_sec;
int tm_min;
int tm_hour;
int tm_mday;
int tm_mon;
相关文档:
linux grep命令,强大的文本搜索
1.作用
linux系统中grep命令是一种强大的文本搜索工具,它能使用正则表达式搜索文本,并把匹配的行打印出来。grep全称是Global Regular Expression Print,表示全局正则表达式版本,它的使用权限是所有用户。
2.格式
grep [options]
3.主要参数
[options]主要参数:
-c:只输出匹配 ......
1、 一些头文件的作用:
<assert.h>:ANSI C。提供断言,assert(表达式)
<glib.h>:GCC。GTK,GNOME的基础库,提供很多有用的函数,如有数据结构操作函数。使用glib只需要包含<glib.h>
<dirent.h>:GCC。文件夹操作函数。struct dirent,struct DIR,opendir(),closedir(),readdir(),readdi ......
在 Ubuntu Linux 中用源码文件安装软件
时经常都会用到chmod
命令来更改文件的权限使其在安装时有执行的权限。由于 Ubuntu Linux 默认不能用root账户来登录所以在用chmod命令来更改文件的权限时往往需要结合sudo命令来使用,如果你对sudo命令还不太了解,请先看看本站的《sudo命令详解》
chmod
Linux/Ubuntu
系统中文 ......