Writing file to specific USB deviceWhat are the shell's control and redirection operators?How can I assign the output of a command to a shell variable?Two usb wifi adapaters, only wlan0 appears, how to get wlan1?Mounting USB drive on 3G dongleVirtual USB HID deviceAdding USB device to rules.ddisabling usb device debianusb: device descriptor read/64, error -110How do I mount USB CDROM DriveSpecify Function on USB DeviceAccess to USB device deniedIs it necessary to explicitly flush the HDD on-disk write caches?

Can a virus destroy the BIOS of a modern computer?

Why was Sir Cadogan fired?

How does a dynamic QR code work?

Was the old ablative pronoun "med" or "mēd"?

How to show a landlord what we have in savings?

Ambiguity in the definition of entropy

How to prevent "they're falling in love" trope

Avoiding the "not like other girls" trope?

Is there an expression that means doing something right before you will need it rather than doing it in case you might need it?

Is this answer explanation correct?

Knowledge-based authentication using Domain-driven Design in C#

Notepad++ delete until colon for every line with replace all

How seriously should I take size and weight limits of hand luggage?

Fair gambler's ruin problem intuition

What is the fastest integer factorization to break RSA?

How exploitable/balanced is this homebrew spell: Spell Permanency?

How to remove border from elements in the last row?

What exactly is ineptocracy?

Is there a hemisphere-neutral way of specifying a season?

How to compactly explain secondary and tertiary characters without resorting to stereotypes?

In Bayesian inference, why are some terms dropped from the posterior predictive?

Car headlights in a world without electricity

Description list Formatting using enumitem

GFCI outlets - can they be repaired? Are they really needed at the end of a circuit?



Writing file to specific USB device


What are the shell's control and redirection operators?How can I assign the output of a command to a shell variable?Two usb wifi adapaters, only wlan0 appears, how to get wlan1?Mounting USB drive on 3G dongleVirtual USB HID deviceAdding USB device to rules.ddisabling usb device debianusb: device descriptor read/64, error -110How do I mount USB CDROM DriveSpecify Function on USB DeviceAccess to USB device deniedIs it necessary to explicitly flush the HDD on-disk write caches?













0















I am looking to write the output of



cat /var/log/dpkg.log


to a file rather than viewing on the screen.



I have tried



cat /var/log/dpkg.log | file.txt


without any success.



Ultimately I want this command and



dmesg -T


to run automatically from a batch from a usb.



The usb has the "ID" of 0782:5551. Is it possible to get the "file.txt" (with the date and time included in filename) to be written to that same USB drive via it's "ID" since it could any "device' depending on its order?



The purpose of this is for a project to ultimately compare the file based on dates.










share|improve this question
























  • You seem to have 3 questions here: how to re-direct stdout, how to address a usb storage device, howe to put a date in a file-name. (We have a one question per question policy. But as many questions as you like.)

    – ctrl-alt-delor
    Nov 10 '18 at 13:45











  • The first question is a duplicate of What are the shell's control and redirection operators? The third question is a duplicate of How can I assign the output of a command to a shell variable?

    – G-Man
    2 days ago















0















I am looking to write the output of



cat /var/log/dpkg.log


to a file rather than viewing on the screen.



I have tried



cat /var/log/dpkg.log | file.txt


without any success.



Ultimately I want this command and



dmesg -T


to run automatically from a batch from a usb.



The usb has the "ID" of 0782:5551. Is it possible to get the "file.txt" (with the date and time included in filename) to be written to that same USB drive via it's "ID" since it could any "device' depending on its order?



The purpose of this is for a project to ultimately compare the file based on dates.










share|improve this question
























  • You seem to have 3 questions here: how to re-direct stdout, how to address a usb storage device, howe to put a date in a file-name. (We have a one question per question policy. But as many questions as you like.)

    – ctrl-alt-delor
    Nov 10 '18 at 13:45











  • The first question is a duplicate of What are the shell's control and redirection operators? The third question is a duplicate of How can I assign the output of a command to a shell variable?

    – G-Man
    2 days ago













0












0








0








I am looking to write the output of



cat /var/log/dpkg.log


to a file rather than viewing on the screen.



I have tried



cat /var/log/dpkg.log | file.txt


without any success.



Ultimately I want this command and



dmesg -T


to run automatically from a batch from a usb.



The usb has the "ID" of 0782:5551. Is it possible to get the "file.txt" (with the date and time included in filename) to be written to that same USB drive via it's "ID" since it could any "device' depending on its order?



The purpose of this is for a project to ultimately compare the file based on dates.










share|improve this question
















I am looking to write the output of



cat /var/log/dpkg.log


to a file rather than viewing on the screen.



I have tried



cat /var/log/dpkg.log | file.txt


without any success.



Ultimately I want this command and



dmesg -T


to run automatically from a batch from a usb.



The usb has the "ID" of 0782:5551. Is it possible to get the "file.txt" (with the date and time included in filename) to be written to that same USB drive via it's "ID" since it could any "device' depending on its order?



The purpose of this is for a project to ultimately compare the file based on dates.







command-line usb






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 days ago









рüффп

78341630




78341630










asked Nov 10 '18 at 13:40









Andy ArnoldsAndy Arnolds

1




1












  • You seem to have 3 questions here: how to re-direct stdout, how to address a usb storage device, howe to put a date in a file-name. (We have a one question per question policy. But as many questions as you like.)

    – ctrl-alt-delor
    Nov 10 '18 at 13:45











  • The first question is a duplicate of What are the shell's control and redirection operators? The third question is a duplicate of How can I assign the output of a command to a shell variable?

    – G-Man
    2 days ago

















  • You seem to have 3 questions here: how to re-direct stdout, how to address a usb storage device, howe to put a date in a file-name. (We have a one question per question policy. But as many questions as you like.)

    – ctrl-alt-delor
    Nov 10 '18 at 13:45











  • The first question is a duplicate of What are the shell's control and redirection operators? The third question is a duplicate of How can I assign the output of a command to a shell variable?

    – G-Man
    2 days ago
















You seem to have 3 questions here: how to re-direct stdout, how to address a usb storage device, howe to put a date in a file-name. (We have a one question per question policy. But as many questions as you like.)

– ctrl-alt-delor
Nov 10 '18 at 13:45





You seem to have 3 questions here: how to re-direct stdout, how to address a usb storage device, howe to put a date in a file-name. (We have a one question per question policy. But as many questions as you like.)

– ctrl-alt-delor
Nov 10 '18 at 13:45













The first question is a duplicate of What are the shell's control and redirection operators? The third question is a duplicate of How can I assign the output of a command to a shell variable?

– G-Man
2 days ago





The first question is a duplicate of What are the shell's control and redirection operators? The third question is a duplicate of How can I assign the output of a command to a shell variable?

– G-Man
2 days ago










2 Answers
2






active

oldest

votes


















1














| is used to pass the output to another command. > re-directs it to a file.



You need >.






share|improve this answer


















  • 2





    Indeed. Also, one usually writes files to the mounted filesystem, not to the device file itself. So it would be dmesg -T > /media/mounpoint/$(date +%Y%m%d%a%H%M).log. Auto-generated mount-points rely on partition IDs or labels and thus are usually stable.

    – Hermann
    Nov 10 '18 at 13:48


















-1














Thanks. Ideally I don't want to write to the file system. If I were to run the /bin/bash from any USB drive how would I write the file to THAT drive, irrespective of it's name or ID.



> works perfectly, thanks.
$(date...) works perfectly, thanks.


If I can write to the same drive as where the bash was fun from that would be great.






share|improve this answer























  • Welcome, I see you are new: This is the place to put an answer. Please revise your question with this new information, then delete this answer. (I will down vote but you will get the reputation back when you delete the answer).

    – ctrl-alt-delor
    Nov 10 '18 at 19:25












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%2f480951%2fwriting-file-to-specific-usb-device%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














| is used to pass the output to another command. > re-directs it to a file.



You need >.






share|improve this answer


















  • 2





    Indeed. Also, one usually writes files to the mounted filesystem, not to the device file itself. So it would be dmesg -T > /media/mounpoint/$(date +%Y%m%d%a%H%M).log. Auto-generated mount-points rely on partition IDs or labels and thus are usually stable.

    – Hermann
    Nov 10 '18 at 13:48















1














| is used to pass the output to another command. > re-directs it to a file.



You need >.






share|improve this answer


















  • 2





    Indeed. Also, one usually writes files to the mounted filesystem, not to the device file itself. So it would be dmesg -T > /media/mounpoint/$(date +%Y%m%d%a%H%M).log. Auto-generated mount-points rely on partition IDs or labels and thus are usually stable.

    – Hermann
    Nov 10 '18 at 13:48













1












1








1







| is used to pass the output to another command. > re-directs it to a file.



You need >.






share|improve this answer













| is used to pass the output to another command. > re-directs it to a file.



You need >.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 10 '18 at 13:43









ctrl-alt-delorctrl-alt-delor

12.2k42561




12.2k42561







  • 2





    Indeed. Also, one usually writes files to the mounted filesystem, not to the device file itself. So it would be dmesg -T > /media/mounpoint/$(date +%Y%m%d%a%H%M).log. Auto-generated mount-points rely on partition IDs or labels and thus are usually stable.

    – Hermann
    Nov 10 '18 at 13:48












  • 2





    Indeed. Also, one usually writes files to the mounted filesystem, not to the device file itself. So it would be dmesg -T > /media/mounpoint/$(date +%Y%m%d%a%H%M).log. Auto-generated mount-points rely on partition IDs or labels and thus are usually stable.

    – Hermann
    Nov 10 '18 at 13:48







2




2





Indeed. Also, one usually writes files to the mounted filesystem, not to the device file itself. So it would be dmesg -T > /media/mounpoint/$(date +%Y%m%d%a%H%M).log. Auto-generated mount-points rely on partition IDs or labels and thus are usually stable.

– Hermann
Nov 10 '18 at 13:48





Indeed. Also, one usually writes files to the mounted filesystem, not to the device file itself. So it would be dmesg -T > /media/mounpoint/$(date +%Y%m%d%a%H%M).log. Auto-generated mount-points rely on partition IDs or labels and thus are usually stable.

– Hermann
Nov 10 '18 at 13:48













-1














Thanks. Ideally I don't want to write to the file system. If I were to run the /bin/bash from any USB drive how would I write the file to THAT drive, irrespective of it's name or ID.



> works perfectly, thanks.
$(date...) works perfectly, thanks.


If I can write to the same drive as where the bash was fun from that would be great.






share|improve this answer























  • Welcome, I see you are new: This is the place to put an answer. Please revise your question with this new information, then delete this answer. (I will down vote but you will get the reputation back when you delete the answer).

    – ctrl-alt-delor
    Nov 10 '18 at 19:25
















-1














Thanks. Ideally I don't want to write to the file system. If I were to run the /bin/bash from any USB drive how would I write the file to THAT drive, irrespective of it's name or ID.



> works perfectly, thanks.
$(date...) works perfectly, thanks.


If I can write to the same drive as where the bash was fun from that would be great.






share|improve this answer























  • Welcome, I see you are new: This is the place to put an answer. Please revise your question with this new information, then delete this answer. (I will down vote but you will get the reputation back when you delete the answer).

    – ctrl-alt-delor
    Nov 10 '18 at 19:25














-1












-1








-1







Thanks. Ideally I don't want to write to the file system. If I were to run the /bin/bash from any USB drive how would I write the file to THAT drive, irrespective of it's name or ID.



> works perfectly, thanks.
$(date...) works perfectly, thanks.


If I can write to the same drive as where the bash was fun from that would be great.






share|improve this answer













Thanks. Ideally I don't want to write to the file system. If I were to run the /bin/bash from any USB drive how would I write the file to THAT drive, irrespective of it's name or ID.



> works perfectly, thanks.
$(date...) works perfectly, thanks.


If I can write to the same drive as where the bash was fun from that would be great.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 10 '18 at 16:40









Andy ArnoldsAndy Arnolds

1




1












  • Welcome, I see you are new: This is the place to put an answer. Please revise your question with this new information, then delete this answer. (I will down vote but you will get the reputation back when you delete the answer).

    – ctrl-alt-delor
    Nov 10 '18 at 19:25


















  • Welcome, I see you are new: This is the place to put an answer. Please revise your question with this new information, then delete this answer. (I will down vote but you will get the reputation back when you delete the answer).

    – ctrl-alt-delor
    Nov 10 '18 at 19:25

















Welcome, I see you are new: This is the place to put an answer. Please revise your question with this new information, then delete this answer. (I will down vote but you will get the reputation back when you delete the answer).

– ctrl-alt-delor
Nov 10 '18 at 19:25






Welcome, I see you are new: This is the place to put an answer. Please revise your question with this new information, then delete this answer. (I will down vote but you will get the reputation back when you delete the answer).

– ctrl-alt-delor
Nov 10 '18 at 19:25


















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%2f480951%2fwriting-file-to-specific-usb-device%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

getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

Marilyn Monroe Ny fiainany manokana | Jereo koa | Meny fitetezanafanitarana azy.