tar contents in current directory to stdoutExtract directory from wget's stdoutCreate a tar archive of the...

What do the novel titles of The Expanse series refer to?

How does Asimov's second law deal with contradictory orders from different people?

Gold Battle KoTH

Value of a limit.

What is the term for completing a route uncleanly?

How char is processed in math mode?

Scam? Checks via Email

Can machine learning learn a function like finding maximum from a list?

Applying for mortgage when living together but only one will be on the mortgage

Just how much information should you share with a former client?

How would a lunar colony attack Earth?

What Marvel character has this 'W' symbol?

Why “deal 6 damage” is a legit phrase?

Balancing Humanoid fantasy races: Elves

How to litter train a cat if both my husband and I work away from home all day?

How did Biff return to 2015 from 1955 without a lightning strike?

How should I save/invest for my son

Planting Trees in Outer Space

Using Python in a Bash Script

Should 2FA be enabled on service accounts?

Why are prop blades not shaped like household fan blades?

In the Schrödinger equation, can I have a Hamiltonian without a kinetic term?

How do I make my photos have more impact?

Given mean and SD, can we approximate the underlying distribution?



tar contents in current directory to stdout


Extract directory from wget's stdoutCreate a tar archive of the current directory without preceding periodtar unix not changing directoryExtracting a certain folder from a tarball - how do I tell it where to put the file once extracted?Extracting files to current directoryBrowse contents of .tarHow to tar all files in current directory using tar but without inputing names of tar file and all files?Move/transform everything from pwd into subdirectory while archiving with tarMake tar archive in parent directorytar a directory






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















I am trying to tar the current directory and stream to stdout (ultimately to Amazon S3)...I have this command:



tar  -cf -  . 


but I get this error:




tar: Refusing to write archive contents to terminal (missing -f
option?) tar: Error is not recoverable: exiting now




from what I can tell -f - means the file is to stdout, although -f /dev/stdout is probably more explicit.



does anyone know how to form the command correct?










share|improve this question




















  • 1





    Presumably you don't really want to stream the archive to your terminal - likely you will find that if you pipe it to another process it will be happy (for example, tar -cf - . | tar -tf -)

    – steeldriver
    1 hour ago











  • Have you tried tar -cf - . > /path/file.tar? /path/ can be anywhere so long as it is outside of ./

    – Jim L.
    1 hour ago













  • why wouldn't it work to stream to the terminal though? seems weird that this would fail but -f /dev/stdout would work

    – Alexander Mills
    1 hour ago











  • It does work on FreeBSD and Mac OS X, fwiw. But I can understand why the authors of tar might have thought it would be a relatively unlikely use case.

    – Jim L.
    59 mins ago













  • It might work if you use cf instead of -cf . What version of tar are you using?

    – Mark Plotnick
    55 mins ago


















0















I am trying to tar the current directory and stream to stdout (ultimately to Amazon S3)...I have this command:



tar  -cf -  . 


but I get this error:




tar: Refusing to write archive contents to terminal (missing -f
option?) tar: Error is not recoverable: exiting now




from what I can tell -f - means the file is to stdout, although -f /dev/stdout is probably more explicit.



does anyone know how to form the command correct?










share|improve this question




















  • 1





    Presumably you don't really want to stream the archive to your terminal - likely you will find that if you pipe it to another process it will be happy (for example, tar -cf - . | tar -tf -)

    – steeldriver
    1 hour ago











  • Have you tried tar -cf - . > /path/file.tar? /path/ can be anywhere so long as it is outside of ./

    – Jim L.
    1 hour ago













  • why wouldn't it work to stream to the terminal though? seems weird that this would fail but -f /dev/stdout would work

    – Alexander Mills
    1 hour ago











  • It does work on FreeBSD and Mac OS X, fwiw. But I can understand why the authors of tar might have thought it would be a relatively unlikely use case.

    – Jim L.
    59 mins ago













  • It might work if you use cf instead of -cf . What version of tar are you using?

    – Mark Plotnick
    55 mins ago














0












0








0








I am trying to tar the current directory and stream to stdout (ultimately to Amazon S3)...I have this command:



tar  -cf -  . 


but I get this error:




tar: Refusing to write archive contents to terminal (missing -f
option?) tar: Error is not recoverable: exiting now




from what I can tell -f - means the file is to stdout, although -f /dev/stdout is probably more explicit.



does anyone know how to form the command correct?










share|improve this question














I am trying to tar the current directory and stream to stdout (ultimately to Amazon S3)...I have this command:



tar  -cf -  . 


but I get this error:




tar: Refusing to write archive contents to terminal (missing -f
option?) tar: Error is not recoverable: exiting now




from what I can tell -f - means the file is to stdout, although -f /dev/stdout is probably more explicit.



does anyone know how to form the command correct?







bash shell tar






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 1 hour ago









Alexander MillsAlexander Mills

2,4542 gold badges21 silver badges67 bronze badges




2,4542 gold badges21 silver badges67 bronze badges











  • 1





    Presumably you don't really want to stream the archive to your terminal - likely you will find that if you pipe it to another process it will be happy (for example, tar -cf - . | tar -tf -)

    – steeldriver
    1 hour ago











  • Have you tried tar -cf - . > /path/file.tar? /path/ can be anywhere so long as it is outside of ./

    – Jim L.
    1 hour ago













  • why wouldn't it work to stream to the terminal though? seems weird that this would fail but -f /dev/stdout would work

    – Alexander Mills
    1 hour ago











  • It does work on FreeBSD and Mac OS X, fwiw. But I can understand why the authors of tar might have thought it would be a relatively unlikely use case.

    – Jim L.
    59 mins ago













  • It might work if you use cf instead of -cf . What version of tar are you using?

    – Mark Plotnick
    55 mins ago














  • 1





    Presumably you don't really want to stream the archive to your terminal - likely you will find that if you pipe it to another process it will be happy (for example, tar -cf - . | tar -tf -)

    – steeldriver
    1 hour ago











  • Have you tried tar -cf - . > /path/file.tar? /path/ can be anywhere so long as it is outside of ./

    – Jim L.
    1 hour ago













  • why wouldn't it work to stream to the terminal though? seems weird that this would fail but -f /dev/stdout would work

    – Alexander Mills
    1 hour ago











  • It does work on FreeBSD and Mac OS X, fwiw. But I can understand why the authors of tar might have thought it would be a relatively unlikely use case.

    – Jim L.
    59 mins ago













  • It might work if you use cf instead of -cf . What version of tar are you using?

    – Mark Plotnick
    55 mins ago








1




1





Presumably you don't really want to stream the archive to your terminal - likely you will find that if you pipe it to another process it will be happy (for example, tar -cf - . | tar -tf -)

– steeldriver
1 hour ago





Presumably you don't really want to stream the archive to your terminal - likely you will find that if you pipe it to another process it will be happy (for example, tar -cf - . | tar -tf -)

– steeldriver
1 hour ago













Have you tried tar -cf - . > /path/file.tar? /path/ can be anywhere so long as it is outside of ./

– Jim L.
1 hour ago







Have you tried tar -cf - . > /path/file.tar? /path/ can be anywhere so long as it is outside of ./

– Jim L.
1 hour ago















why wouldn't it work to stream to the terminal though? seems weird that this would fail but -f /dev/stdout would work

– Alexander Mills
1 hour ago





why wouldn't it work to stream to the terminal though? seems weird that this would fail but -f /dev/stdout would work

– Alexander Mills
1 hour ago













It does work on FreeBSD and Mac OS X, fwiw. But I can understand why the authors of tar might have thought it would be a relatively unlikely use case.

– Jim L.
59 mins ago







It does work on FreeBSD and Mac OS X, fwiw. But I can understand why the authors of tar might have thought it would be a relatively unlikely use case.

– Jim L.
59 mins ago















It might work if you use cf instead of -cf . What version of tar are you using?

– Mark Plotnick
55 mins ago





It might work if you use cf instead of -cf . What version of tar are you using?

– Mark Plotnick
55 mins ago










1 Answer
1






active

oldest

votes


















0














So this seemed to work:



tar  -cf /dev/stdout  .


but I am looking for a way to just omit the -f /dev/stdout part if possible.






share|improve this answer


























  • I am trying to stream to s3 not a file, and yeah I tried the -cf - bullshit in the OP and didn't work :(

    – Alexander Mills
    1 hour ago











  • As @steeldriver says, all will be well once you add a pipe. $ tar -cf - . | wc yields 242 676 40960 so something like `tar -cf - . | ssh s3.example.com tar -tf -' will work.

    – Jim L.
    51 mins ago













  • to stream to S3 you need to pipe it to a program that will copy STDIN to an S3 object. aws s3 cp /dev/stdin ... refuses to use /dev/stdin from a pipe. i might try to write a python script to do this.

    – Skaperen
    37 mins ago











  • as for tar, i do tar bcf 1 - <whatiwanttomakeatarof> all the time. or you can leave out the b and the 1 and make a slightly larger tarball. either way, you need to figure out where you want the tar data to go on your computer to get it to S3 (your terminal won't do that).

    – Skaperen
    30 mins ago














Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f533463%2ftar-contents-in-current-directory-to-stdout%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














So this seemed to work:



tar  -cf /dev/stdout  .


but I am looking for a way to just omit the -f /dev/stdout part if possible.






share|improve this answer


























  • I am trying to stream to s3 not a file, and yeah I tried the -cf - bullshit in the OP and didn't work :(

    – Alexander Mills
    1 hour ago











  • As @steeldriver says, all will be well once you add a pipe. $ tar -cf - . | wc yields 242 676 40960 so something like `tar -cf - . | ssh s3.example.com tar -tf -' will work.

    – Jim L.
    51 mins ago













  • to stream to S3 you need to pipe it to a program that will copy STDIN to an S3 object. aws s3 cp /dev/stdin ... refuses to use /dev/stdin from a pipe. i might try to write a python script to do this.

    – Skaperen
    37 mins ago











  • as for tar, i do tar bcf 1 - <whatiwanttomakeatarof> all the time. or you can leave out the b and the 1 and make a slightly larger tarball. either way, you need to figure out where you want the tar data to go on your computer to get it to S3 (your terminal won't do that).

    – Skaperen
    30 mins ago
















0














So this seemed to work:



tar  -cf /dev/stdout  .


but I am looking for a way to just omit the -f /dev/stdout part if possible.






share|improve this answer


























  • I am trying to stream to s3 not a file, and yeah I tried the -cf - bullshit in the OP and didn't work :(

    – Alexander Mills
    1 hour ago











  • As @steeldriver says, all will be well once you add a pipe. $ tar -cf - . | wc yields 242 676 40960 so something like `tar -cf - . | ssh s3.example.com tar -tf -' will work.

    – Jim L.
    51 mins ago













  • to stream to S3 you need to pipe it to a program that will copy STDIN to an S3 object. aws s3 cp /dev/stdin ... refuses to use /dev/stdin from a pipe. i might try to write a python script to do this.

    – Skaperen
    37 mins ago











  • as for tar, i do tar bcf 1 - <whatiwanttomakeatarof> all the time. or you can leave out the b and the 1 and make a slightly larger tarball. either way, you need to figure out where you want the tar data to go on your computer to get it to S3 (your terminal won't do that).

    – Skaperen
    30 mins ago














0












0








0







So this seemed to work:



tar  -cf /dev/stdout  .


but I am looking for a way to just omit the -f /dev/stdout part if possible.






share|improve this answer













So this seemed to work:



tar  -cf /dev/stdout  .


but I am looking for a way to just omit the -f /dev/stdout part if possible.







share|improve this answer












share|improve this answer



share|improve this answer










answered 1 hour ago









Alexander MillsAlexander Mills

2,4542 gold badges21 silver badges67 bronze badges




2,4542 gold badges21 silver badges67 bronze badges
















  • I am trying to stream to s3 not a file, and yeah I tried the -cf - bullshit in the OP and didn't work :(

    – Alexander Mills
    1 hour ago











  • As @steeldriver says, all will be well once you add a pipe. $ tar -cf - . | wc yields 242 676 40960 so something like `tar -cf - . | ssh s3.example.com tar -tf -' will work.

    – Jim L.
    51 mins ago













  • to stream to S3 you need to pipe it to a program that will copy STDIN to an S3 object. aws s3 cp /dev/stdin ... refuses to use /dev/stdin from a pipe. i might try to write a python script to do this.

    – Skaperen
    37 mins ago











  • as for tar, i do tar bcf 1 - <whatiwanttomakeatarof> all the time. or you can leave out the b and the 1 and make a slightly larger tarball. either way, you need to figure out where you want the tar data to go on your computer to get it to S3 (your terminal won't do that).

    – Skaperen
    30 mins ago



















  • I am trying to stream to s3 not a file, and yeah I tried the -cf - bullshit in the OP and didn't work :(

    – Alexander Mills
    1 hour ago











  • As @steeldriver says, all will be well once you add a pipe. $ tar -cf - . | wc yields 242 676 40960 so something like `tar -cf - . | ssh s3.example.com tar -tf -' will work.

    – Jim L.
    51 mins ago













  • to stream to S3 you need to pipe it to a program that will copy STDIN to an S3 object. aws s3 cp /dev/stdin ... refuses to use /dev/stdin from a pipe. i might try to write a python script to do this.

    – Skaperen
    37 mins ago











  • as for tar, i do tar bcf 1 - <whatiwanttomakeatarof> all the time. or you can leave out the b and the 1 and make a slightly larger tarball. either way, you need to figure out where you want the tar data to go on your computer to get it to S3 (your terminal won't do that).

    – Skaperen
    30 mins ago

















I am trying to stream to s3 not a file, and yeah I tried the -cf - bullshit in the OP and didn't work :(

– Alexander Mills
1 hour ago





I am trying to stream to s3 not a file, and yeah I tried the -cf - bullshit in the OP and didn't work :(

– Alexander Mills
1 hour ago













As @steeldriver says, all will be well once you add a pipe. $ tar -cf - . | wc yields 242 676 40960 so something like `tar -cf - . | ssh s3.example.com tar -tf -' will work.

– Jim L.
51 mins ago







As @steeldriver says, all will be well once you add a pipe. $ tar -cf - . | wc yields 242 676 40960 so something like `tar -cf - . | ssh s3.example.com tar -tf -' will work.

– Jim L.
51 mins ago















to stream to S3 you need to pipe it to a program that will copy STDIN to an S3 object. aws s3 cp /dev/stdin ... refuses to use /dev/stdin from a pipe. i might try to write a python script to do this.

– Skaperen
37 mins ago





to stream to S3 you need to pipe it to a program that will copy STDIN to an S3 object. aws s3 cp /dev/stdin ... refuses to use /dev/stdin from a pipe. i might try to write a python script to do this.

– Skaperen
37 mins ago













as for tar, i do tar bcf 1 - <whatiwanttomakeatarof> all the time. or you can leave out the b and the 1 and make a slightly larger tarball. either way, you need to figure out where you want the tar data to go on your computer to get it to S3 (your terminal won't do that).

– Skaperen
30 mins ago





as for tar, i do tar bcf 1 - <whatiwanttomakeatarof> all the time. or you can leave out the b and the 1 and make a slightly larger tarball. either way, you need to figure out where you want the tar data to go on your computer to get it to S3 (your terminal won't do that).

– Skaperen
30 mins ago


















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f533463%2ftar-contents-in-current-directory-to-stdout%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Hudson River Historic District Contents Geography History The district today Aesthetics Cultural...

The number designs the writing. Feandra Aversely Definition: The act of ingrafting a sprig or shoot of one...

Ayherre Geografie Demografie Externe links Navigatiemenu43° 23′ NB, 1° 15′ WL43° 23′ NB, 1°...