UNIX is a very powerful command-line
operating system, and Linux is our particular incarnation of UNIX.
You will use the UNIX command line
to launch programs like Csound and Common Music, tell the computer to play back
a sound, make directories and copy/move files, switch back and forth between
different programs, and more.
Some things that you can do via UNIX
you can also do via the KDE desktop, such as moving
files around. However, many things for this course can only be achieved through
the UNIX commands. You will serve yourself well by becoming comfortable with
both Gnome and UNIX. Basics | Changing Your Password | Checking Email | Reference Links | Basic UNIX Commands | Helpful Tricks in the BASH ShellBASICS
-
You execute UNIX commands by opening
and terminal window and typing commands into it.
A very important difference between
UNIX and other command-line systems (such as MSDOS) is that UNIX
is CASE SENSITIVE. The filename Foo.TXT is not the same
as the filename foo.txt.
The command to execute Csound is
a good example of a UNIX command:
csound -d -A -o mysound.aiff mysound.orc
mysound.sco
- csound is the command
- -d -A -o are "flags"
that set various options for the command. Flags are preceded by a "-".
- mysound.aiff mysound.orc
mysound.sco are the filenames that are going to be operated on.
CHANGING YOUR
PASSWORD
-
Because we use the Kerberos 5 password system
for access to our machines, your local
password is the same as your UW net-id password. If you wish to change it, you must
do so using the resources provided by the UW.
CHECKING EMAIL
-
To check your email, enter the
following in Unix:
ssh dante
(Or replace "dante" with
whatever machine your email account is on.)
BASIC
UNIX COMMANDS
-
| COMMAND
| ACTION
|
| GETTING HELP
|
|
| man <command-name>
| brings up a manual page for <command-name>
these can take some getting-used-to, but are very helpful for figuring out how better to use a command
|
| <command-name> --help
| for most UNIX commands, this will bring up a basic help page with information on flags available, etc.
|
| LOGGING IN
|
|
| whoami
| to see who is logged in on a
specific machine
|
| NAVIGATION
|
|
| cd directory_name
| change to specified directory
if no directory is specified, you will return to your home directory
/Music401/yourname
|
| CD ..
| move up one directory level
../../../ would move you up three directories
|
| CD
| change to your home directory
|
| CD ~/SND
| change to the SND folder inside
your home directory (~ is a shortcut for your home)
|
| pwd
| gives pathname of the directory
you're in right now ("present working directory")
|
| WORKING WITH FILES
|
|
| more filename
| shows contents of a file one
screen's worth at a time
you cannot edit using more
|
| cp filename
newfilename
filename newfilename>
| copies the first file listed
into a file with the second name
if a file by the name of newfilename already existed, you will
overwrite it
|
| mv filename
place_or_newfilename
| moves a file to a file of a
new name (a/k/a renames) OR moves a file to a new location (a directory,
for example)
|
| rm filename
| removes (forever) a file
|
| ls
| lists all files and directories
within your current directory. on our UNIX system, directories will have
a slash (/) before their names
|
| ls -l
| list files in "long"
format -- giving extra information like permissions, size, etc.
|
| ls -a
| list "all" files,
including hidden files (hidden files are files that start with a "."
-- often used to store configuration settings for applications
|
| WORKING WITH DIRECTORIES
|
|
| mkdir directory_name
| creates a directory
|
| rmdir directory_name
| removes a directory
does not work if anything is in the directory
|
HELPFUL TRICKS
IN THE BASH SHELL
-
When you are typing commands in
a terminal window, this is sometimes also called typing into the shell.
The shell is the environment that lets you type commands into UNIX
There a many different types of
shells that can run under UNIX, each providing different, special capabilities.
The computers in Computer Music are set to run the bash shell (a.k.a.Bourne Again
Shell). It is the standard UNIX C shell with some extra features.
Here are some of the most useful:
Command Line Editing
- Typing the Up-Arrow
key makes the previously executed command appear.
You can keep hitting up-arrow to keep moving back through history.
The down-arrow key moves forward in history.
- You can use the Left-Arrow
and Right-Arrow keys to move back and forth in a command line.
You can then edit the line by deleting and typing characters.
- The following Xemacs-like
commands also work:
- Ctrl-a jumps to
the beginning of the line.
- Ctrl-e jumps to
the end of the line.
Auto Completion
- To repeat your previous command,
you can just enter !.
- To repeat a previously-used
command, type ! followed by enough letters of the command to uniquely
identify it.
For example, if I had recently executed a Csound command and now wanted
to execute the same command again, I could type:
cootie 6$ !cs
and the computer would
respond by executing my last csound command:
csound -d -A -o ex1b.aiff ex1b.orc ex1b.sco
- When you are entering a command
that references an existing file, type in a few letters of the filename
and then press tab -- UNIX will then attempt to auto-complete the
filename based on what you've typed in.
|