以后知道一个写一个
valgrind
可用来检验内存泄漏出处
valgrind --tool=memcheck --leak-check=full ./test
adl@adl:~/桌面/json-tutorial/tutorial03/images$ valgrind ./leptjson_test --leak-check=full
==7458== Memcheck, a memory error detector
==7458== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==7458== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==7458== Command: ./leptjson_test --leak-check=full
==7458==
160/160 (100.00%) passed
==7458==
==7458== HEAP SUMMARY:
==7458== in use at exit: 6 bytes in 1 blocks
==7458== total heap usage: 12 allocs, 11 frees, 2,092 bytes allocated
==7458==
==7458== LEAK SUMMARY:
==7458== definitely lost: 6 bytes in 1 blocks
==7458== indirectly lost: 0 bytes in 0 blocks
==7458== possibly lost: 0 bytes in 0 blocks
==7458== still reachable: 0 bytes in 0 blocks
==7458== suppressed: 0 bytes in 0 blocks
==7458== Rerun with --leak-check=full to see details of leaked memory
==7458==
==7458== For counts of detected and suppressed errors, rerun with: -v
==7458== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
adl@adl:~/桌面/json-tutorial/tutorial03/images$ valgrind --tool=memcheck --leak-check=full ./
CMakeFiles/ leptjson_test
adl@adl:~/桌面/json-tutorial/tutorial03/images$ valgrind --tool=memcheck --leak-check=full ./leptjson_test
==7516== Memcheck, a memory error detector
==7516== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==7516== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==7516== Command: ./leptjson_test
==7516==
160/160 (100.00%) passed
==7516==
==7516== HEAP SUMMARY:
==7516== in use at exit: 6 bytes in 1 blocks
==7516== total heap usage: 12 allocs, 11 frees, 2,092 bytes allocated
==7516==
==7516== 6 bytes in 1 blocks are definitely lost in loss record 1 of 1
==7516== at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==7516== by 0x10F532: lept_set_string (in /home/adl/桌面/json-tutorial/tutorial03/images/leptjson_test)
==7516== by 0x10E83F: test_access_string (in /home/adl/桌面/json-tutorial/tutorial03/images/leptjson_test)
==7516== by 0x10E9AC: test_parse (in /home/adl/桌面/json-tutorial/tutorial03/images/leptjson_test)
==7516== by 0x10E9BD: main (in /home/adl/桌面/json-tutorial/tutorial03/images/leptjson_test)
==7516==
==7516== LEAK SUMMARY:
==7516== definitely lost: 6 bytes in 1 blocks
==7516== indirectly lost: 0 bytes in 0 blocks
==7516== possibly lost: 0 bytes in 0 blocks
==7516== still reachable: 0 bytes in 0 blocks
==7516== suppressed: 0 bytes in 0 blocks
==7516==
==7516== For counts of detected and suppressed errors, rerun with: -v
==7516== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
telnet
可当客户端
telnet 127.0.0.1 12345
(会有\r\n)
nc
nc可以当成客户或者服务器
tcpdump
抓包
sudo tcpdump -i lo tcp port 12345 and host 127.0.0.1
[.]ACK, [R]RST,[F]FIN,[S]SYN [S.]SYN+ACK
top -d 查看cpu占用情况!
find(这个记下是因为老是忘)
find . -maxdepth 5 -name “cJSON.*” 指定查找的深度为5
ranger
一个可以通过上下左右就可以快速访问各级目录的命令