Questions tagged «command-line»

有关使用命令行界面(CLI)的问题。



8
列出系统使用的DNS服务器的命令行
是否有命令列出系统使用的dns服务器? 我试过了 $ cat /etc/resolv.conf # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN nameserver 127.0.0.1 $ cat /etc/network/interfaces # interfaces(5) file used by ifup(8) and ifdown(8) auto lo iface lo inet loopback 但是它没有列出任何服务器,如果我转到“网络管理器GUI工具”,则在“无线”部分列出“ DNS …
253 command-line  dns 




4
以另一个没有密码的用户身份运行Shell脚本
我想以没有密码的其他用户身份从主ubuntu shell运行脚本。 我具有完整的sudo特权,因此尝试了以下操作: sudo su -c "Your command right here" -s /bin/sh otheruser 然后,我必须输入密码,但是我不确定该脚本现在是否真正在该用户下运行。 如何确认该脚本现在确实在该用户下运行?
245 command-line  bash  sudo 







9
如何检查命令是否成功?
有什么方法可以检查执行命令是否出错? 范例: test1=`sed -i "/:@/c connection.url=jdbc:oracle:thin:@$ip:1521:$dataBase" $search` valid $test1 function valid () { if $test -eq 1; then echo "OK" else echo "ERROR" fi } 我已经尝试过这样做,但是似乎没有用。我不怎么做
234 command-line 


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.