• Creating file and Directory

    Creating file and Directory:

    1. Creating file:

    The ‘cat’ command is used to create a file

    Syntax:

    # cat > filename

    example:

    # cat > abc.txt

    (Ctrl +D) is used to save the file.

    1. View the content of file

    Syntax:

    # cat filename

    Example:

    #cat abc.txt

    #cat –b abc.txt

    1. Creating Directory

    The ‘mkdir’ command is used to create directory

    Syntax:

    Mkdir [directory_name]

    Example:

    # mkdir rohan

    Option used:

    cd : To change directory

    cd .. : To come out from directory

    cd : to jump to root directory

    cd - : to jump to previous directory

    Deleting Files and directory:

    Syntax:

    For file:

    rm

    example:

    rm abc.txt

    for directory

    syntax:

    rmdir

    Note: Only empty directory will be deleted)

    If we want to delete the tree structure of directory then we need to use the following command

    Syntax:

    rm –rf

    where

    r = recursively

    f= force

    in order to remove non empty directory

    Syntax:

    rm –r

    example;

    rm –r rohan

    this will remove directory step by step ,first remove sub directory and then finally main directory.

    Another method of creating file :

    Touch : this command is used to create a blank file with size zero.

    # touch

    Example:

    #touch abc

0 comments:

Leave a Reply

.

FEEDS FROM THIS BLOG

FEEDJIT Live Traffic Feed

My Zimbio   Blog Directory - OnToplist.com   Red Hat Enterprice Linux RHCE RHCT RHCA RHCSS  Powered by  MyPagerank.Net  Academic blogs & blog posts   BlogRankers.com  TopOfBlogs  BuzzCritic     Academics  Blog Directory  Hihera.com  Technology Blogs - Blog Rankings   Visit blogadda.com to discover Indian blogs  Academics Blogs  Computers (Linux) - TOP.ORG    Rallyshare    Yahoo bot last visit powered by MyPagerank.Net     The Weblog Review  blogarama - the blog directory  SEO services    Academic blogs & blog posts