Tuesday 29 March 2016

Hadoop Directory Management


Directory:
A directory is a record whose sole occupation is to store file names and related data. All records, whether standard, unique, or index, are contained in registries.

UNIX utilizes a various leveled structure for arranging records and registries. This structure is regularly alluded to as an index tree . The tree has a solitary root hub, the slice character (/), and every other directorie are contained beneath it.

Home Directory:

The directory in which you get yourself when you first login is called your home registry.

You will be doing quite a bit of your work in your home registry and subdirectories that you'll be making to sort out your records.

You can go in your home registry at whatever time utilizing the accompanying charge −
$cd ~
$
Here ~ shows home index. On the off chance that you need to go in some other client's home catalog then utilize the accompanying charge −
$cd ~username
$
To go in your last registry you can utilize taking after order −
$cd -
$
Absolute/Relative Path names:

Registries are orchestrated in a chain of command with root (/) at the top. The position of any document inside of the chain of command is depicted by its pathname.

Components of a pathname are isolated by a/. A pathname is outright on the off chance that it is depicted in connection to root, so supreme pathnames dependably start with a/.

These are some sample of outright filenames.

/etc/passwd
/users/sjones/chem/notes
/dev/rdsk/Os3
A path name can likewise be with respect to your present working registry. Relative path names never start with/. With respect to client amrood' home registry, some path names may resemble this −

chem/notes
personal/res
To figure out where you are inside of the filesystem order whenever, enter the charge pwd to print the present working catalog −

$pwd
/user0/home/amrood

$
Listing Directories:

To list the documents in a catalog you can utilize the accompanying sentence structure −

 $ls dirname
Taking after is the case to rundown every one of the records contained in/usr/neighborhood index −

$ls /usr/local

X11       bin          gimp       jikes       sbin
ace       doc          include    lib         share
atalk     etc          info       man         ami
Creating Directories:

Catalogs are made by the accompanying order −

$mkdir dirname
Here, catalog is the total or relative pathname of the registry you need to make. For instance, the charge −

$mkdir mydir
$
Makes the catalog mydir in the present index. Here is another sample −

$mkdir /tmp/test-dir
$
This charge makes the index test-dir in the/tmp registry. The mkdir charge delivers no yield on the off chance that it effectively makes the asked for catalog.

On the off chance that you give more than one index on the summon line, mkdir makes each of the registries. For instance −

$mkdir docs pub
$
Makes the catalogs docs and bar under the present index.

Creating Parent Directories:

Once in a while when you need to make a registry, its guardian catalog or registries won't not exist. For this situation, mkdir issues a blunder message as takes after −

$mkdir /tmp/amrood/test
mkdir: Failed to make directory "/tmp/amrood/test"; 
No such file or directory
$
In such cases, you can determine the - p alternative to the mkdir order. It makes all the fundamental catalogs for you. For instance −

$mkdir -p /tmp/amrood/test
$
Above charge makes all the required guardian catalogs.

Removing Directories:
Registries can be erased utilizing the rmdir order as takes after −

$rmdir dirname
$

Note − To evacuate an index ensure it is vacant which implies there ought not be any document or sub-registry inside this catalog.

You can evacuate numerous indexes at once as takes after −

$rmdir dirname1 dirname2 dirname3
$
Above summon evacuates the indexes dirname1, dirname2, and dirname2 on the off chance that they are vacant. The rmdir summon creates no yield on the off chance that it is fruitful.

Changing Directories:

You can utilize the compact disc summon to accomplish more than change to a home registry: You can utilize it to change to any index by determining a legitimate total or relative way. The linguistic structure is as per the following −

$cd dirname
$
Here, dirname is the name of the index that you need to change to. For instance, the summon −

$cd /usr/local/bin
$
Changes to the index/usr/neighborhood/container. From this index you can compact disc to the catalog/usr/home/amrood utilizing the accompanying relative way −

$cd ../../home/amrood
$
Renaming Directories:

The mv (move) charge can likewise be utilized to rename a catalog. The language structure is as per the following −

$mv olddir newdir
$
You can rename a catalog mydir to yourdir as takes after −

$mv mydir yourdir
$
Flaxit offers a best online training for hadoop in usa, uk and globally with real time experts. For more information about hadoop visit@ hadoop online training