Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6743839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:00:38+00:00 2026-05-26T12:00:38+00:00

Can someone please explain me how to use > and | in linux commands

  • 0

Can someone please explain me how to use “>” and “|” in linux commands and convert me these three lines into one line of code please?

mysqldump --user=*** --password=*** $db --single-transaction -R > ${db}-$(date +%m-%d-%y).sql
tar -cf ${db}-$(date +%m-%d-%y).sql.tar ${db}-$(date +%m-%d-%y).sql
gzip ${db}-$(date +%m-%d-%y).sql.tar
rm ${db}-$(date +%m-%d-%y).sql (after conversion I guess this line will be useless)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:00:38+00:00Added an answer on May 26, 2026 at 12:00 pm

    The GNU tar program can itself do the compression normally done by gzip. You can use the -z flag to enable this. So the tar and gzip could be combined into:

    tar -zcf ${db}-$(date +%m-%d-%y).sql.tar.gz ${db}-$(date +%m-%d-%y).sql
    

    Getting tar to read from standard input for archiving is not a simple task but I would question its necessity in this particular case.

    The intent of tar is to be able to package up a multitude of files into a single archive file but, since it’s only one file you’re processing (the output stream from mysqldump), you don’t need to tar it up, you can just pipe it straight into gzip itself:

    mysqldump blah blah | gzip > ${db}-$(date +%m-%d-%y).sql.gz
    

    That’s because gzip will compress standard input to standard output if you don’t give it any file names.

    This removes the need for any (possibly very large) temporary files during the compression process.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can someone please explain what does the following line of code exactly do? If
Can someone please explain the functions of these three instructions? ORG 1000H MOV AX,CS
Can someone please explain what's the real use of a Tuple ?
Can someone please explain what really goes on in this code ? If I
Can someone please explain the use of XA dataSource and how transaction management works
Can someone please explain the structure of this line of a script for me?
Can someone please explain these functions: RequestHandlerComponent::renderAs() RequestHandlerComponent::respondAs() RequestHandlerComponent::setContent() It feels slightly redundant to
Obviously I'm new to as3...Can someone please explain to me how I can use
Can someone please explain how JAR files and the Java class loader make use
Can someone please explain when and why use commit? http://msdn.microsoft.com/en-us/library/ms190295.aspx . 1) Update in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.