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

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
10,161
Reaction score
8,723
Credits
84,139
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,951
Reaction score
7,922
Credits
37,703
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
10,161
Reaction score
8,723
Credits
84,139
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!
 
C

CrazedNerd

Guest
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
10,161
Reaction score
8,723
Credits
84,139
Thread updated and the following link added for informative reasons:

 
OP
K

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
10,161
Reaction score
8,723
Credits
84,139
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)?
 
C

CrazedNerd

Guest
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!
 
C

CrazedNerd

Guest
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 by a moderator:
OP
K

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
10,161
Reaction score
8,723
Credits
84,139
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.
 

Members online

No members online now.

Latest posts

Top