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?
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
add a comment |
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
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
add a comment |
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
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
command-line usb
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
add a comment |
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
add a comment |
2 Answers
2
active
oldest
votes
|
is used to pass the output to another command. >
re-directs it to a file.
You need >
.
2
Indeed. Also, one usually writes files to the mounted filesystem, not to the device file itself. So it would bedmesg -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
add a comment |
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.
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
|
is used to pass the output to another command. >
re-directs it to a file.
You need >
.
2
Indeed. Also, one usually writes files to the mounted filesystem, not to the device file itself. So it would bedmesg -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
add a comment |
|
is used to pass the output to another command. >
re-directs it to a file.
You need >
.
2
Indeed. Also, one usually writes files to the mounted filesystem, not to the device file itself. So it would bedmesg -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
add a comment |
|
is used to pass the output to another command. >
re-directs it to a file.
You need >
.
|
is used to pass the output to another command. >
re-directs it to a file.
You need >
.
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 bedmesg -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
add a comment |
2
Indeed. Also, one usually writes files to the mounted filesystem, not to the device file itself. So it would bedmesg -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
add a comment |
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.
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
add a comment |
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.
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
add a comment |
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.
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.
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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