GNU/Linux >> Belajar Linux >  >> Linux

Unduh file melalui baris perintah di Linux

Ada kalanya Anda harus mengunduh file dari baris perintah. Di sebagian besar distribusi, Anda memiliki dua alat – wget dan ikal .

wget

Ini adalah perintah yang sangat kuat untuk mengunduh file. Cukup gunakan URL wget untuk mengunduh file ke lokasi saat ini:

root@web [/]# wget  https://ip.plothost.com/test
--2020-01-19 06:11:50--  https://ip.plothost.com/test
Resolving ip.plothost.com (ip.plothost.com)... 104.10.10.155
Connecting to ip.plothost.com (ip.plothost.com)|104.10.10.155|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 94371840 (90M)
Saving to: 'test'

100%[==============================================================================================================================>] 94,371,840  11.2MB/s   in 8.3s

2020-01-19 06:11:58 (10.9 MB/s) - 'test' saved [94371840/94371840]

root@web [/]#

Untuk menggunakan nama file khusus, perintahnya adalah wget URL -O nama file .

ikal

Dengan perintah curl, Anda bisa mendapatkan konten file atau mengunduh file. Untuk mendapatkan konten file, gunakan URL ikal :

root@web [~]# curl https://ip.plothost.com/testfile.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<TITLE>Test file PlotHost.com</TITLE>
</HEAD>


<BODY bgcolor="#EFEFEF">
Testing ...
</BODY></HTML>
root@web [~]#

Untuk mengunduh file, URL ikal -o nama file

root@web [/]# curl https://ip.plothost.com/test -o test_file
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 90.0M  100 90.0M    0     0  10.5M      0  0:00:08  0:00:08 --:--:-- 11.1M
root@web [/]#

Sumber daya:
halaman manual wget
halaman manual curl


Linux
  1. 8 tips untuk baris perintah Linux

  2. Miliki sapi di baris perintah Linux

  3. 4 alat untuk mengunduh file apa pun menggunakan baris perintah di Linux

  1. Masukkan diri Anda ke dalam baris perintah Linux

  2. Bagaimana Cara Menghasilkan Gambar Cmyk Melalui Baris Perintah Di Linux?

  3. Buat file dengan menggunakan baris perintah di Linux

  1. 4 Alat penurunan harga untuk baris perintah Linux

  2. Migrasi server Linux dari baris perintah

  3. Mainkan file MP3 atau WAV melalui baris perintah Linux