pavement

DIR

From FreeBSDwiki
(Difference between revisions)
Jump to: navigation, search
(clarify opening paragraph)
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Under FreeBSD and other unix-like OSes, the equivalent command is [[ls]].
+
'''DIR''' is a DOS command for listing files.  Under FreeBSD and other unix-like OSes, the equivalent command is [[ls]].
  
[[ls]] is best combined with [[grep]] if you plan on doing any filtering.
+
[[ls]] is best combined with [[grep]] if you plan on doing any filtering: '''dir *.txt''' is equivalent to '''ls | grep .txt''', and '''dir boogy*.*''' is equivalent to '''ls | grep boogy'''.
  
'''dir *.txt''' is equivalent to '''ls | grep .txt'''
+
Note that in the second example, '''ls | grep boogy''' is actually directly equivalent to '''dir *boogy*.*''', not just '''dir boogy*.*'''.  If you really want to only find instances in which "boogy" is the very beginning of the filename, you'll need to delve into using grep with [[regular expressions]].
 
+
'''dir boogy*.*''' is equivalent to '''ls | grep boogy'''
+
 
+
Note that in this second example, '''ls | grep boogy''' is actually directly equivalent to '''dir *boogy*.*''', not just '''dir boogy*.*'''.  If you really want to only find instances in which "boogy" is the very beginning of the filename, you'll need to delve into using grep with [[regular expressions]].
+
  
 
[[Category:Windows Equivalents]]
 
[[Category:Windows Equivalents]]

Latest revision as of 18:59, 19 June 2006

DIR is a DOS command for listing files. Under FreeBSD and other unix-like OSes, the equivalent command is ls.

ls is best combined with grep if you plan on doing any filtering: dir *.txt is equivalent to ls | grep .txt, and dir boogy*.* is equivalent to ls | grep boogy.

Note that in the second example, ls | grep boogy is actually directly equivalent to dir *boogy*.*, not just dir boogy*.*. If you really want to only find instances in which "boogy" is the very beginning of the filename, you'll need to delve into using grep with regular expressions.

Personal tools