|
|
|
||||
|
|
|||||
. cd -- change directory
pwd -- print working directory
dir -- directory listing
ls -- directory listing
type -- type (display) a file to the screen
mkdir -- make a new directory
copy -- copy a file
erase -- erase (delete) a file
Many of these commands are similar to Unix or DOS commands.
. pwd
pwd
dir
dir *.do
ls *.raw
type hsbbatch.do
type ascii.raw
type cls2.log
type schdat.dta
The pwd command displays the current working directory, while the dir displays a directory listing. The ls is the same as dir. The "*" is called a wild card and is used to match a number of files that have a common prefix or postfix. The type displays the contents of a file to the screen. Notice that when you use type with a Stata data file you get jibberish. That is because Stata data files have their own special format. type only works with files that are in ascii format: .raw, .do, .log, .hlp and .ado.
. mkdir stata2
copy hsb2.dta stata2\hsbnew.dta
cd stata2
dir
erase hsbnew.dta
dir
cd ..
pwd
The mkdir creates a new sub-directory. The copy command makes a copy of a file. The command erase deletes a file. Typing the command cd .. takes you up one level in the directory structure.
. pwd
dir
ls *.raw
mkdir ctata2
copy hsb2.dat stata2\hsbnew.dta
cd stata2
dir
erase hsbnew.dta
dir
cd ..
The Stata Class Notes are available on the World Wide Web by visiting ...
http://www.ats.ucla.edu/stat/stata/notes/
The dataset hsb2.dta can be loaded directly into Stata, over the Internet, using the
following command:
use http://www.ats.ucla.edu/stat/stata/notes/hsb2
UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services