List only regular files
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I desire to list all inodes in current directory that are regular files (i.e. not directories, links, or special files), with ls -la
(ll
).
I went to the man ls
searching for type
and found only this which I didn't quite understand in that regard:
--indicator-style=WORD
append indicator with style WORD to entry names: none (default), slash
(-p), file-type (--file-type),
classify (-F)
How could I list only regular files with ls -la
(ll
as my shortcut in Ubuntu 18.04)?
ls inode
add a comment |Â
up vote
1
down vote
favorite
I desire to list all inodes in current directory that are regular files (i.e. not directories, links, or special files), with ls -la
(ll
).
I went to the man ls
searching for type
and found only this which I didn't quite understand in that regard:
--indicator-style=WORD
append indicator with style WORD to entry names: none (default), slash
(-p), file-type (--file-type),
classify (-F)
How could I list only regular files with ls -la
(ll
as my shortcut in Ubuntu 18.04)?
ls inode
1
Possible duplicate of How to output only file names (with spaces) in ls -Al?
– eyoung100
2 hours ago
1
Possible duplicate of List only regular files (but not directories) in current directory
– Stephen Kitt
22 mins ago
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I desire to list all inodes in current directory that are regular files (i.e. not directories, links, or special files), with ls -la
(ll
).
I went to the man ls
searching for type
and found only this which I didn't quite understand in that regard:
--indicator-style=WORD
append indicator with style WORD to entry names: none (default), slash
(-p), file-type (--file-type),
classify (-F)
How could I list only regular files with ls -la
(ll
as my shortcut in Ubuntu 18.04)?
ls inode
I desire to list all inodes in current directory that are regular files (i.e. not directories, links, or special files), with ls -la
(ll
).
I went to the man ls
searching for type
and found only this which I didn't quite understand in that regard:
--indicator-style=WORD
append indicator with style WORD to entry names: none (default), slash
(-p), file-type (--file-type),
classify (-F)
How could I list only regular files with ls -la
(ll
as my shortcut in Ubuntu 18.04)?
ls inode
ls inode
edited 22 mins ago
Stephen Kitt
154k23340409
154k23340409
asked 2 hours ago
JohnDoea
72731
72731
1
Possible duplicate of How to output only file names (with spaces) in ls -Al?
– eyoung100
2 hours ago
1
Possible duplicate of List only regular files (but not directories) in current directory
– Stephen Kitt
22 mins ago
add a comment |Â
1
Possible duplicate of How to output only file names (with spaces) in ls -Al?
– eyoung100
2 hours ago
1
Possible duplicate of List only regular files (but not directories) in current directory
– Stephen Kitt
22 mins ago
1
1
Possible duplicate of How to output only file names (with spaces) in ls -Al?
– eyoung100
2 hours ago
Possible duplicate of How to output only file names (with spaces) in ls -Al?
– eyoung100
2 hours ago
1
1
Possible duplicate of List only regular files (but not directories) in current directory
– Stephen Kitt
22 mins ago
Possible duplicate of List only regular files (but not directories) in current directory
– Stephen Kitt
22 mins ago
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
5
down vote
ls
doesn’t have an option to do this, and you shouldn’t parse its output to filter regular files.
find
can be used to find and list regular files instead of ls
. Another option is to use Zsh and its glob qualifiers:
ls -l -- *(D.)
lists all regular files, including those whose name starts with a dot.
add a comment |Â
up vote
2
down vote
find . -maxdepth 1 -type f -ls
This would give you the regular files in the current directory in a format similar to what you would get with ls -lisa
(but only showing regular files, thanks to -type -f
on the command line).
add a comment |Â
up vote
1
down vote
Well when you use -a is shows everything that is hidden; hidden files and folders. Instead of ls, you'll probably want to use the find command instead. This should help you get started:
find -type f -exec ls -la ;
You'll need to change to the directory you want to search first.
New contributor
The Letter M is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
You probably should use-maxdepth 1
to stop thefind
descending into subdirectories.
– roaima
1 hour ago
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
ls
doesn’t have an option to do this, and you shouldn’t parse its output to filter regular files.
find
can be used to find and list regular files instead of ls
. Another option is to use Zsh and its glob qualifiers:
ls -l -- *(D.)
lists all regular files, including those whose name starts with a dot.
add a comment |Â
up vote
5
down vote
ls
doesn’t have an option to do this, and you shouldn’t parse its output to filter regular files.
find
can be used to find and list regular files instead of ls
. Another option is to use Zsh and its glob qualifiers:
ls -l -- *(D.)
lists all regular files, including those whose name starts with a dot.
add a comment |Â
up vote
5
down vote
up vote
5
down vote
ls
doesn’t have an option to do this, and you shouldn’t parse its output to filter regular files.
find
can be used to find and list regular files instead of ls
. Another option is to use Zsh and its glob qualifiers:
ls -l -- *(D.)
lists all regular files, including those whose name starts with a dot.
ls
doesn’t have an option to do this, and you shouldn’t parse its output to filter regular files.
find
can be used to find and list regular files instead of ls
. Another option is to use Zsh and its glob qualifiers:
ls -l -- *(D.)
lists all regular files, including those whose name starts with a dot.
edited 7 mins ago


Stéphane Chazelas
291k54543882
291k54543882
answered 2 hours ago
Stephen Kitt
154k23340409
154k23340409
add a comment |Â
add a comment |Â
up vote
2
down vote
find . -maxdepth 1 -type f -ls
This would give you the regular files in the current directory in a format similar to what you would get with ls -lisa
(but only showing regular files, thanks to -type -f
on the command line).
add a comment |Â
up vote
2
down vote
find . -maxdepth 1 -type f -ls
This would give you the regular files in the current directory in a format similar to what you would get with ls -lisa
(but only showing regular files, thanks to -type -f
on the command line).
add a comment |Â
up vote
2
down vote
up vote
2
down vote
find . -maxdepth 1 -type f -ls
This would give you the regular files in the current directory in a format similar to what you would get with ls -lisa
(but only showing regular files, thanks to -type -f
on the command line).
find . -maxdepth 1 -type f -ls
This would give you the regular files in the current directory in a format similar to what you would get with ls -lisa
(but only showing regular files, thanks to -type -f
on the command line).
answered 2 hours ago


Kusalananda
113k15217345
113k15217345
add a comment |Â
add a comment |Â
up vote
1
down vote
Well when you use -a is shows everything that is hidden; hidden files and folders. Instead of ls, you'll probably want to use the find command instead. This should help you get started:
find -type f -exec ls -la ;
You'll need to change to the directory you want to search first.
New contributor
The Letter M is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
You probably should use-maxdepth 1
to stop thefind
descending into subdirectories.
– roaima
1 hour ago
add a comment |Â
up vote
1
down vote
Well when you use -a is shows everything that is hidden; hidden files and folders. Instead of ls, you'll probably want to use the find command instead. This should help you get started:
find -type f -exec ls -la ;
You'll need to change to the directory you want to search first.
New contributor
The Letter M is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
You probably should use-maxdepth 1
to stop thefind
descending into subdirectories.
– roaima
1 hour ago
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Well when you use -a is shows everything that is hidden; hidden files and folders. Instead of ls, you'll probably want to use the find command instead. This should help you get started:
find -type f -exec ls -la ;
You'll need to change to the directory you want to search first.
New contributor
The Letter M is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Well when you use -a is shows everything that is hidden; hidden files and folders. Instead of ls, you'll probably want to use the find command instead. This should help you get started:
find -type f -exec ls -la ;
You'll need to change to the directory you want to search first.
New contributor
The Letter M is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
The Letter M is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
answered 2 hours ago


The Letter M
313
313
New contributor
The Letter M is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
The Letter M is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
The Letter M is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
You probably should use-maxdepth 1
to stop thefind
descending into subdirectories.
– roaima
1 hour ago
add a comment |Â
1
You probably should use-maxdepth 1
to stop thefind
descending into subdirectories.
– roaima
1 hour ago
1
1
You probably should use
-maxdepth 1
to stop the find
descending into subdirectories.– roaima
1 hour ago
You probably should use
-maxdepth 1
to stop the find
descending into subdirectories.– roaima
1 hour 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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f480035%2flist-only-regular-files%23new-answer', 'question_page');
);
Post as a guest
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
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
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
1
Possible duplicate of How to output only file names (with spaces) in ls -Al?
– eyoung100
2 hours ago
1
Possible duplicate of List only regular files (but not directories) in current directory
– Stephen Kitt
22 mins ago