Tips

List The Files In A Directory

Today’s article is only going to be useful if you are a new user and don’t yet know how to list files in a directory. This is, of course, something you do in a terminal. I do believe this will be a quick and easy article, so read on if you don’t yet know how to list files in a directory.

If you’ve used Linux for more than a month, you can safely ignore this article.

Yes, this has been covered all over the web. This isn’t anything remotely new, nor is it anything all that complicated. However, this is a holiday weekend and I figure it’s a good article for new users who happen to be just browsing around. I’ve also covered some ‘ls’ commands before.

On the other hand, it should be a short article! So, there’s that!

List The Files In A Directory:

Of course, this article requires an open terminal, like many other articles on this site. Should you not know how to open the terminal, you can do so with your keyboard. Press CTRL + ALT + T and your default terminal should open.

With that terminal now open, let’s try a simple command:

ls

That will list all the files in the directory. If you’d like to see the output in columns, you can always try this command which lists the output in a denser manner.

ls -l

That command doesn’t list dot (hidden) files. Seeing as you’re in the home directory, you should have some hidden files. If you want to use the ‘ls’ command to show files, you need the -a flag. You can combine it with the above and use this command:

ls -la

That’s the command I use more often than not. This being Linux, you get to decide which how to use the command. I think I type the ‘ls -la‘ command out of habit.

Closure:

Well, you got an article. Sure, it’s a simple article but someone may find this important information. Of course, they could just use the man page   – but what’s the fun in that?

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

KGIII

Retired mathematician, residing in the mountains of Maine. I may be old and wise, but I am not infallible. Please point out any errors. And, as always, thanks again for reading.

Recent Posts

Meta: The State Of Linux Tips #23

Today's article is just a meta article, an article that I fail to write every…

22 hours ago

Is Your Storage Drive An SSD Or An HDD?

Today's article aims to answer a simple question, simply is your storage drive an SSD…

3 days ago

Monitor System Resources With “Resources”

Today is one of those days when I'd like to introduce you to new software…

5 days ago

Short: The Halt Command

Today's article is intentionally short because we're simply going to learn about the basics of…

7 days ago

Installing Flatpaks In Linux

Today we're going to have a pretty easy article where you'll learn about installing Flatpaks…

1 week ago

A Quick Look At The Shutdown Command

This is going to be just a quick article about a command many of you…

2 weeks ago