This is an old revision of the document!
Linux Basics
Files, Directories and Paths
- a @@file@@ is a collection of data with a name (a @@filename@@ to be precise). Although it may be stored in seporate chuncks in different location on the hardware, programs will generaly work with a file as a single contiuous collection of data.
- a @@directory@@ is construct for grouping and organizing @@files@@. In UNIX and Linux, @@directories@@ can contain, @@files@@, other @@directories@@, @@links@@ and @@devices@@. You may be use to calling directories @@folders@@ or @@namespaces@@.
- a @@path@@ is a way of nameing the location of a file, directory, link or device. @@Pathes@@ can be @@relative@@ or @@absolute@@ and are often used as the prefix to a filename. For example, if I want to list the contents of a directory that is in my home directory called
cheese
, I can type:ls ~/cheese/
- a @@link@@ is a filesystem pointer. You may be use to calling a @@link@@ an @@alias@@ or a @@shortcut@@
Programs, commands and your Shell
* a shell is the interactive command line interpreter to Unix. Typically you will have a prompt that looks like “%” or “~%”. Usually you will see it in an xterm which looks like a small terminal window.
Shell commands
- “ls, ls -a, ls -l, ls -la, etc. ”: lists the files in your current working directory for that shell.
- cd directory : changes the current working directory to directory where directory may be a fully qualified path. A ~ indicates your home directory. ~bob indicates the home directory of bob.
- “rm filename” : removes the file filename where filesname may be a fully qualified path
- “cp source destination” : copies the file source to the file destination where source and destination may be fully qualified paths.
- “mv source destination” : the same as cp, but it moves the source file instead of copying it. mv can also be used to rename a file with mv oldname newmane
- “chmod #### file or directory” : changes the file or directory permissions for letter yourself and other people access your files. see man chmod for more info.
Basic Utilities
- Printing: the lpr command is the basic printing command. in your shell, type: “lpr filename ” to print the file filename to the printer specified in printername or “lpq” to get a list of jobs sent to the printer.
- File compression: “gzip filename” will compress the file filename and give it the .gz name extension. “gzip -d filename.gz” or “gunzip filename.gz” will decompress the file and remove the .gz extension.
Where to go from here
Help on any Unix command or system call can be found in the man pages. In your shell, type: “man command” and it will tell you all you ever wanted to know about how to use that command. There are two very useful books in the co-op bookstore on Unix. See the sign on the window side of the asprey lab. if you need help with emacs, pick up an emacs command reference page from thefolder above the terminal next to the asprey printer. If you are still having trouble, email or find Ben (<html><script type='text/javascript'>var a = new Array('assar.ed','ben@cs.v','u');document.write(“<a href='mailto:”+a[1]+a[0]+a[2]+“'>”+a[1]+a[0]+a[2]+“</a>”);</script></html>)