差異處

這裏顯示兩個版本的差異處。

連向這個比對檢視

Both sides previous revision 前次修改
下次修改
前次修改
linux:shell_script [2017/09/19 10:27]
tony [Reference]
linux:shell_script [2023/06/25 09:48] (目前版本)
行 15: 行 15:
   * [[.shell_script:​get_local_ip|取得IP Address]] included ipv4, ipv6 and cable status   * [[.shell_script:​get_local_ip|取得IP Address]] included ipv4, ipv6 and cable status
   * [[.shell_script:​execution_time_measurement|測量執行時間]]   * [[.shell_script:​execution_time_measurement|測量執行時間]]
 +  * [[.shell_script:​bypass_invalid_options_of_getopts|Bypass invalid options of getopts]]
 ===== 暫存區 ===== ===== 暫存區 =====
 ==== grep space ==== ==== grep space ====
行 45: 行 46:
 ifconfig | grep -o -E '​([[:​xdigit:​]]{2})(:​[[:​xdigit:​]]{2}){5}'​ ifconfig | grep -o -E '​([[:​xdigit:​]]{2})(:​[[:​xdigit:​]]{2}){5}'​
 </​code>​ </​code>​
 +==== 設DNS ====
 +Ubuntu很搞怪,不能直接改resolve.conf:​
 +<code basg>
 +systemd-resolve --set-dns=10.146.125.97 --interface enp3s0f0
 +</​code>​
 +
  
  
行 71: 行 78:
 ==== sed ==== ==== sed ====
   * [[http://​askubuntu.com/​questions/​76785/​how-to-escape-file-path-in-sed|escape file path with sed]]   * [[http://​askubuntu.com/​questions/​76785/​how-to-escape-file-path-in-sed|escape file path with sed]]
 +==== network ====
 +  * [[https://​unix.stackexchange.com/​questions/​441877/​identify-if-a-network-interface-is-a-veth-using-sys-class-net|辨別網卡是否為veth]]