linux命令备忘录

名词

1
2
3
4
5
pie: position-independent executable
pic: position-independent code
aslr: address space layout randomization
got: global offset table
vdso: virtual dynamic shared object

swap文件

1
2
3
4
dd if=/dev/zero of=./swap_file bs=1G count=1
mkswap ./swap_file
swapon ./swap_file
swapoff ./swap_file

objcopy

1
2
3
objcopy -I binary -O elf32-i386 -B i386 test.jpg test.o
objdump -s -b binary test.o
readelf -s test.o

静态链编stdc++

1
-Bstatic -lstdc++ -Bdynamic

工具

1
2
3
systemtap
inotify-tools
windres

refer to:
http://blog.chinaunix.net/uid-28461677-id-5766451.html
https://blog.csdn.net/weixin_33842304/article/details/91443399

Bash读取某一行某一列

打印第11行:
sed -n "11, 1p" /tmp/tmp.txt
或者
awk 'NR == 11 {print}' /tmp/tmp.txt

打印第3列:
awk '{print $3;}' /tmp/tmp.txt

打印总行数:
awk 'END {print NR}' /tmp/tmp.txt