pavement

DIR

From FreeBSDwiki
(Difference between revisions)
Jump to: navigation, search
Line 3: Line 3:
 
[[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.
  
Windows:
+
'''dir *.txt''' is equivalent to '''ls | grep .txt'''
  
dir *.txt
+
'''dir boogy*.*''' is equivalent to '''ls | grep boogy'''
  
Unix:
+
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]].
 
+
ls | grep .txt
+
 
+
Windows:
+
 
+
dir boogy*.*
+
 
+
Unix:
+
 
+
ls | grep boogy
+
  
 
[[Category:Windows Equivalents]]
 
[[Category:Windows Equivalents]]

Revision as of 14:27, 25 August 2004

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

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.

Personal tools