User Tools

Site Tools


Some very basic UNIX commands to copy files and directories

First, open a terminal window by double clicking on the desktop icon that says “terminal” or the square icon that looks vaguely like a computer monitor at the top of the real screen. Type UNIX commands in this window. You can select text with the mouse, but you can only move the cursor by using the arrow keys and you can only type in the last line. To recall a command you typed in earlier, use the up arrow key until that command appears at the prompt.

Some Commands Include:

  • ls = list the contents of your current directory
Desktop                 Library                 Pictures
Documents               Movies                  Public
Downloads               Music                   Sites
IASViewer               Opera 7 pyth
  • cd <path> = change directory with the <path> replaced with the name of the directory you want to go to.
102}cd pyth
Analysis Goals                  ToySnakes
Analysis Goals & thoughts       diveintopython-5.4
FlexibleLineBugs                examples & info                     old test
LineBugs alias                  test files
  • <path> can include a directory in your current directory as in the example above, “..” which sends you up one directory (cd ..), or a path all the way from the computer hard drive, e.g. /share/Data/VolumeData. The initial “/” indicates that the path to the directory you want starts at the hard drive level.
  • To make a directory, use the command “mkdir <directory name>” as in
Desktop                 Library                 Pictures
Documents               Movies                  Public
Downloads               Music                   Sites
IASViewer               Opera 7 pyth
115}mkdir A_test_dir
A_test_dir              Library                 Public
Desktop                 Movies                  Sites
Documents               Music                   pyth
Downloads               Opera 7
IASViewer               Pictures
  • To copy a file, use “cp <file name> <path and new file name>”.
  • To copy a bunch of files to a directory, you can use the wild card “*”. To copy files from a local directory to a remote directory, this is one format: cp *.* <path> and an example:
117}cd A_test_dir/
119}cd ../Public/
Drop Box              
121}cp *.* ../A_test_dir/
122}cd ../A_test_dir/

Note that the directory “Drop Box” was not copied.

keckcaves/copying_files_in_unix.txt · Last modified: 2009/05/02 17:20 by sumner