linux壓縮和解壓縮_Linux QuickTip:一步下載和解壓縮

linux壓縮和解壓縮

linux壓縮和解壓縮

Most of the time, when I download something it’s a file archive of some kind – usually a tarball or a zip file. This could be some source code for an app that isn’t included in Gentoo’s Portage tree, some documentation for an internal corporate app, or even something as mundane as a new WordPress installation.

大多數時候,當我下載某些東西時,它是某種文件存檔-通常是tarball或zip文件。 這可能是Gentoo的Portage樹中未包含的某個應用程序的源代碼,內部公司應用程序的一些文檔,甚至可能是與新的WordPress安裝一樣平凡的東西。

The traditional way of downloading and untarring something in the terminal would be something like this:

在終端中下載和解壓縮某些內容的傳統方式如下:

wget http://wordpress.org/latest.tar.gz

wget http://wordpress.org/latest.tar.gz

tar xvzf latest.tar.gz

tar xvzf Latest.tar.gz

rm latest.tar.gz

rm Latest.tar.gz

Or perhaps the more compact form:

或者更緊湊的形式:

wget http://wordpress.org/latest.tar.gz && tar xvzf latest.tar.gz && rm latest.tar.gz

wget http://wordpress.org/latest.tar.gz && tar xvzf Latest.tar.gz && rm Latest.tar.gz

Either way is a bit clumsy. This is a very simple operation, a powerful shell like bash should allow such a task to be performed in a more “slick” manner.

兩種方法都比較笨拙。 這是一個非常簡單的操作,像bash這樣的功能強大的shell應該允許以“更流暢”的方式執行此類任務。

Well, thanks to a useful little command “curl”, we can actually accomplish the mess above in just one piped statement:

好吧,多虧了一個有用的小命令“ curl”,我們實際上可以在一個管道語句中完成上述混亂:

curl http://wordpress.org/latest.tar.gz | tar xvz

卷曲http://wordpress.org/latest.tar.gz | 焦油xvz

No temporary files to get rid of, no messing around with ampersands. In short, a highly compact, efficient command. In fact, from a theoretical standpoint, the curl method can be faster than the concatenated wget/tar/rm mess since stdout piping will use RAM as a buffer if possible, whereas wget and tar (with the -f switch) must read/write directly from a disk.

沒有要刪除的臨時文件,也沒有與“&”號混為一談。 簡而言之,是一種高度緊湊,高效的命令。 實際上,從理論上講,curl方法可能比連接的wget / tar / rm混亂更快,因為如果可能,stdout管道將使用RAM作為緩沖區,而wget和tar(使用-f開關)必須讀/寫直接從磁盤。

Incidentally, tar with the -v option (the way we’re using it in all the above examples) prints each file name to stdout as each is untarred. This can get in the way of curl’s nice, ncurses output showing download status. We can silence tar by invoking it without -v thusly:

順便說一句,帶有-v選項的tar(在以上所有示例中,我們都使用它的方式)將每個文件名打印到stdout,因為每個文件都未解壓縮。 這可能會妨礙curl的顯示,ncurses輸出顯示下載狀態。 我們可以通過不帶-v的方式調用tar來使其靜音:

curl http://wordpress.org/latest.tar.gz | tar xz

卷曲http://wordpress.org/latest.tar.gz | 焦油xz

And that’s all there is to it!

這就是全部!

翻譯自: https://www.howtogeek.com/howto/uncategorized/linux-quicktip-downloading-and-un-tarring-in-one-step/

linux壓縮和解壓縮

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/278723.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/278723.shtml
英文地址,請注明出處:http://en.pswp.cn/news/278723.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

Spark架構與作業執行流程簡介

2019獨角獸企業重金招聘Python工程師標準>>> Spark架構與作業執行流程簡介 博客分類: spark Local模式 運行Spark最簡單的方法是通過Local模式(即偽分布式模式)。 運行命令為:./bin/run-example org.apache.spark.exam…

Spring boot整合Mongodb

最近的項目用了Mongodb,網上的用法大多都是七零八落的沒有一個統一性,自己大概整理了下,項目中的相關配置就不敘述了,由于spring boot的快捷開發方式,所以spring boot項目中要使用Mongodb,只需要添加依賴和…

nodejs和Vue和Idea

文章目錄Vue環境搭建Idea安裝Idea中配置Vue環境Node.js介紹npm介紹Vue.js介紹[^3]Idea介紹Vue環境搭建 概述:vue環境搭建:需要npm(cnpm),而npm內嵌于Node.js,所以需要下載Node.js。 下載Node.js&#xff1…

Spring MVC上下文父子容器

2019獨角獸企業重金招聘Python工程師標準>>> Spring MVC上下文父子容器 博客分類: java spring 在Spring MVC的啟動依賴Spring框架,有時候我們在啟動Spring MVC環境的時候,如果配置不當的話會造成一些不可預知的結果。下面主要介紹…

12.7 Test

目錄 2018.12.7 TestA 序列sequence(迭代加深搜索)B 轟炸bomb(Tarjan DP)C 字符串string(AC自動機 狀壓DP)考試代碼AC2018.12.7 Test題目為2018.1.4雅禮集訓。 時間:4.5h期望得分:010010實際得分:010010 A 序列sequence(迭代加深搜索) 顯然可…

word文檔中統計總頁數_如何在Google文檔中查找頁數和字數統計

word文檔中統計總頁數Whether you’ve been given an assignment with a strict limit or you just like knowing how many words you’ve written, Google Docs has your back. Here’s how to see exactly how many words or pages you’ve typed in your document. 無論您是…

vue 入門notes

文章目錄vue一、js基礎二、封裝緩存三、組件1、組件創建、引入、掛載、使用2、組件間的傳值- 父組件主動獲取子組件的數據和方法(子組件給父組件傳值):- 子組件主動獲取父組件的數據和方法(父組件給子組件傳值)&#x…

spring集成 JedisCluster 連接 redis3.0 集群

2019獨角獸企業重金招聘Python工程師標準>>> spring集成 JedisCluster 連接 redis3.0 集群 博客分類&#xff1a; 緩存 spring 客戶端采用最新的jedis 2.7 1. maven依賴&#xff1a; <dependency> <groupId>redis.clients</groupId> <artifact…

html-盒子模型及pading和margin相關

margin: <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><title>Title</title><style>* {margin: 0;padding: 0;}/*margin 外邊距 元素與其他元素的距離&#xff08;邊框以外的距離&#xff09;一…

火狐瀏覽器復制網頁文字_從Firefox中的網頁鏈接的多種“復制”格式中選擇

火狐瀏覽器復制網頁文字Tired of having to copy, paste, and then format links for use in your blogs, e-mails, or documents? Then see how easy it is to choose a click-and-go format that will save you a lot of time and effort with the CoLT extension for Firef…

vscode配置、使用git

文章目錄一、下載、配置git二、vscode配置并使用git三、記住密碼一、下載、配置git 1、git-win-x64點擊下載后安裝直接安裝&#xff08;建議復制鏈接用迅雷等下載器下載&#xff0c;瀏覽器太慢&#xff0c;記住安裝位置&#xff09;。 2、配置git環境變量&#xff1a; 右鍵 此…

BTrace功能

2019獨角獸企業重金招聘Python工程師標準>>> BTrace功能 一、背景 在生產環境中可能經常遇到各種問題&#xff0c;定位問題需要獲取程序運行時的數據信息&#xff0c;如方法參數、返回值、全局變量、堆棧信息等。為了獲取這些數據信息&#xff0c;我們可以…

.NET(c#) 移動APP開發平臺 - Smobiler(1)

原文&#xff1a;https://www.cnblogs.com/oudi/p/8288617.html 如果說基于.net的移動開發平臺&#xff0c;目前比較流行的可能是xamarin了&#xff0c;不過除了這個&#xff0c;還有一個比xamarin更好用的國內的.net移動開發平臺&#xff0c;smobiler&#xff0c;不用學習另外…

如何在Vizio電視上禁用運動平滑

Vizio維齊奧New Vizio TVs use motion smoothing to make the content you watch appear smoother. This looks good for some content, like sports, but can ruin the feel of movies and TV shows. 新的Vizio電視使用運動平滑來使您觀看的內容顯得更平滑。 這對于某些內容(例…

無服務器架構 - 從使用場景分析其6大特性

2019獨角獸企業重金招聘Python工程師標準>>> 無服務器架構 - 從使用場景分析其6大特性 博客分類&#xff1a; 架構 首先我應該提到&#xff0c;“無服務器”技術肯定有服務器涉及。 我只是使用這個術語來描述這種方法和技術&#xff0c;它將任務處理和調度抽象為與…

ES6實用方法Object.assign、defineProperty、Symbol

文章目錄1.合并對象 - Object.assign()介紹進階注意用途2.定義對象 - Object.defineProperty(obj, prop, descriptor)3.新數據類型- Symbol定義應用1.合并對象 - Object.assign() 介紹 assign方法可以將多個對象&#xff08;字典&#xff09;&#xff0c;語法&#xff1a;Obj…

Enable Authentication on MongoDB

1、Connect to the server using the mongo shell mongo mongodb://localhost:270172、Create the user administrator Change to the admin database: use admindb.createUser({user: "Admin",pwd: "Admin123",roles: [ { role: "userAdminAnyDataba…

windows驅動程序編寫_如何在Windows中回滾驅動程序

windows驅動程序編寫Updating a driver on your PC doesn’t always work out well. Sometimes, they introduce bugs or simply don’t run as well as the version they replaced. Luckily, Windows makes it easy to roll back to a previous driver in Windows 10. Here’s…

運行tomcat報Exception in thread ContainerBackgroundProcessor[StandardEngine[Catalina]]

解決方法1&#xff1a; 手動設置MaxPermSize大小&#xff0c;如果是linux系統&#xff0c;修改TOMCAT_HOME/bin/catalina.sh&#xff0c;如果是windows系統&#xff0c;修改TOMCAT_HOME/bin/catalina.bat&#xff0c; 在“echo "Using CATALINA_BASE: $CATALINA_BASE&q…

new子類會先運行父類的構造函數

發現子類構造函數運行時&#xff0c;先運行了父類的構造函數。為什么呢? 原因&#xff1a;子類的所有構造函數中的第一行&#xff0c;其實都有一條隱身的語句super(); super(): 表示父類的構造函數&#xff0c;并會調用于參數相對應的父類中的構造函數。而super():是在調用父類…