07.06.2014 Views

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

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.

$ pwd<br />

/home/rhertzog<br />

$ cd Desktop<br />

$ pwd<br />

/home/rhertzog/Desktop<br />

$ cd .<br />

$ pwd<br />

/home/rhertzog/Desktop<br />

$ cd ..<br />

$ pwd<br />

/home/rhertzog<br />

$ ls<br />

Desktop Downloads Pictures Templates<br />

Documents Music Public Videos<br />

A new directory can be created with mkdir directory, and an existing (empty) directory can<br />

be removed with rmdir directory. The mv command allows moving and/or renaming files and<br />

directories; removing a file involves rm file.<br />

$ mkdir test<br />

$ ls<br />

Desktop Downloads Pictures Templates Videos<br />

Documents Music Public test<br />

$ mv test new<br />

$ ls<br />

Desktop Downloads new Public Videos<br />

Documents Music Pictures Templates<br />

$ rmdir new<br />

$ ls<br />

Desktop Downloads Pictures Templates Videos<br />

Documents Music Public test<br />

B.1.2. Displaying and Modifying Text Files<br />

The cat file command (intended to concatenate files on its standard output) reads a file and<br />

displays its contents in the terminal. If the file is too big to fit on a screen, use a pager such as<br />

less (or more) to display it page by page.<br />

The editor command always points at a text editor (such as vi or nano) and allows creating,<br />

modifying and reading text files. The simplest files can sometimes be created directly from the<br />

command interpreter thanks to redirection: echo "text" >file creates a file named file with<br />

“text” as its contents. Adding a line at the end of this file is possible too, with a command such<br />

as echo "line" >>file.<br />

438 The Debian Administrator's Handbook

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

Saved successfully!

Ooh no, something went wrong!