Wednesday, September 27, 2023
rated 0 times [  8] [ 0]  / answers: 1 / hits: 601  / 2 Years ago, sun, march 27, 2022, 9:16:12

Whenever I was to store something to show someone here, I run

command-with-output | pastebinit.

That returns the link to the paste online. For example:

echo sometext | pastebinit

gave me the link

Which I can share. How can I do this with a file - for example a log file. Surely I don't have to open - > copy all - > open -> paste it?

More From » command-line


cat is the command to do that:

cat filename | pastebinit

From man cat:

cat - concatenate files and print on the standard output

    -A, --show-all
equivalent to -vET
-b, --number-nonblank
number nonempty output lines
-e equivalent to -vE
-E, --show-ends
display $ at end of each line
-n, --number
number all output lines
-s, --squeeze-blank
suppress repeated empty output lines
-t equivalent to -vT
-T, --show-tabs
display TAB characters as ^I
-v, --show-nonprinting
use ^ and M- notation, except for LFD and TAB

With no FILE, or when FILE is -, read standard input.

[#23537] Monday, March 28, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.

Total Points: 121
Total Questions: 108
Total Answers: 107

Location: United States Minor Outlying Island
Member since Sat, May 28, 2022
1 Year ago
ideobedi questions