How to list *.tar.gz, one filename per line?
up vote
4
down vote
favorite
I am trying to list .tar.gz only using the following command:
ls *.tar.gz -l
.. It shows me the following list:
-rw-rw-r-- 1 osm osm 949 Nov 27 16:17 file1.tar.gz
-rw-rw-r-- 1 osm osm 949 Nov 27 16:17 file2.tar.gz
However, I just need to list it this way:
file1.tar.gz
file2.tar.gz
and also not:
file1.tar.gz file2.tar.gz
How to do it?
ls
add a comment |
up vote
4
down vote
favorite
I am trying to list .tar.gz only using the following command:
ls *.tar.gz -l
.. It shows me the following list:
-rw-rw-r-- 1 osm osm 949 Nov 27 16:17 file1.tar.gz
-rw-rw-r-- 1 osm osm 949 Nov 27 16:17 file2.tar.gz
However, I just need to list it this way:
file1.tar.gz
file2.tar.gz
and also not:
file1.tar.gz file2.tar.gz
How to do it?
ls
5
it is a good habit to use options before filenames. and you need to use -1 instead of -l
– AnonymousLurker
yesterday
14
ls -1 *.tar.gz, but what do you want to use the list for? If you are doing something to those filenames, thenlsis not the right way to do it. See Why *not* parse `ls` (and what do to instead)?
– Kusalananda
yesterday
3
the manual you need isman ls. Ensure that your display font has good contrast between 1 (one) and l (lower case letter ell).
– ctrl-alt-delor
yesterday
1
Possible duplicate of Output from ls has newlines but displays on a single line. Why?
– Julien Lopez
18 hours ago
add a comment |
up vote
4
down vote
favorite
up vote
4
down vote
favorite
I am trying to list .tar.gz only using the following command:
ls *.tar.gz -l
.. It shows me the following list:
-rw-rw-r-- 1 osm osm 949 Nov 27 16:17 file1.tar.gz
-rw-rw-r-- 1 osm osm 949 Nov 27 16:17 file2.tar.gz
However, I just need to list it this way:
file1.tar.gz
file2.tar.gz
and also not:
file1.tar.gz file2.tar.gz
How to do it?
ls
I am trying to list .tar.gz only using the following command:
ls *.tar.gz -l
.. It shows me the following list:
-rw-rw-r-- 1 osm osm 949 Nov 27 16:17 file1.tar.gz
-rw-rw-r-- 1 osm osm 949 Nov 27 16:17 file2.tar.gz
However, I just need to list it this way:
file1.tar.gz
file2.tar.gz
and also not:
file1.tar.gz file2.tar.gz
How to do it?
ls
ls
edited 7 hours ago
200_success
3,87911428
3,87911428
asked yesterday
McLan
1524
1524
5
it is a good habit to use options before filenames. and you need to use -1 instead of -l
– AnonymousLurker
yesterday
14
ls -1 *.tar.gz, but what do you want to use the list for? If you are doing something to those filenames, thenlsis not the right way to do it. See Why *not* parse `ls` (and what do to instead)?
– Kusalananda
yesterday
3
the manual you need isman ls. Ensure that your display font has good contrast between 1 (one) and l (lower case letter ell).
– ctrl-alt-delor
yesterday
1
Possible duplicate of Output from ls has newlines but displays on a single line. Why?
– Julien Lopez
18 hours ago
add a comment |
5
it is a good habit to use options before filenames. and you need to use -1 instead of -l
– AnonymousLurker
yesterday
14
ls -1 *.tar.gz, but what do you want to use the list for? If you are doing something to those filenames, thenlsis not the right way to do it. See Why *not* parse `ls` (and what do to instead)?
– Kusalananda
yesterday
3
the manual you need isman ls. Ensure that your display font has good contrast between 1 (one) and l (lower case letter ell).
– ctrl-alt-delor
yesterday
1
Possible duplicate of Output from ls has newlines but displays on a single line. Why?
– Julien Lopez
18 hours ago
5
5
it is a good habit to use options before filenames. and you need to use -1 instead of -l
– AnonymousLurker
yesterday
it is a good habit to use options before filenames. and you need to use -1 instead of -l
– AnonymousLurker
yesterday
14
14
ls -1 *.tar.gz, but what do you want to use the list for? If you are doing something to those filenames, then ls is not the right way to do it. See Why *not* parse `ls` (and what do to instead)?– Kusalananda
yesterday
ls -1 *.tar.gz, but what do you want to use the list for? If you are doing something to those filenames, then ls is not the right way to do it. See Why *not* parse `ls` (and what do to instead)?– Kusalananda
yesterday
3
3
the manual you need is
man ls. Ensure that your display font has good contrast between 1 (one) and l (lower case letter ell).– ctrl-alt-delor
yesterday
the manual you need is
man ls. Ensure that your display font has good contrast between 1 (one) and l (lower case letter ell).– ctrl-alt-delor
yesterday
1
1
Possible duplicate of Output from ls has newlines but displays on a single line. Why?
– Julien Lopez
18 hours ago
Possible duplicate of Output from ls has newlines but displays on a single line. Why?
– Julien Lopez
18 hours ago
add a comment |
5 Answers
5
active
oldest
votes
up vote
31
down vote
accepted
The -1 option (the digit “one”, not lower-case “L”) will list one file per line with no other information:
ls -1 -- *.tar.gz
1
Why the double dashes?ls -1 *.tar.gzworks just as well.
– RonJohn
6 hours ago
5
@RonJohn it avoids surprises with filenames starting with-.
– Stephen Kitt
6 hours ago
Specifically... Say I was an attacker, and had the following files:.hiddenfile,benign.php,evil.bin,--hide=*evil*; without the--you won't seeevil.binor--hide=*evil*.
– wizzwizz4
4 hours ago
add a comment |
up vote
15
down vote
If you only need the filenames, you could use printf:
printf '%sn' *.tar.gz
... the shell will expand the *.tar.gz wildcard to the filenames, then printf will print them, with each followed by a newline. This output would differ a bit from that of ls in the case of filenames with newlines embedded in them:
setup
$ touch file{1,2}.tar.gz
$ touch file$'n'3.tar.gz
ls
$ ls -1 -- *.tar.gz
file1.tar.gz
file2.tar.gz
file?3.tar.gz
printf
$ printf '%sn' *.tar.gz
file1.tar.gz
file2.tar.gz
file
3.tar.gz
6
See alsols -b,ls -Q, ls--quoting-style=....
– Stephen Kitt
yesterday
add a comment |
up vote
7
down vote
ls behaves differently when its output is piped. For example:
ls # outputs filenames in columns
ls | cat # passes one filename per line to the cat command
So if you want see all your *.tar.gz files, one per line, you can do this:
ls *.tar.gz | cat
But what if you don't want to pipe your output? That is, is there a way to force ls to output the filenames one to a line without piping the output?
Yes, with the -1 switch. (That's a dash with the number 1.) So you can use these commands:
ls -1 # shows all (non-hidden) files, one per line
ls -1 *.tar.gz # shows only *.tar.gz files, one per line
New contributor
J-L is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
up vote
6
down vote
Or with GNU find:
find -name "*.tar.gz" -printf '%Pn'
In contrary to ls with * it will search for .tar.gz files recursively:
$ find -name "*.tar.gz" -printf '%Pn'
file1.tar.gz
dir/file3.tar.gz
file2.tar.gz
add a comment |
up vote
3
down vote
A slightly more roundabout and loopy way:
for i in *.tar.gz; do
echo "$i"
done
EDIT: added quotes to handle weird filenames
4
touch -- '-e a.tar.gz'for a reason to quote your variables and unix.stackexchange.com/q/65803/117549 for reasons to use printf instead of echo
– Jeff Schaller
yesterday
oof, I just spent 5 minutes trying to figure out how to remove the resulting-e a.tar.gzfile
– snetch
yesterday
1
sorry!rm -- '-e a.tar.gz'should do the trick
– Jeff Schaller
yesterday
You're good, it was a lesson, and I did learn that--works forrmand a lot of others.
– snetch
yesterday
Thank you for that. It wouldn't be a complete question if someone didn't suggest a for-do loop to solve the problem. lol Upvoting.
– Jesse Steele
2 hours ago
add a comment |
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
31
down vote
accepted
The -1 option (the digit “one”, not lower-case “L”) will list one file per line with no other information:
ls -1 -- *.tar.gz
1
Why the double dashes?ls -1 *.tar.gzworks just as well.
– RonJohn
6 hours ago
5
@RonJohn it avoids surprises with filenames starting with-.
– Stephen Kitt
6 hours ago
Specifically... Say I was an attacker, and had the following files:.hiddenfile,benign.php,evil.bin,--hide=*evil*; without the--you won't seeevil.binor--hide=*evil*.
– wizzwizz4
4 hours ago
add a comment |
up vote
31
down vote
accepted
The -1 option (the digit “one”, not lower-case “L”) will list one file per line with no other information:
ls -1 -- *.tar.gz
1
Why the double dashes?ls -1 *.tar.gzworks just as well.
– RonJohn
6 hours ago
5
@RonJohn it avoids surprises with filenames starting with-.
– Stephen Kitt
6 hours ago
Specifically... Say I was an attacker, and had the following files:.hiddenfile,benign.php,evil.bin,--hide=*evil*; without the--you won't seeevil.binor--hide=*evil*.
– wizzwizz4
4 hours ago
add a comment |
up vote
31
down vote
accepted
up vote
31
down vote
accepted
The -1 option (the digit “one”, not lower-case “L”) will list one file per line with no other information:
ls -1 -- *.tar.gz
The -1 option (the digit “one”, not lower-case “L”) will list one file per line with no other information:
ls -1 -- *.tar.gz
answered yesterday
Stephen Kitt
158k24351425
158k24351425
1
Why the double dashes?ls -1 *.tar.gzworks just as well.
– RonJohn
6 hours ago
5
@RonJohn it avoids surprises with filenames starting with-.
– Stephen Kitt
6 hours ago
Specifically... Say I was an attacker, and had the following files:.hiddenfile,benign.php,evil.bin,--hide=*evil*; without the--you won't seeevil.binor--hide=*evil*.
– wizzwizz4
4 hours ago
add a comment |
1
Why the double dashes?ls -1 *.tar.gzworks just as well.
– RonJohn
6 hours ago
5
@RonJohn it avoids surprises with filenames starting with-.
– Stephen Kitt
6 hours ago
Specifically... Say I was an attacker, and had the following files:.hiddenfile,benign.php,evil.bin,--hide=*evil*; without the--you won't seeevil.binor--hide=*evil*.
– wizzwizz4
4 hours ago
1
1
Why the double dashes?
ls -1 *.tar.gz works just as well.– RonJohn
6 hours ago
Why the double dashes?
ls -1 *.tar.gz works just as well.– RonJohn
6 hours ago
5
5
@RonJohn it avoids surprises with filenames starting with
-.– Stephen Kitt
6 hours ago
@RonJohn it avoids surprises with filenames starting with
-.– Stephen Kitt
6 hours ago
Specifically... Say I was an attacker, and had the following files:
.hiddenfile, benign.php, evil.bin, --hide=*evil*; without the -- you won't see evil.bin or --hide=*evil*.– wizzwizz4
4 hours ago
Specifically... Say I was an attacker, and had the following files:
.hiddenfile, benign.php, evil.bin, --hide=*evil*; without the -- you won't see evil.bin or --hide=*evil*.– wizzwizz4
4 hours ago
add a comment |
up vote
15
down vote
If you only need the filenames, you could use printf:
printf '%sn' *.tar.gz
... the shell will expand the *.tar.gz wildcard to the filenames, then printf will print them, with each followed by a newline. This output would differ a bit from that of ls in the case of filenames with newlines embedded in them:
setup
$ touch file{1,2}.tar.gz
$ touch file$'n'3.tar.gz
ls
$ ls -1 -- *.tar.gz
file1.tar.gz
file2.tar.gz
file?3.tar.gz
printf
$ printf '%sn' *.tar.gz
file1.tar.gz
file2.tar.gz
file
3.tar.gz
6
See alsols -b,ls -Q, ls--quoting-style=....
– Stephen Kitt
yesterday
add a comment |
up vote
15
down vote
If you only need the filenames, you could use printf:
printf '%sn' *.tar.gz
... the shell will expand the *.tar.gz wildcard to the filenames, then printf will print them, with each followed by a newline. This output would differ a bit from that of ls in the case of filenames with newlines embedded in them:
setup
$ touch file{1,2}.tar.gz
$ touch file$'n'3.tar.gz
ls
$ ls -1 -- *.tar.gz
file1.tar.gz
file2.tar.gz
file?3.tar.gz
printf
$ printf '%sn' *.tar.gz
file1.tar.gz
file2.tar.gz
file
3.tar.gz
6
See alsols -b,ls -Q, ls--quoting-style=....
– Stephen Kitt
yesterday
add a comment |
up vote
15
down vote
up vote
15
down vote
If you only need the filenames, you could use printf:
printf '%sn' *.tar.gz
... the shell will expand the *.tar.gz wildcard to the filenames, then printf will print them, with each followed by a newline. This output would differ a bit from that of ls in the case of filenames with newlines embedded in them:
setup
$ touch file{1,2}.tar.gz
$ touch file$'n'3.tar.gz
ls
$ ls -1 -- *.tar.gz
file1.tar.gz
file2.tar.gz
file?3.tar.gz
printf
$ printf '%sn' *.tar.gz
file1.tar.gz
file2.tar.gz
file
3.tar.gz
If you only need the filenames, you could use printf:
printf '%sn' *.tar.gz
... the shell will expand the *.tar.gz wildcard to the filenames, then printf will print them, with each followed by a newline. This output would differ a bit from that of ls in the case of filenames with newlines embedded in them:
setup
$ touch file{1,2}.tar.gz
$ touch file$'n'3.tar.gz
ls
$ ls -1 -- *.tar.gz
file1.tar.gz
file2.tar.gz
file?3.tar.gz
printf
$ printf '%sn' *.tar.gz
file1.tar.gz
file2.tar.gz
file
3.tar.gz
answered yesterday
Jeff Schaller
36.8k1052121
36.8k1052121
6
See alsols -b,ls -Q, ls--quoting-style=....
– Stephen Kitt
yesterday
add a comment |
6
See alsols -b,ls -Q, ls--quoting-style=....
– Stephen Kitt
yesterday
6
6
See also
ls -b, ls -Q, ls --quoting-style=....– Stephen Kitt
yesterday
See also
ls -b, ls -Q, ls --quoting-style=....– Stephen Kitt
yesterday
add a comment |
up vote
7
down vote
ls behaves differently when its output is piped. For example:
ls # outputs filenames in columns
ls | cat # passes one filename per line to the cat command
So if you want see all your *.tar.gz files, one per line, you can do this:
ls *.tar.gz | cat
But what if you don't want to pipe your output? That is, is there a way to force ls to output the filenames one to a line without piping the output?
Yes, with the -1 switch. (That's a dash with the number 1.) So you can use these commands:
ls -1 # shows all (non-hidden) files, one per line
ls -1 *.tar.gz # shows only *.tar.gz files, one per line
New contributor
J-L is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
up vote
7
down vote
ls behaves differently when its output is piped. For example:
ls # outputs filenames in columns
ls | cat # passes one filename per line to the cat command
So if you want see all your *.tar.gz files, one per line, you can do this:
ls *.tar.gz | cat
But what if you don't want to pipe your output? That is, is there a way to force ls to output the filenames one to a line without piping the output?
Yes, with the -1 switch. (That's a dash with the number 1.) So you can use these commands:
ls -1 # shows all (non-hidden) files, one per line
ls -1 *.tar.gz # shows only *.tar.gz files, one per line
New contributor
J-L is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
up vote
7
down vote
up vote
7
down vote
ls behaves differently when its output is piped. For example:
ls # outputs filenames in columns
ls | cat # passes one filename per line to the cat command
So if you want see all your *.tar.gz files, one per line, you can do this:
ls *.tar.gz | cat
But what if you don't want to pipe your output? That is, is there a way to force ls to output the filenames one to a line without piping the output?
Yes, with the -1 switch. (That's a dash with the number 1.) So you can use these commands:
ls -1 # shows all (non-hidden) files, one per line
ls -1 *.tar.gz # shows only *.tar.gz files, one per line
New contributor
J-L is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
ls behaves differently when its output is piped. For example:
ls # outputs filenames in columns
ls | cat # passes one filename per line to the cat command
So if you want see all your *.tar.gz files, one per line, you can do this:
ls *.tar.gz | cat
But what if you don't want to pipe your output? That is, is there a way to force ls to output the filenames one to a line without piping the output?
Yes, with the -1 switch. (That's a dash with the number 1.) So you can use these commands:
ls -1 # shows all (non-hidden) files, one per line
ls -1 *.tar.gz # shows only *.tar.gz files, one per line
New contributor
J-L is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited yesterday
New contributor
J-L is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
answered yesterday
J-L
1713
1713
New contributor
J-L is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
J-L is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
J-L is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
add a comment |
up vote
6
down vote
Or with GNU find:
find -name "*.tar.gz" -printf '%Pn'
In contrary to ls with * it will search for .tar.gz files recursively:
$ find -name "*.tar.gz" -printf '%Pn'
file1.tar.gz
dir/file3.tar.gz
file2.tar.gz
add a comment |
up vote
6
down vote
Or with GNU find:
find -name "*.tar.gz" -printf '%Pn'
In contrary to ls with * it will search for .tar.gz files recursively:
$ find -name "*.tar.gz" -printf '%Pn'
file1.tar.gz
dir/file3.tar.gz
file2.tar.gz
add a comment |
up vote
6
down vote
up vote
6
down vote
Or with GNU find:
find -name "*.tar.gz" -printf '%Pn'
In contrary to ls with * it will search for .tar.gz files recursively:
$ find -name "*.tar.gz" -printf '%Pn'
file1.tar.gz
dir/file3.tar.gz
file2.tar.gz
Or with GNU find:
find -name "*.tar.gz" -printf '%Pn'
In contrary to ls with * it will search for .tar.gz files recursively:
$ find -name "*.tar.gz" -printf '%Pn'
file1.tar.gz
dir/file3.tar.gz
file2.tar.gz
answered yesterday
Arkadiusz Drabczyk
7,64521734
7,64521734
add a comment |
add a comment |
up vote
3
down vote
A slightly more roundabout and loopy way:
for i in *.tar.gz; do
echo "$i"
done
EDIT: added quotes to handle weird filenames
4
touch -- '-e a.tar.gz'for a reason to quote your variables and unix.stackexchange.com/q/65803/117549 for reasons to use printf instead of echo
– Jeff Schaller
yesterday
oof, I just spent 5 minutes trying to figure out how to remove the resulting-e a.tar.gzfile
– snetch
yesterday
1
sorry!rm -- '-e a.tar.gz'should do the trick
– Jeff Schaller
yesterday
You're good, it was a lesson, and I did learn that--works forrmand a lot of others.
– snetch
yesterday
Thank you for that. It wouldn't be a complete question if someone didn't suggest a for-do loop to solve the problem. lol Upvoting.
– Jesse Steele
2 hours ago
add a comment |
up vote
3
down vote
A slightly more roundabout and loopy way:
for i in *.tar.gz; do
echo "$i"
done
EDIT: added quotes to handle weird filenames
4
touch -- '-e a.tar.gz'for a reason to quote your variables and unix.stackexchange.com/q/65803/117549 for reasons to use printf instead of echo
– Jeff Schaller
yesterday
oof, I just spent 5 minutes trying to figure out how to remove the resulting-e a.tar.gzfile
– snetch
yesterday
1
sorry!rm -- '-e a.tar.gz'should do the trick
– Jeff Schaller
yesterday
You're good, it was a lesson, and I did learn that--works forrmand a lot of others.
– snetch
yesterday
Thank you for that. It wouldn't be a complete question if someone didn't suggest a for-do loop to solve the problem. lol Upvoting.
– Jesse Steele
2 hours ago
add a comment |
up vote
3
down vote
up vote
3
down vote
A slightly more roundabout and loopy way:
for i in *.tar.gz; do
echo "$i"
done
EDIT: added quotes to handle weird filenames
A slightly more roundabout and loopy way:
for i in *.tar.gz; do
echo "$i"
done
EDIT: added quotes to handle weird filenames
edited yesterday
answered yesterday
snetch
15719
15719
4
touch -- '-e a.tar.gz'for a reason to quote your variables and unix.stackexchange.com/q/65803/117549 for reasons to use printf instead of echo
– Jeff Schaller
yesterday
oof, I just spent 5 minutes trying to figure out how to remove the resulting-e a.tar.gzfile
– snetch
yesterday
1
sorry!rm -- '-e a.tar.gz'should do the trick
– Jeff Schaller
yesterday
You're good, it was a lesson, and I did learn that--works forrmand a lot of others.
– snetch
yesterday
Thank you for that. It wouldn't be a complete question if someone didn't suggest a for-do loop to solve the problem. lol Upvoting.
– Jesse Steele
2 hours ago
add a comment |
4
touch -- '-e a.tar.gz'for a reason to quote your variables and unix.stackexchange.com/q/65803/117549 for reasons to use printf instead of echo
– Jeff Schaller
yesterday
oof, I just spent 5 minutes trying to figure out how to remove the resulting-e a.tar.gzfile
– snetch
yesterday
1
sorry!rm -- '-e a.tar.gz'should do the trick
– Jeff Schaller
yesterday
You're good, it was a lesson, and I did learn that--works forrmand a lot of others.
– snetch
yesterday
Thank you for that. It wouldn't be a complete question if someone didn't suggest a for-do loop to solve the problem. lol Upvoting.
– Jesse Steele
2 hours ago
4
4
touch -- '-e a.tar.gz' for a reason to quote your variables and unix.stackexchange.com/q/65803/117549 for reasons to use printf instead of echo– Jeff Schaller
yesterday
touch -- '-e a.tar.gz' for a reason to quote your variables and unix.stackexchange.com/q/65803/117549 for reasons to use printf instead of echo– Jeff Schaller
yesterday
oof, I just spent 5 minutes trying to figure out how to remove the resulting
-e a.tar.gz file– snetch
yesterday
oof, I just spent 5 minutes trying to figure out how to remove the resulting
-e a.tar.gz file– snetch
yesterday
1
1
sorry!
rm -- '-e a.tar.gz' should do the trick– Jeff Schaller
yesterday
sorry!
rm -- '-e a.tar.gz' should do the trick– Jeff Schaller
yesterday
You're good, it was a lesson, and I did learn that
-- works for rm and a lot of others.– snetch
yesterday
You're good, it was a lesson, and I did learn that
-- works for rm and a lot of others.– snetch
yesterday
Thank you for that. It wouldn't be a complete question if someone didn't suggest a for-do loop to solve the problem. lol Upvoting.
– Jesse Steele
2 hours ago
Thank you for that. It wouldn't be a complete question if someone didn't suggest a for-do loop to solve the problem. lol Upvoting.
– Jesse Steele
2 hours ago
add a comment |
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%2f484481%2fhow-to-list-tar-gz-one-filename-per-line%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
5
it is a good habit to use options before filenames. and you need to use -1 instead of -l
– AnonymousLurker
yesterday
14
ls -1 *.tar.gz, but what do you want to use the list for? If you are doing something to those filenames, thenlsis not the right way to do it. See Why *not* parse `ls` (and what do to instead)?– Kusalananda
yesterday
3
the manual you need is
man ls. Ensure that your display font has good contrast between 1 (one) and l (lower case letter ell).– ctrl-alt-delor
yesterday
1
Possible duplicate of Output from ls has newlines but displays on a single line. Why?
– Julien Lopez
18 hours ago