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

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
11,497
Reaction score
9,994
Credits
95,326
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.
 


Worth mentioning? (I whacked the mole for 5 anyway)

dir -al

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

Wiz
 
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!
 
It's nice that you can also use "dir" in windows to do the exact same thing.
 
Thread updated and the following link added for informative reasons:

 
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)?
 
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!
 
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:
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


Top