31.10.2012 Views

The Databar System at DTU - G-Bar Wiki

The Databar System at DTU - G-Bar Wiki

The Databar System at DTU - G-Bar Wiki

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

16 <strong>The</strong> <strong>D<strong>at</strong>abar</strong> <strong>System</strong> <strong>at</strong> <strong>DTU</strong><br />

Copy, delete, and move documents You can copy a document with the<br />

command cp (copy) followed by the old and the new names, as shown here.<br />

Th<strong>at</strong> is,<br />

n-62-14-4(s001234) $ cp old.letter new.letter<br />

will establish a new document with the name new.letter, and it will be exactly<br />

like the old.letter. <strong>The</strong> command can also be used to copy several documents<br />

<strong>at</strong> once. In th<strong>at</strong> case the “new name” is not a file name, but a new folder name<br />

instead. If you are in the sub-directory (folder) dir.no.1, the command<br />

n-62-14-4(s001234) $ cp ../doc* .<br />

copies the files doc1 and doc2 down to dir.no.1. Note th<strong>at</strong> ‘..’ denotes the<br />

folder th<strong>at</strong> is just one level above the current folder, and ‘.’ denotes the folder<br />

you are currently in. <strong>The</strong> character ‘*’ is a so-called wild card character th<strong>at</strong><br />

can stand in for any string of characters (so the command doc* gives you all<br />

documents th<strong>at</strong> begin with doc).<br />

You can delete a document with the command rm (remove) followed by the<br />

document name (providing th<strong>at</strong> you have a write access to the documents and<br />

folders). For example, the command<br />

n-62-14-4(s001234) $ rm doc1<br />

deletes the file doc1.<br />

A document can be moved with the command mv (move). <strong>The</strong> same command<br />

is used to change the name of a document. For example, the command<br />

n-62-14-4(s001234) $ mv doc2 dir.no.1/doc7<br />

moves the document doc2 to the folder dir.no.1 and <strong>at</strong> the same time the<br />

name will be changed to doc7.<br />

Make and delete folders You can make a new folder with mkdir (make<br />

directory). For example,<br />

n-62-14-4(s001234) $ mkdir newdir<br />

makes a new folder with the name newdir. <strong>The</strong> command<br />

n-62-14-4(s001234) $ rmdir newdir<br />

(remove directory) will delete it again. (A folder can only be deleted with this<br />

command, if it is empty.)<br />

If the folder contains files, the command<br />

n-62-14-4(s001234) $ rm -r newdir<br />

(remove recursive) will delete the folder and all files and other folders under<br />

it. 6<br />

6 By default, G-<strong>Bar</strong> asks you to confirm every file th<strong>at</strong> you you delete – And this may seem<br />

like unnecessary work if you have several hundred files to delete. Thus, it is possible to work

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!