• Check it out - we have a chatbot! Go ask TuxBot a question in the Ask Tuxbot section!

Today's article is just a quick one about the 'dir' command...

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
8,576
Reaction score
7,328
Credits
69,725
I figured I'd write about the 'dir' command, 'cause I am always using the 'ls' command. It's just a very quick article that introduces the command.


I do love me some feedback.
 


wizardfromoz

Administrator
Staff member
Gold Supporter
Joined
Apr 30, 2017
Messages
8,392
Reaction score
7,294
Credits
33,477
Worth mentioning? (I whacked the mole for 5 anyway)

dir -al

also lists from the left the permissions, ownership and file sizes

Wiz
 
OP
K

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
8,576
Reaction score
7,328
Credits
69,725
I do mention that specific command, but didn't mention that it showed the permissions and file sizes.

That'll be easy enough to edit.

Thanks!
 

CrazedNerd

Well-Known Member
Joined
Mar 31, 2021
Messages
1,150
Reaction score
526
Credits
9,921
It's nice that you can also use "dir" in windows to do the exact same thing.
 
OP
K

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
8,576
Reaction score
7,328
Credits
69,725
Thread updated and the following link added for informative reasons:

 
OP
K

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
8,576
Reaction score
7,328
Credits
69,725
It's nice that you can also use "dir" in windows to do the exact same thing.

I haven't used Windows in a long time, but I recall the dir command from way back in the DOS days. I have no idea if the flags are the same (often called switches in the Windows world, less so in the Linux world)?
 

CrazedNerd

Well-Known Member
Joined
Mar 31, 2021
Messages
1,150
Reaction score
526
Credits
9,921
I haven't used Windows in a long time, but I recall the dir command from way back in the DOS days. I have no idea if the flags are the same (often called switches in the Windows world, less so in the Linux world)?
The flags on windows are done with a slash like /A i believe instead of the dash like in linux. I would not count on them being terribly similar!
 

CrazedNerd

Well-Known Member
Joined
Mar 31, 2021
Messages
1,150
Reaction score
526
Credits
9,921
well now that i've learned that dir is not just a windows program, i like it since it by default lists things in columns. In terms of text files, scripts, etc...my home folder has gotten pretty massive! I try to think about it as little as possible and back up the stuff that's more important:

Code:
ls | wc -l
206
 
Last edited:
OP
K

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
8,576
Reaction score
7,328
Credits
69,725
Just so you're aware - you do *not* parse the output of 'ls'. It's a terrible not good horrible idea!


That said, I parse the output of ls all the time. We're just not supposed to do so. (Pay attention to the highest rated answers, plural.)

I'm pretty good about using directories other than directly in my home directory. I use sub-directories in Downloads or Documents or just those directories. Those directories are a hot mess but my regular home directory is itself pretty organized. That's cause that's what I care about - it's all my config files and whatnot. When I do (very rarely) install a new OS, that's what I care about importing. That's usually only when I get a new device. I'm pretty good at only needing to install the OS once.
 
MALIBAL Linux Laptops

Linux Laptops Custom Built for You
MALIBAL is an innovative computer manufacturer that produces high-performance, custom laptops for Linux.

For more info, visit: https://www.malibal.com

Members online


Top