My Linux Command

Media

  • incress volume
pactl set-sink-volume 0 150%

security

  • sha1sum
echo -n <password> | sha1sum
echo -n "password" | sha256sum

ArchLinux

  • Archlinux 下载源码
abs
makepkg -od

工具

写文档

mkdocs #生成文档网页
mscgen #生成时序图
UMLet  #画图

下载

#1
aria2c -x5 -s5 -k1M <url>
#2 curl 分段
curl --range 0-199999999 -o file.part1 -L -- <url> 
curl --range 100000000- -o file.part2 -L -- <url>
cat file.part? > file.one

搜索

grep -n -e pattern1 -e pattern2 file1 

-n 搜索到的数据显示行号展示
-e pattern1 多个匹配模式下可以通过这个参数选择,多项关系为任一匹配。

排序

sort -t ':' -k 3 -n /etc/passwd 

-t ':' 按照冒号分割每行
-k 3 取第三列的数据排序
-n 将排序的列数据转换成数字排序,默认是按字符串排序的。

查看端口属于哪个程序

lsof -i :8080

查看主机

查看操作系统相关信息 uname -a
查看内核版本 cat /proc/version
查看发行版本信息 cat /etc/issue

Kill Process

ps -ef | grep openvpn | grep -v grep| awk '{print $2}' | xargs sudo kill -9

SETTING

  • 设置wireshark Nonroot
sudo usermod -a -G wireshark $USER
  • xrand 多屏设置
xrandr --output HDMI1 --auto --primary --output VGA1 --right-of HDMI1 --rotate left
  • android 使用 adb 设置可写
# Mount system RW: 
mount -o rw,remount,rw /system
# Mount system RO: 
mount -o ro,remount,ro /system
  • XTerm

    • edit ~/.Xresources

      ! XTerm*reverseVideo: on
      xterm*faceName:DejaVu Sans Mono:antialias=True:pixelsize=14
      xterm*faceNameDoublesize:WenQuanYi Micro Hei:antialias=True:pixelsize=14
      Xterm*locale:zh_CN.UTF-8
      XTerm*background: rgb:00/00/00
      XTerm*foreground: rgb:ee/ee/ee
      XTerm*selectToClipboard: true
    • run command

      xrdb ~/.Xresources

开发工具

  1. C 语言分析

    qcachegrind
    gprof2dot
  2. The nm command to find symbols.

    
    # 在库中查找函数
    
    nm -u <lib_name.[.so][.a]> | grep "<function_name>"
    
    # 在obj文件中查找外部函数
    
    nm -g <obj_file> | grep "<external_func>"
  3. The objdump command to disassemble a program.

    
    # print the disassembly in a readable format.
    
    objdump -d -M intel -S <obj_file>
    
    #1. The -d flag is to begin the disassembly process.
    
    
    #2. The -M intel option is to print the output in Intel assembly format.
    
  4. The ldd command to display dynamic dependencies.
    shell
    ldd <obj_file>
    #<obj_file> is the name of your executable along with its path.
  5. The addr2line command to map an address to a location in the program.
    shell
    addr2line -e <your_program> <mem_addr>
    #your_program is the name of your program.
    #mem_addr is the address you like to interpret.
  6. The lsof command to identify open files.
    shell
    #Check the open state of a file.
    lsof <path/filename>
    # Show files opened under a directory.
    lsof +D /home/test/
    # Show files opened by a user.
    lsof -u <username>
    # Show files opened by a process.
    lsof -p <process_id>
    # Show processes listening on a particular port.
    lsof -i :8080
    Show all TCP/UDP connections.
    lsof -i tcp; lsof -i udp;
  7. The readelf command to display ELF information.

    readelf --symbols ./elfdemo
    
    
    #To get a list of the dynamically linked dependencies for of a binary.
    
    readelf -d elfdemo | grep NEEDED
  8. The od command to display octal dump.

    
    # Show content of a file in octal format.
    
     od -b /usr/lib/libc.so
     # Show content of a file in char format.
     od -c /usr/lib/libc.so
     # Show content after skipping some bytes.
     od -j7 -c /usr/lib/libc.so
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值