一行就能搞定,输出32或者64
$ getconf LONG_BIT
$ 64
用在Makefile里非常给力……
OS = $(shell getconf LONG_BIT)[......]
一行就能搞定,输出32或者64
$ getconf LONG_BIT
$ 64
用在Makefile里非常给力……
OS = $(shell getconf LONG_BIT)[......]
当前使用web8源的方式已经失效了,还是需要手动解压缩安装。
1 下载
https://www.oracle.com/hk/java/technologies/javase/javase8-archive-downloads.html
下载 jdk-8u202-linux-x64.tar.gz
2 解压缩
sudo mkdir /usr/java
sudo tar -xf ./jdk-8u202-linux-x64.tar.gz -C /usr/java
3 修改环境变量[......]
#Check fcitx ppa source at https://launchpad.net/~fcitx-team
sudo add-apt-repository ppa:fcitx-team/stable
sudo apt-get update
sudo apt-get install fcitx[......]
像排序这种事情,用C/C++可以写,但很麻烦,交给sort就好了,功能很强大的。
1、按照多个列排序(列间空格分开):
测试数据:
先按照第1列排序,再第2列的命令:
2011-11-20补充:必须加-s选项,表示stable sort,即两列排序互相不打扰。
$ cat ./test
1 x
5 8
1 a
$ sort -s -k 1 -k 2 ./test
1 a
1 x
5 [......]
在Linux下,程序崩溃是很头疼的事情(其实Windows更是如此)。
我们可以生成core dump文件,并用gdb重现崩溃时的场景。
ulimit设置core dump开关和大小
ulimit -c unlimited
测试代码:
#include <stdio.h>
int main(int argc, char* argv[])
{
char * p = NULL;
*p = 123;
return 0;[......]