Next: Other commands
Up: Basic Unix
Previous: Help!
  Contents
  Index
Here is a list of basic commands for viewing, copying and moving the files in your directory,
creating new subdirectories and navigating. Go ahead and experiment with
these commands.
- ls is a command to list the files in the present working directory.
You can give it options, for example ls -l will give listings with more
information about the files than ls.
- pwd tells you where you are. This can be useful if you have
created many subdirectories.
- cd allows you to change the current working directory. You can give
it an absolute or a relative argument. cd .. would move you to
the next highest subdirectory. cd /ncsu/pams046/bin would move you
to the the /ncsu/pams046/bin subdirectory, etc.
- mkdir allows you to create a subdirectory. mkdir test would
create the subdirectory test. rmdir test would remove it. You can
only remove empty subdirectories.
- rm allows you to remove a file. It is aliased as rm -i, which
means that it will ask if you really want to remove the file. rm test.log would
remove the file test.log.
- mv moves a file. mv file.orig file.new would move the file
file.orig to file.new. You can think of it as renaming.
- cp copies one or more files. cp file1 file2 copies the
file file1 to the file file2. cp file1 file2 direct would
copy the files file1 file2 to the directory direct.
- chmod is a rather complex command to change the permissions on
files. You can write batch files, and use chmod to allow execution
of them.
- more will display the contents of a file. Use it as more filename.
While in more, typing a q will get you out. On some systems, the command
less is a more feature-rich replacement for more.
Next: Other commands
Up: Basic Unix
Previous: Help!
  Contents
  Index
Christopher Basten
2002-03-27