Force wrapping the long output lines that aren't so in terminal
Usually when the long lines are output in terminal/console/xterm, they will be wrapped automatically. However, there are cases that are not. ps
is one of such cases -- it cuts the output right at the windows width.
ps ax | grep [d]nsmasq
4459 ? S 0:03 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsm
For the dnsmasq
, even I maximize my xterm, the output is still being cut.
I've tried,
$ ps ax | fold | grep [d]nsmasq
4459 ? S 0:03 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsm
$ ps ax | grep [d]nsmasq | fold
4459 ? S 0:03 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsm
$ ps ax | grep [d]nsmasq | fold --spaces
4459 ? S 0:03 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsm
Such cutting make ps
seems like not writing to standard output, but its responding to grep
proves otherwise. But how come the fold
not working then?
How to wrapping such long lines to show everything instead of cutting to the windows' width?
linux ubuntu command-line terminal
add a comment |
Usually when the long lines are output in terminal/console/xterm, they will be wrapped automatically. However, there are cases that are not. ps
is one of such cases -- it cuts the output right at the windows width.
ps ax | grep [d]nsmasq
4459 ? S 0:03 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsm
For the dnsmasq
, even I maximize my xterm, the output is still being cut.
I've tried,
$ ps ax | fold | grep [d]nsmasq
4459 ? S 0:03 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsm
$ ps ax | grep [d]nsmasq | fold
4459 ? S 0:03 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsm
$ ps ax | grep [d]nsmasq | fold --spaces
4459 ? S 0:03 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsm
Such cutting make ps
seems like not writing to standard output, but its responding to grep
proves otherwise. But how come the fold
not working then?
How to wrapping such long lines to show everything instead of cutting to the windows' width?
linux ubuntu command-line terminal
add a comment |
Usually when the long lines are output in terminal/console/xterm, they will be wrapped automatically. However, there are cases that are not. ps
is one of such cases -- it cuts the output right at the windows width.
ps ax | grep [d]nsmasq
4459 ? S 0:03 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsm
For the dnsmasq
, even I maximize my xterm, the output is still being cut.
I've tried,
$ ps ax | fold | grep [d]nsmasq
4459 ? S 0:03 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsm
$ ps ax | grep [d]nsmasq | fold
4459 ? S 0:03 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsm
$ ps ax | grep [d]nsmasq | fold --spaces
4459 ? S 0:03 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsm
Such cutting make ps
seems like not writing to standard output, but its responding to grep
proves otherwise. But how come the fold
not working then?
How to wrapping such long lines to show everything instead of cutting to the windows' width?
linux ubuntu command-line terminal
Usually when the long lines are output in terminal/console/xterm, they will be wrapped automatically. However, there are cases that are not. ps
is one of such cases -- it cuts the output right at the windows width.
ps ax | grep [d]nsmasq
4459 ? S 0:03 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsm
For the dnsmasq
, even I maximize my xterm, the output is still being cut.
I've tried,
$ ps ax | fold | grep [d]nsmasq
4459 ? S 0:03 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsm
$ ps ax | grep [d]nsmasq | fold
4459 ? S 0:03 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsm
$ ps ax | grep [d]nsmasq | fold --spaces
4459 ? S 0:03 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsm
Such cutting make ps
seems like not writing to standard output, but its responding to grep
proves otherwise. But how come the fold
not working then?
How to wrapping such long lines to show everything instead of cutting to the windows' width?
linux ubuntu command-line terminal
linux ubuntu command-line terminal
asked Feb 23 at 14:23
xptxpt
3,216145693
3,216145693
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
Duh, found the answer soon after I asked it.
COLUMNS=500 ps ax | grep [d]nsmasq | fold
The same trick works for dpkg
as well.
add a comment |
Check the man page. Compare these 3 outputs:
ps ax
ps axw
ps axww
add a comment |
ps
checks whether its output goes to a terminal, and if so, queries the terminal's width. Then ps
itself truncates each line according to that width. It's not the terminal chopping them, it doesn't even receive this data.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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%2fsuperuser.com%2fquestions%2f1408774%2fforce-wrapping-the-long-output-lines-that-arent-so-in-terminal%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Duh, found the answer soon after I asked it.
COLUMNS=500 ps ax | grep [d]nsmasq | fold
The same trick works for dpkg
as well.
add a comment |
Duh, found the answer soon after I asked it.
COLUMNS=500 ps ax | grep [d]nsmasq | fold
The same trick works for dpkg
as well.
add a comment |
Duh, found the answer soon after I asked it.
COLUMNS=500 ps ax | grep [d]nsmasq | fold
The same trick works for dpkg
as well.
Duh, found the answer soon after I asked it.
COLUMNS=500 ps ax | grep [d]nsmasq | fold
The same trick works for dpkg
as well.
answered Feb 23 at 14:27
xptxpt
3,216145693
3,216145693
add a comment |
add a comment |
Check the man page. Compare these 3 outputs:
ps ax
ps axw
ps axww
add a comment |
Check the man page. Compare these 3 outputs:
ps ax
ps axw
ps axww
add a comment |
Check the man page. Compare these 3 outputs:
ps ax
ps axw
ps axww
Check the man page. Compare these 3 outputs:
ps ax
ps axw
ps axww
answered Feb 23 at 15:12
glenn jackmanglenn jackman
16.3k32645
16.3k32645
add a comment |
add a comment |
ps
checks whether its output goes to a terminal, and if so, queries the terminal's width. Then ps
itself truncates each line according to that width. It's not the terminal chopping them, it doesn't even receive this data.
add a comment |
ps
checks whether its output goes to a terminal, and if so, queries the terminal's width. Then ps
itself truncates each line according to that width. It's not the terminal chopping them, it doesn't even receive this data.
add a comment |
ps
checks whether its output goes to a terminal, and if so, queries the terminal's width. Then ps
itself truncates each line according to that width. It's not the terminal chopping them, it doesn't even receive this data.
ps
checks whether its output goes to a terminal, and if so, queries the terminal's width. Then ps
itself truncates each line according to that width. It's not the terminal chopping them, it doesn't even receive this data.
answered Feb 23 at 16:43
egmontegmont
1,5681814
1,5681814
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- 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%2fsuperuser.com%2fquestions%2f1408774%2fforce-wrapping-the-long-output-lines-that-arent-so-in-terminal%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