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,069
Reaction score
6,921
Credits
65,510
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,101
Reaction score
6,980
Credits
31,134
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,069
Reaction score
6,921
Credits
65,510
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
923
Reaction score
395
Credits
7,834
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,069
Reaction score
6,921
Credits
65,510
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,069
Reaction score
6,921
Credits
65,510
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
923
Reaction score
395
Credits
7,834
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
923
Reaction score
395
Credits
7,834
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,069
Reaction score
6,921
Credits
65,510
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.
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation

Members online


Latest posts

Top