1. Ubuntu獲得root許可權
在終端中輸入:
sudo passwd root
Enter new UNIX password: (在這輸入你的密碼)
Retype new UNIX password: (確定你輸入的密碼)
passwd: password updated successfully
以後,如果在想獲得root許可權,只需進行如下的操作:
su root
Password: (在此輸入你上面設定的密碼)
如果要再次禁用 root 帳號,
那麼可以執行 sudo passwd -l root
2. ifconfig
執行個體一:
比如我們用ifconfig 來調試 eth0網卡的地址
[root@linuxchao ~]#ifconfig eth0 down
[root@linuxchao ~]#ifconfig eth0 192.168.1.99 broadcast 192.168.1.255 netmask 255.255.255.0
[root@linuxchao ~]#ifconfig eth0 up
[root@linuxchao ~]#ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:03:0D:27:86:41
inet addr:192.168.1.99 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::203:dff:fe27:8641/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:618 errors:0 dropped:0 overruns:0 frame:0
TX packets:676 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:491238 (479.7 KiB) TX bytes:86286 (84.2 KiB)
Interrupt:5 Base address:0x8c00
註解: 上面的例子我們解說一下;
第一行:ifconfig eth0 down 表示如果eth0是啟用的,就把它DOWN掉。此命令等同於 ifdown eth0;
第二行:用ifconfig 來配置 eth0的IP地址、廣播位址和網路遮罩;
第三行:用ifconfig eth0 up 來啟用eth0 ; 此命令等同於 ifup eth0
第四行:用 ifconfig eth0 來查看 eth0的狀態;
3. 程式後台執行
方法1:
# ./pso > pso.file 2>&1 &
解釋:將pso直接放在後台運行,並把終端輸出存放在目前的目錄下的pso.file檔案中。
當用戶端關機後重新登陸伺服器後,直接查看pso.file檔案就可看執行結果(命
令:#cat pso.file )。
方法2在終端輸入命令:
# nohup
./pso > pso.file 2>&1 &
解釋:nohup就是不掛起的意思,將pso直接放在後台運行,並把終端輸出存放在當前
目錄下的pso.file檔案中。當用戶端關機後重新登陸伺服器後,直接查看pso.file
檔案就可看執行結果(命令:#cat pso.file
)。
方法3 如果不關心輸出資訊,可以直接Ctrl + Z