Skip to content

Instantly share code, notes, and snippets.

@qichunren
Last active June 11, 2020 10:25
Show Gist options
  • Save qichunren/0afef823144854a8d27e4886419b0a4e to your computer and use it in GitHub Desktop.
Save qichunren/0afef823144854a8d27e4886419b0a4e to your computer and use it in GitHub Desktop.
常用 Linux 命令行
# 统计代码行数,不包括空行
find /src -name "*.cpp" |xargs cat|grep -v ^$|wc -l
# 查看进程内存使用情况
cat /proc/409/status | grep VmRSS | awk '{print $2}'
# 获取网卡设备对应的IP地址
ifconfig eth0 | grep "inet " | awk '{print $2}'
# 获取网卡设备对应的MAC地址
1. ifconfig eth0 | grep "ether " | awk '{print $2}'
2. cat /sys/class/net/eth0/address
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment