Music 824: Computer Applications in Music Research
Ohio State University
School of Music



Navigating the Unix System of Directories


Most computer systems organize files in a hierarchy of folders or directories. So, for example, a file containing an assignment (called "1st_assignment") might be stored in a directory called "Assignments"; that directory might in turn be stored in a directory called "Music824", which is stored in "Schoolwork". We can represent the full location of the file as:

/Schoolwork/Music824/Assignments/1st_assignment
Notice the use of slashes (/) to separate each of the components in the location. Also notice that the location begins with a leading slash. When a location begins with a slash it is referred to as an absolute location.

Every file in the computer system can be referred to by its absolute location. For example, the following are all absolute locations:

/Universe/SolarSystem/Earth/NorthAmerica/USA/Ohio/Columbus/OSU/WeigelHall
/Filesystem/Username/Directory/Subdirectory/file
/var/opt/Humdrum/Scores/Bach/Brandenburg/bwv1047a.krn

Files and directories can also be referred to using a relative location. On the OSU campus, you can say "I'm going to Hughes Hall" and people will understand what you mean. But if you were in Vienna, no one would understand where you were going. In order to be understood in Vienna, you would have to say, "I'm going to Columbus, Ohio in the United States; and on the Ohio State University campus there is a building called "Hughes Hall." That's where I'm going." On the Unix system, relative locations are evident whenever the leading slash is missing. For example, the following are all relative locations:

OSU/WeigelHall
Username/Directory/Subdirectory/file
bwv1047a.krn

Relative locations are always relative to a working directory. Whenever you use the Unix shell (the window in which you type commands), your window resides in a location on the system. For example, your shell might reside at the following working directory:

/Universe/SolarSystem/Earth/NorthAmerica/USA/Ohio/Columbus/OSU
/Filesystem/Username/
/var/opt/Humdrum/Scores/Bach/Brandenburg/bwv1047a.krn

The ls command lists all of the files and subdirectories in the current directory.

CommandAction
ls list the files and subdirectories for the current directory
ls -l list the files and subdirectories for the current directory (long format)
cd X change directory to directory named X
cd .. go up one directory level
pwd Present Working Directory -- identify the name of the current directory
date display date and time
man X display manual pages for command X
more X display contents of file named X
mv X Y move a file; i.e., rename the file X (old) to the name Y (new)
cp X Y copy the file named X as the new file named Y
rm X remove a file; delete file named X
rmdir X remove a directory; delete directory named X
mkdir X make a directory; create directory named X
pico X invoke `pico' text editor for file named X

Useful information regarding UNIX can be found at innumerable web sites. Some useful sources are



This document is available at http://csml.som.ohio-state.edu/Music824/unix.html