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,157
Reaction score
6,994
Credits
66,234
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,149
Reaction score
7,035
Credits
31,506
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,157
Reaction score
6,994
Credits
66,234
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
962
Reaction score
425
Credits
8,299
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,157
Reaction score
6,994
Credits
66,234
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,157
Reaction score
6,994
Credits
66,234
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
962
Reaction score
425
Credits
8,299
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
962
Reaction score
425
Credits
8,299
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,157
Reaction score
6,994
Credits
66,234
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.
 
$200 Digital Ocean Credit
Get a free VM to test out Linux!


Staff online


Latest posts

Top