Skip to main content

How to ‘Grab’ the Files That You Need from FTP Site?

How To 'grab' The Files That You Need From FTP Site?

How to 'grab' the files that you need from FTP site?

Introduction

If you need some packages, but you are in offline situations. That means you cannot connect to the internet. You can prepare to download that you need packages in free time. To do this, you can cost down a lot of time to search packages.
By the way, if you don't want to connect to the internet when you install Operation System. This is an easy way. It's benefits that you can avoid hacker or cracker into your system when you install the OS by internet.
However, this essay only talks about how to download you want packages from the FTP site. Because almost FTP site has numerous files, we don't need whole one.
There are two methods of grabbing it and you are able to filter files.

Equipment

Operation System: Ubuntu 14.04 LTS

Usage

1.. The 'wget' is a useful tool and you can manipulate it.

$ sudo apt-get install wget

2.. If you want to crab whole files from an FTP site, you can use this instruction. For example, the FTP site's hyperlink is 'ftp://ftp.ca.debian.org/debian/' and it accepts the anonymous to access. The FTP hyperlink format is 'ftp://anonymous(your login account name):password(your password)@ftp.cadebian.org(a FTP hyperlink).

$ wget --recursive ftp://anonymous:@ftp.ca.debian.org/debian

3.. If you just want to download that you need files, you should use the filter mechanism by 'wget'. In this case, you just want to download that file name suffix are such as 'armhf.deb', 'all.deb', 'tar.gz', '.dsc' and 'tar.xz' from FTP site. You can use the instruction called '--accept' to the download you want.

$ wget --recursive --accept="*armhf.deb","*all.deb","*tar.gz","*.dsc","*tar.xz" ftp://anonymous:@ftp.ca.debian.org/debian/

--2014-11-30 11:44:16-- ftp://anonymous:password@ftp.ca.debian.org/debian/pool/main/j/jzip/j
=> ‘ftp.ca.debian.org/debian/pool/main/j/jzip/.listing’
==> CWD (1) /debian/pool/main/j/jzip ... done.
==> PASV ... done. ==> LIST ... done.
[ <=> ] 4,130 --.-K/s in 0.006s
2014-11-30 11:44:18 (688 KB/s) - ‘ftp.ca.debian.org/debian/pool/main/j/jzip/.listing’ saved [4130]

Removed ‘ftp.ca.debian.org/debian/pool/main/j/jzip/.listing’.
Rejecting ‘jzip_210r20001005d-1_amd64.deb’.
Rejecting ‘jzip_210r20001005d-1_armel.deb’.
Rejecting ‘jzip_210r20001005d-1_i386.deb’.
Rejecting ‘jzip_210r20001005d-1_ia64.deb’.
Rejecting ‘jzip_210r20001005d-1_kfreebsd-amd64.deb’.
Rejecting ‘jzip_210r20001005d-1_kfreebsd-i386.deb’.
Rejecting ‘jzip_210r20001005d-1_mips.deb’.
Rejecting ‘jzip_210r20001005d-1_mipsel.deb’.
Rejecting ‘jzip_210r20001005d-1_powerpc.deb’.
Rejecting ‘jzip_210r20001005d-1_s390.deb’.
Rejecting ‘jzip_210r20001005d-1_sparc.deb’.
Rejecting ‘jzip_210r20001005d-2_amd64.deb’.
Rejecting ‘jzip_210r20001005d-2_armel.deb’.
Rejecting ‘jzip_210r20001005d-2_i386.deb’.
Rejecting ‘jzip_210r20001005d-2_ia64.deb’.
Rejecting ‘jzip_210r20001005d-2_kfreebsd-amd64.deb’.
Rejecting ‘jzip_210r20001005d-2_kfreebsd-i386.deb’.
Rejecting ‘jzip_210r20001005d-2_mips.deb’.
Rejecting ‘jzip_210r20001005d-2_mipsel.deb’.
Rejecting ‘jzip_210r20001005d-2_powerpc.deb’.
Rejecting ‘jzip_210r20001005d-2_s390.deb’.
Rejecting ‘jzip_210r20001005d-2_s390x.deb’.
Rejecting ‘jzip_210r20001005d-2_sparc.deb’.
Rejecting ‘jzip_210r20001005d-3_amd64.deb’.
Rejecting ‘jzip_210r20001005d-3_arm64.deb’.
Rejecting ‘jzip_210r20001005d-3_armel.deb’.
Rejecting ‘jzip_210r20001005d-3_hurd-i386.deb’.
Rejecting ‘jzip_210r20001005d-3_i386.deb’.
Rejecting ‘jzip_210r20001005d-3_kfreebsd-amd64.deb’.
Rejecting ‘jzip_210r20001005d-3_kfreebsd-i386.deb’.
Rejecting ‘jzip_210r20001005d-3_mips.deb’.
Rejecting ‘jzip_210r20001005d-3_mipsel.deb’.
Rejecting ‘jzip_210r20001005d-3_powerpc.deb’.
Rejecting ‘jzip_210r20001005d-3_ppc64el.deb’.
Rejecting ‘jzip_210r20001005d-3_s390x.deb’.
Rejecting ‘jzip_210r20001005d-3_sparc.deb’.
Rejecting ‘jzip_210r20001005d.orig.tar.bz2’.

--2014-11-30 11:44:18-- ftp://anonymous:password@ftp.ca.debian.org/debian/pool/main/j/jzip/jzip_210r20001005d-1.debian.tar.gz
=> ‘ftp.ca.debian.org/debian/pool/main/j/jzip/jzip_210r20001005d-1.debian.tar.gz’
==> CWD not required.
==> PASV ... done. ==> RETR jzip_210r20001005d-1.debian.tar.gz ... done.
Length: 9822 (9.6K)
100%[======================================>] 9,822 32.7KB/s in 0.3s
… (More and ignore)
--2014-11-30 11:44:45-- ftp://anonymous:password@ftp.ca.debian.org/debian/pool/main/j/jzlib/libjzlib-java_1.1.3-1_all.deb
=> ‘ftp.ca.debian.org/debian/pool/main/j/jzlib/libjzlib-java_1.1.3-1_all.deb’
==> CWD not required.
==> PASV ... done. ==> RETR libjzlib-java_1.1.3-1_all.deb ... done.
Length: 69926 (68K)
100%[======================================>] 69,926 67.1KB/s in 1.0s
2014-11-30 11:44:47 (67.1 KB/s) - ‘ftp.ca.debian.org/debian/pool/main/j/jzlib/libjzlib-java_1.1.3-1_all.deb’ saved [69926]

FINISHED --2014-11-30 11:44:47--
Total wall clock time: 2h 5m 5s
Downloaded: 3044 files, 1.1G in 1h 4m 34s (311 KB/s)

4.. There are many FTP site [3] of the Debian for you.

North America

ftp.us.debian.org/debian
http.us.debian.org/debian
ftp.debian.org/debian
ftp.ca.debian.org/debian
ftp.mx.debian.org/debian

South America

ftp.br.debian.org/debian
ftp.cl.debian.org/debian
download.unesp.br/linux/debian
sft.if.usp.br/debian
debian.torredehanoi.org/debian

Asia

ftp.cn.debian.org/debian
ftp.jp.debian.org/debian
ftp.kr.debian.org/debian
ftp.hk.debian.org/debian
ftp.tw.debian.org/debian

Africa

debian.mirror.ac.za/debian

Europe

ftp.de.debian.org/debian
ftp.at.debian.org/debian
ftp.bg.debian.org/debian
ftp.ch.debian.org/debian
ftp.cz.debian.org/debian
ftp.dk.debian.org/debian
ftp.ee.debian.org/debian
ftp.es.debian.org/debian
ftp.fi.debian.org/debian
ftp.fr.debian.org/debian
ftp.hr.debian.org/debian
ftp.hu.debian.org/debian
ftp.ie.debian.org/debian
ftp.is.debian.org/debian
ftp.it.debian.org/debian
ftp.lt.debian.org/debian
ftp.nl.debian.org/debian
ftp.no.debian.org/debian
ftp.pl.debian.org/debian
ftp.ro.debian.org/debian
ftp.ru.debian.org/debian
ftp.se.debian.org/debian
ftp.si.debian.org/debian
ftp.tr.debian.org/debian
ftp.uk.debian.org/debian

Oceania

ftp.au.debian.org/debian
ftp.wa.au.debian.org/debian
ftp.nz.debian.org/debian

Exception

1.. If you are feeling too much files and that you mess up. You want to delete some files, but you are still to keep other files. You should use this command called 'find'. It is a very useful tool that helping filter files and deleting files as you don't need.
In this case, you don't need suffix of file name, such as 'i386.deb', 'ia64.deb', 'mips.deb', mipsel.deb', 'powerpc.deb', 'sparc.deb', 'armel.deb', 'ppc64el.deb' and 'arm64.deb'. You could be doing those instructions as below. The 'find' will be to do recursive whole sub-directories and executing your command-line as 'rm -rf'.

$ find . -name "*i386.deb" -exec rm -rf {} \;
$ find . -name "*ia64.deb" -exec rm -rf {} \;
$ find . -name "*mips.deb" -exec rm -rf {} \;
$ find . -name "*mipsel.deb" -exec rm -rf {} \;
$ find . -name "*powerpc.deb" -exec rm -rf {} \;
$ find . -name "*sparc.deb" -exec rm -rf {} \;
$ find . -name "*armel.deb" -exec rm -rf {} \;
$ find . -name "*ppc64el.deb" -exec rm -rf {} \;
$ find . -name "*arm64.deb" -exec rm -rf {} \;

Acknowledge

Thank you (Google, Debian, GNU, Computer Hope) very much for this great methods.

Popular Posts

波蘭文學習之旅:1-1. 波蘭文字母與發音(注音版)

最佳化處理策略之快速消除扭曲演算法

Python 日期與時間的處理

波蘭文學習之旅:1-1. 波蘭文字母與發音(注音版)

Image

最佳化處理策略之快速消除扭曲演算法

Image

Python 日期與時間的處理

Image

Visual Basic 6.0 程式案例學習: 10. 條碼列印程式 (2014版)

Image

Visual Basic .Net 程式案例學習: 06. 題庫測驗系統 (2014版)

Image

修復損毀的 SQLite DB 資料庫

Image

用10種程式語言做影像二值化(Image binarization)

Image

解決 ValueError: If using all scalar values, you must pass an index

Image

Visual Basic 6.0 程式案例學習: 04. 人事考勤管理系統 (2014版)

Image

Visual Basic 6.0 程式案例學習: 07. 收據列印程式 (2014版)

Image

佑佑的 Line 貼圖創作

貼圖作者網址:

https://line.me/S/shop/sticker/author/3883362

靜態貼圖

 
 
 
 
  牡羊座:狗狗角色

作者:佑佑
依照牡羊座的個性優點、個性缺點、生活習慣、理財習慣、社交習慣、愛情觀、節假日、禮貌問候,所編撰的貼圖。星座只能當參考用,不會完全準確。
購買貼圖
  金牛座:兔兔角色

作者:佑佑
依照金牛座的個性優點、個性缺點、生活習慣、理財習慣、社交習慣、愛情觀、節假日、禮貌問候,所編撰的貼圖。星座只能當參考用,不會完全準確。
購買貼圖
  雙子座:貓貓角色

作者:佑佑
依照雙子座的個性優點、個性缺點、生活習慣、理財習慣、社交習慣、愛情觀、節假日、禮貌問候,所編撰的貼圖。星座只能當參考用,不會完全準確。
購買貼圖
  巨蟹座:倉鼠角色

作者:佑佑
依照巨蟹座的個性優點、個性缺點、生活習慣、理財習慣、社交習慣、愛情觀、節假日、禮貌問候,所編撰的貼圖。星座只能當參考用,不會完全準確。
購買貼圖
 
 
 
 
  獅子座:幼獅角色

作者:佑佑
依照獅子座的個性優點、個性缺點、生活習慣、理財習慣、社交習慣、愛情觀、節假日、禮貌問候,所編撰的貼圖。星座只能當參考用,不會完全準確。
購買貼圖
  處女座:松鼠角色

作者:佑佑
依照處女座的個性優點、個性缺點、生活習慣、理財習慣、社交習慣、愛情觀、節假日、禮貌問候,所編撰的貼圖。星座只能當參考用,不會完全準確。
購買貼圖
  天秤座:鴿子角色

作者:佑佑
依照天秤座的個性優點、個性缺點、生活習慣、理財習慣、社交習慣、愛情觀、節假日、禮貌問候,所編撰的貼圖。星座只能當參考用,不會完全準確。
購買貼圖
  天蠍座:鳳凰角色

作者:佑佑
依照天蠍座的個性優點、個性缺點、生活習慣、理財習慣、社交習慣、愛情觀、節假日、禮貌問候,所編撰的貼圖。星座只能當參考用,不會完全準確。
購買貼圖
 
 
 
 
  射手座:人馬角色

作者:佑佑
依照射手座的個性優點、個性缺點、生活習慣、理財習慣、社交習慣、愛情觀、節假日、禮貌問候,所編撰的貼圖。星座只能當參考用,不會完全準確。
購買貼圖
  魔羯座:山羊角色

作者:佑佑
依照魔羯座的個性優點、個性缺點、生活習慣、理財習慣、社交習慣、愛情觀、節假日、禮貌問候,所編撰的貼圖。星座只能當參考用,不會完全準確。
購買貼圖
  水瓶座:海豚角色

作者:佑佑
依照水瓶座的個性優點、個性缺點、生活習慣、理財習慣、社交習慣、愛情觀、節假日、禮貌問候,所編撰的貼圖。星座只能當參考用,不會完全準確。
購買貼圖
  雙魚座:小丑魚角色

作者:佑佑
依照雙魚座的個性優點、個性缺點、生活習慣、理財習慣、社交習慣、愛情觀、節假日、禮貌問候,所編撰的貼圖。星座只能當參考用,不會完全準確。
購買貼圖
 
 
 
 
  上班族都變成狒狒,心裡想要說的話。

作者:佑佑
最近在台灣走紅的狒狒,用擬人化的方式,變成上班族,畫出心裡的想說的話。
購買貼圖
  接案派遣的日常

作者:佑佑
接案派遣到其他公司的日常對話,有調皮、正經、日常對話。
購買貼圖
  貓女事務員的搞笑時刻

作者:佑佑
把行政人員在職場上遇到千奇百怪的事情畫出來,用可愛的貓女來擔任行政人員的代言人。
購買貼圖
  貓貓說每天都會用到的話

作者:佑佑
日常生活常見的短句,用小貓擬人化的方式呈現,比較親切可愛。
購買貼圖
 
     
  大人的煩惱特輯:小兔角色

作者:佑佑
錢包餓了,生活苦了。變美變健康?先讓我睡飽吧。心好累,我需要充電。
購買貼圖
     

動態貼圖

 
 
 
 
  牡羊座日常交際:狗狗角色

作者:佑佑
依照牡羊座的個性,描繪日常生活的行為,供交際表達心情使用。星座只能當參考用,不會完全準確。
購買貼圖
  金牛座日常交際:兔兔角色

作者:佑佑
依照金牛座的個性,描繪日常生活的行為,供交際表達心情使用。星座只能當參考用,不會完全準確。
購買貼圖
  雙子座日常交際:貓貓角色

作者:佑佑
依照雙子座的個性,描繪日常生活的行為,供交際表達心情使用。星座只能當參考用,不會完全準確。
購買貼圖
  巨蟹座日常交際:倉鼠角色

作者:佑佑
依照巨蟹座的個性,描繪日常生活的行為,供交際表達心情使用。星座只能當參考用,不會完全準確。
購買貼圖
 
 
 
 
  獅子座日常交際:幼獅角色

作者:佑佑
依照獅子座的個性,描繪日常生活的行為,供交際表達心情使用。星座只能當參考用,不會完全準確。
購買貼圖
  處女座日常交際:松鼠角色

作者:佑佑
依照處女座的個性,描繪日常生活的行為,供交際表達心情使用。星座只能當參考用,不會完全準確。
購買貼圖
  天秤座日常交際:鴿子角色

作者:佑佑
依照天秤座的個性,描繪日常生活的行為,供交際表達心情使用。星座只能當參考用,不會完全準確。
購買貼圖
  天蠍座日常交際:鳳凰角色

作者:佑佑
依照天蠍座的個性,描繪日常生活的行為,供交際表達心情使用。星座只能當參考用,不會完全準確。
購買貼圖
 
 
 
 
  射手座日常交際:人馬角色

作者:佑佑
依照射手座的個性,描繪日常生活的行為,供交際表達心情使用。星座只能當參考用,不會完全準確。
購買貼圖
  魔羯座日常交際:山羊角色

作者:佑佑
依照魔羯座的個性,描繪日常生活的行為,供交際表達心情使用。星座只能當參考用,不會完全準確。
購買貼圖
  水瓶座日常交際:海豚角色

作者:佑佑
依照水瓶座的個性,描繪日常生活的行為,供交際表達心情使用。星座只能當參考用,不會完全準確。
購買貼圖
  雙魚座日常交際:小丑魚角色

作者:佑佑
依照雙魚座的個性,描繪日常生活的行為,供交際表達心情使用。星座只能當參考用,不會完全準確。
購買貼圖
 
     
  厭世報:鬍渣男

作者:佑佑
厭世總有個理由跟原因,實在是令人不爽,為什麼最倒楣的總是我?真希望明天就是世界末日,讓大家都一樣慘。
購買貼圖
     

表情貼

 
 
 
 
  貓貓說每天都用得到的表情貼

作者:佑佑
日常生活常見的表情用語,用小貓擬人化的方式呈現,比較親切可愛。
購買貼圖
  天秤座的表情貼:鴿子角色

作者:佑佑
日常生活常見的表情用語,天秤座的鴿子擬人化方式呈現,比較親切可愛。
購買貼圖
  天蠍座的表情貼:鳳凰角色

作者:佑佑
日常生活常見的表情用語,天蠍座的鳳凰擬人化方式呈現,比較親切可愛。
購買貼圖
  射手座的表情貼:人馬角色

作者:佑佑
日常生活常見的表情用語,射手座的人馬擬人化方式呈現,比較親切可愛。
購買貼圖
 
 
 
 
  魔羯座的表情貼:山羊角色

作者:佑佑
日常生活常見的表情用語,魔羯座的山羊擬人化方式呈現,比較親切可愛。
購買貼圖
  水瓶座的表情貼:海豚角色

作者:佑佑
日常生活常見的表情用語,水瓶座的海豚擬人化方式呈現,比較親切可愛。
購買貼圖
  雙魚座的表情貼:小丑魚角色

作者:佑佑
日常生活常見的表情用語,雙魚座的小丑魚擬人化方式呈現,比較親切可愛。
購買貼圖