Reduce space between numbers and paths in “dirs -v” output
I feel like the space between the numbers and the paths is too much and I believe that less space would make lines easier to follow.
Is there an easy way reduce that space?
zsh output
|
show 1 more comment
I feel like the space between the numbers and the paths is too much and I believe that less space would make lines easier to follow.
Is there an easy way reduce that space?
zsh output
3
That space is actually a single tab char... Replacehead -10
withsed 's/[[:blank:]]/ /;10q'
...
– don_crissti
Dec 16 at 20:34
Awesome, does the job perfectly! What's the second part of the sed value called the one that limits lines to 10 -10q
, I'd love to find out more about that. Thanks!
– Emanuil Rusev
Dec 16 at 21:05
2
It's explained in the manual (man sed
)...10q
meansq
uit when on line no.10
– don_crissti
Dec 16 at 21:09
Awesome, thanks so much!
– Emanuil Rusev
Dec 16 at 21:14
1
dir -v | column -t
can help.
– jimmij
Dec 16 at 21:51
|
show 1 more comment
I feel like the space between the numbers and the paths is too much and I believe that less space would make lines easier to follow.
Is there an easy way reduce that space?
zsh output
I feel like the space between the numbers and the paths is too much and I believe that less space would make lines easier to follow.
Is there an easy way reduce that space?
zsh output
zsh output
asked Dec 16 at 20:15
Emanuil Rusev
1146
1146
3
That space is actually a single tab char... Replacehead -10
withsed 's/[[:blank:]]/ /;10q'
...
– don_crissti
Dec 16 at 20:34
Awesome, does the job perfectly! What's the second part of the sed value called the one that limits lines to 10 -10q
, I'd love to find out more about that. Thanks!
– Emanuil Rusev
Dec 16 at 21:05
2
It's explained in the manual (man sed
)...10q
meansq
uit when on line no.10
– don_crissti
Dec 16 at 21:09
Awesome, thanks so much!
– Emanuil Rusev
Dec 16 at 21:14
1
dir -v | column -t
can help.
– jimmij
Dec 16 at 21:51
|
show 1 more comment
3
That space is actually a single tab char... Replacehead -10
withsed 's/[[:blank:]]/ /;10q'
...
– don_crissti
Dec 16 at 20:34
Awesome, does the job perfectly! What's the second part of the sed value called the one that limits lines to 10 -10q
, I'd love to find out more about that. Thanks!
– Emanuil Rusev
Dec 16 at 21:05
2
It's explained in the manual (man sed
)...10q
meansq
uit when on line no.10
– don_crissti
Dec 16 at 21:09
Awesome, thanks so much!
– Emanuil Rusev
Dec 16 at 21:14
1
dir -v | column -t
can help.
– jimmij
Dec 16 at 21:51
3
3
That space is actually a single tab char... Replace
head -10
with sed 's/[[:blank:]]/ /;10q'
...– don_crissti
Dec 16 at 20:34
That space is actually a single tab char... Replace
head -10
with sed 's/[[:blank:]]/ /;10q'
...– don_crissti
Dec 16 at 20:34
Awesome, does the job perfectly! What's the second part of the sed value called the one that limits lines to 10 -
10q
, I'd love to find out more about that. Thanks!– Emanuil Rusev
Dec 16 at 21:05
Awesome, does the job perfectly! What's the second part of the sed value called the one that limits lines to 10 -
10q
, I'd love to find out more about that. Thanks!– Emanuil Rusev
Dec 16 at 21:05
2
2
It's explained in the manual (
man sed
)... 10q
means q
uit when on line no. 10
– don_crissti
Dec 16 at 21:09
It's explained in the manual (
man sed
)... 10q
means q
uit when on line no. 10
– don_crissti
Dec 16 at 21:09
Awesome, thanks so much!
– Emanuil Rusev
Dec 16 at 21:14
Awesome, thanks so much!
– Emanuil Rusev
Dec 16 at 21:14
1
1
dir -v | column -t
can help.– jimmij
Dec 16 at 21:51
dir -v | column -t
can help.– jimmij
Dec 16 at 21:51
|
show 1 more comment
2 Answers
2
active
oldest
votes
That's a TAB, you see a 7 column gap because your terminal has tab stops every 8 columns.
You could change the tabstop spacing on the terminal with for instance:
tabs 4
To set the tab stops every 4 columns instead of 8, or pipe the output to:
expand -t4
To convert TABs to spaces with tabstops every 4 column. Or
expand -t4,/8
To expand the tabs but with the first after the 4th column, and the other ones every 8 column as usual.
Or convert the first TAB to one space (but beware it would misalign the output when you display more than 10 lines) by piping to:
sed $'s/t/ /'
add a comment |
quick'n dirty
dirs -v| sed -r 's/s{2,}/ /'
Awesome, could you please explain what each part does? Thanks!
– Emanuil Rusev
Dec 16 at 20:58
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%2f489375%2freduce-space-between-numbers-and-paths-in-dirs-v-output%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
That's a TAB, you see a 7 column gap because your terminal has tab stops every 8 columns.
You could change the tabstop spacing on the terminal with for instance:
tabs 4
To set the tab stops every 4 columns instead of 8, or pipe the output to:
expand -t4
To convert TABs to spaces with tabstops every 4 column. Or
expand -t4,/8
To expand the tabs but with the first after the 4th column, and the other ones every 8 column as usual.
Or convert the first TAB to one space (but beware it would misalign the output when you display more than 10 lines) by piping to:
sed $'s/t/ /'
add a comment |
That's a TAB, you see a 7 column gap because your terminal has tab stops every 8 columns.
You could change the tabstop spacing on the terminal with for instance:
tabs 4
To set the tab stops every 4 columns instead of 8, or pipe the output to:
expand -t4
To convert TABs to spaces with tabstops every 4 column. Or
expand -t4,/8
To expand the tabs but with the first after the 4th column, and the other ones every 8 column as usual.
Or convert the first TAB to one space (but beware it would misalign the output when you display more than 10 lines) by piping to:
sed $'s/t/ /'
add a comment |
That's a TAB, you see a 7 column gap because your terminal has tab stops every 8 columns.
You could change the tabstop spacing on the terminal with for instance:
tabs 4
To set the tab stops every 4 columns instead of 8, or pipe the output to:
expand -t4
To convert TABs to spaces with tabstops every 4 column. Or
expand -t4,/8
To expand the tabs but with the first after the 4th column, and the other ones every 8 column as usual.
Or convert the first TAB to one space (but beware it would misalign the output when you display more than 10 lines) by piping to:
sed $'s/t/ /'
That's a TAB, you see a 7 column gap because your terminal has tab stops every 8 columns.
You could change the tabstop spacing on the terminal with for instance:
tabs 4
To set the tab stops every 4 columns instead of 8, or pipe the output to:
expand -t4
To convert TABs to spaces with tabstops every 4 column. Or
expand -t4,/8
To expand the tabs but with the first after the 4th column, and the other ones every 8 column as usual.
Or convert the first TAB to one space (but beware it would misalign the output when you display more than 10 lines) by piping to:
sed $'s/t/ /'
answered Dec 21 at 16:56
Stéphane Chazelas
299k54564913
299k54564913
add a comment |
add a comment |
quick'n dirty
dirs -v| sed -r 's/s{2,}/ /'
Awesome, could you please explain what each part does? Thanks!
– Emanuil Rusev
Dec 16 at 20:58
add a comment |
quick'n dirty
dirs -v| sed -r 's/s{2,}/ /'
Awesome, could you please explain what each part does? Thanks!
– Emanuil Rusev
Dec 16 at 20:58
add a comment |
quick'n dirty
dirs -v| sed -r 's/s{2,}/ /'
quick'n dirty
dirs -v| sed -r 's/s{2,}/ /'
answered Dec 16 at 20:33
La Kantara
212
212
Awesome, could you please explain what each part does? Thanks!
– Emanuil Rusev
Dec 16 at 20:58
add a comment |
Awesome, could you please explain what each part does? Thanks!
– Emanuil Rusev
Dec 16 at 20:58
Awesome, could you please explain what each part does? Thanks!
– Emanuil Rusev
Dec 16 at 20:58
Awesome, could you please explain what each part does? Thanks!
– Emanuil Rusev
Dec 16 at 20:58
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f489375%2freduce-space-between-numbers-and-paths-in-dirs-v-output%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
3
That space is actually a single tab char... Replace
head -10
withsed 's/[[:blank:]]/ /;10q'
...– don_crissti
Dec 16 at 20:34
Awesome, does the job perfectly! What's the second part of the sed value called the one that limits lines to 10 -
10q
, I'd love to find out more about that. Thanks!– Emanuil Rusev
Dec 16 at 21:05
2
It's explained in the manual (
man sed
)...10q
meansq
uit when on line no.10
– don_crissti
Dec 16 at 21:09
Awesome, thanks so much!
– Emanuil Rusev
Dec 16 at 21:14
1
dir -v | column -t
can help.– jimmij
Dec 16 at 21:51