數位天堂

Nokia:科技始終來自於人性; 拜耳:如果文明不能使我們更相愛,那科技便失去意義!
歡迎您的加入,讓我們一起討論科技與環保的整合應用...

您尚未登入。

#1 2009-11-30 00:47:56

hippo
天使
註冊日期: 2008-10-07
文章數: 1562
目前積分 :   20 

console的另類用途

一般來說, console線最主要的用途是看訊號的輸出. 而在console下也可以下指令, 換句話說, 已有一層shell.
若不熟悉screen命令的操作, 就可以在console下指令, 關閉console後, 該指令仍會持續執行.
例如: 使用mc或curl等, 到FTP站台下載ISO檔. 若於Telnet下操作, 當關閉Telnet client(或電腦關機), 其命令也隨之中斷. 若改用console下指令, 則可達成廣義之離線下載.

舉例來說:

# curl -Ov ftp://ftp.twaren.net/pub/Linux/Mandrake/of ficial/iso/2010/mandriva-linux-free-2010.0-x86_64.iso < 220---------- Welcome to Pure-FTPd [privsep] [TLS] ---------- < 220-You are user number 33 of 2000 allowed. < 220-Local time is now 00:15. Server port: 21. < 220-Only anonymous FTP is allowed here < 220-IPv6 connections are also welcome on this server. < 220 You will be disconnected after 5 minutes of inactivity. > USER anonymous < 230-############################################################# < 230-# WELCOME TO TWAREN Public FTP service # < 230-# # < 230-# F T P . T W A R E N . N E T # < 230-# # < 230-############################################################# < 230-Our server is working with 9.5 TB disk and very fat network. < 230-This server is certified as one of official download server < 230-by many projects. If you have problems, please contact to < 230-ftpadmin@twaren.net. < 230 Anonymous user logged in > PWD < 257 "/" is your current location > CWD pub < 250 OK. Current directory is /pub > CWD Linux < 250 OK. Current directory is /pub/Linux > CWD Mandrake < 250 OK. Current directory is /pub/Linux/Mandrake > CWD official < 250 OK. Current directory is /pub/Linux/Mandrake/official > CWD iso < 250 OK. Current directory is /pub/Linux/Mandrake/official/iso > CWD 2010 < 250 OK. Current directory is /pub/Linux/Mandrake/official/iso/2010 > EPSV < 229 Extended Passive mode OK (|||29247|) > TYPE I < 200 TYPE is now 8-bit binary > SIZE mandriva-linux-free-2010.0-x86_64.iso < 213 4612685824 > RETR mandriva-linux-free-2010.0-x86_64.iso < 150-Accepted data connection < 150 4504576.0 kbytes to download % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 4399M 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0{ [data not shown] 2 4399M 2 101M 0 0 62862 0 20:22:57 0:28:12 19:54:45 51907


這時可關閉終端機視窗, 睡覺去. curl還是會無怨無悔的持續下載.




離線

 

#2 2009-12-23 00:17:47

baby0725
新生
註冊日期: 2009-12-23
文章數: 6
目前積分 :   

Re: console的另類用途

剛剛試了一下telnet進入後用
nohup curl -Ov ftp://ftp.twaren.net/pub/Linux/Mandrake … x86_64.iso &
竟然可以離線下載,真是太神奇了!



離線

 

友情連結

論壇頁尾

Powered by PunBB
© Copyright 2018 Rickard Andersson
RSS Feed