Titel:

A free Basic UNIX-training with muLinux

Startseite
english
  
ISBN: B002RXNG7C   ISBN: B002RXNG7C   ISBN: B002RXNG7C   ISBN: B002RXNG7C 
 
  Wir empfehlen:       
 
[Back] [Home] [Forward]       http://rowa.giso.de  

A free Basic UNIX-training with muLinux

Making and Deleting Directories

Many files are created while working at the computer, these can be letters, graphics, spreadsheets, etc. To keep control it's best to put these files in directories. For example, a directory can be named "Office" . This directory can have subdirectories, like "letters", "invoices", "statements" etc.

As a normal user we have a home directory with our login name in the /home directory and we must put our directories and files in this directory. For example, if your login-name is "Robert" . Then our home directory would be: /home/Robert. It is common practice to use your name.

So you might create the directory structure:

/home/Robert/Office
/home/Robert/Office/letters
/home/Robert/Office/invoices
/home/Robert/Office/statements
Here the graphical version (in german):

Grafische Darstellung

Make directories with mkdir

Directories are created with the command mkdir (make directory). We give the name of the directory we want to createas a parameter .

/# cd /home
/home# mkdir Robert             Use your own name.
/home# cd Robert
/home/Robert# mkdir Office
/home/Robert# cd Office
/home/Robert/Office# mkdir letters
/home/Robert/Office# mkdir invoices
/home/Robert/Office# mkdir statements
/home/Robert/Office# ls
letters/    statements/     invoices/
/home/Robert/Office# _

First we change to our /home directory and create our directory Robert. Then we change to our home directory Robert and create the directory Office. In this directory we create the three subdirectories, letters, invoices, statements. These are listed with the command ls.

Remove a Directory with the Command rmdir or rm -r

Empty directories are removed with the command rmdir (remove directory).

/home/Robert/Office/# rmdir statements

Directories containing files can be removed with the command rm -r. The option -r means recursively.

/home/Robert/Office/# cd ..
/home/Robert/# rm -r Office

The directory Office is removed with all the subdirectories. Be aware that this command removes all the underlying directories and files.

Warning: When the command rm -r / is used by the superuser, all directories on all the harddisk are removed. This command is much more efficient than the format command in DOS. Format just deletes a harddisk. rm -r / removes all directories in the main directory. /. But because more devices (also from other machines on the network) are mounted in directories, this action would be fatal.

Help Commands

Many commands have various options, which are difficult to remember. The option --help with most commands in muLinux, lists these options. The next example will list the options for the command rm. Please don't forget the space after rm.

/# rm --help

Exercise

Create the following directory structure. Write down the commands and work them up on paper. Then enter and list them.
/home/robert/exercise
/home/robert/exercise/dir1
/home/robert/exercise/dir1/dir11
/home/robert/exercise/dir1/dir12
/home/robert/exercise/dir2
/home/robert/exercise/dir2/dir21
/home/robert/exercise/dir2/dir22

Here listed graphically (german):

[Back] [Home] [Forward]      
Robert.Warnke@giso.de (copyleft) Robert Warnke, Berlin (Germany) - You can write me in English. | http://rowa.giso.de | translated by mek, corrected by Bob Goodwin
  
Asus X5DIJ-SX155L 39,6 cm (15,6 Zoll) Notebook (Intel Pentium T4300 2.1GHz, 2GB RAM, 320GB HDD, Intel GMA 4500M, DVD, Linux)
von ASUS Computer
Siehe auch:
Kingston ValueRAM KVR800D2S5 / 2G DDR2 PC2-6400 2GB (Non-ECC, 80...
V7 Standard Front6 Loader Notebooktasche 39,6 cm (15,6 Zoll) pol...
Belkin Notebooktasche Business 39,6 cm (15,6 Zoll), schwarz
Belkin Notebook Neopren Schutzhülle 39,6 cm (15,6 Zoll), kohlens...
Logitech M305 optische Notebook Maus schurlos anthrazit
Logitech B110 Optical USB Mouse Maus optisch USB 3 Tasten 800 dp...
     
       
Zurück zur Themenseite:
StudyPaper.com/Startseite/Computer/Informatik

Das Setzen von Verweisen (Links) auf diese Seite ist gestattet und bedarf keine vorherige Absprache.
      Startseite  |  english  |  Bookmark setzen  |  Webseite weiterempfehlen  |  Copyright ©  |  Impressum