Featured

    Featured Posts

WORKING WITH DIRECTORIES

A directory is a location for storing files on your computer. To be able to administer your Linux distribution, you need to be familiar with commands that let you create, delete or move directories.
In Linux there’s only one root directory (represented by a single slash, “/“), and all files and subdirectories are placed under the root directory in a treelike structure.
linux root directory structure
To create a directory, you use the mkdir command:
linux mkdir command
To move a directory, you use the mv command with two parameters. The first paramter is the directory you would like to move and the second paramter is the location where you would like to move the directory to. For example, if we want to move the directory named my_folder to/home/bob/my_folder1 we would enter the following command:
linux mv command
To delete a directory we need to use the rmdir command. There is one problem with this command, though. If we try to delete a non-empty directory, we will get an error:
linux rmdir command
To avoid this we need to either empty the directory or use the different command, rm. If we use the rm command we also need to specify the -r option, which means that the command will remove the directory and its content recursively:
rm r option

NOTE – this chapter describes just a couple commands to work with directories. As we go through later chapter, we will describe many other commands.
author

Author Name

Author Description!

Get Free Email Updates to your Inbox!

Post a Comment

www.ccna.ma

yu
Powered by Blogger.

Translate

Copyright © Learn Linux Th3pro.xyz | Blogger Templates | Designed By Code TAOUSSI