1.1-Introduction to Linux Commands

download 1.1-Introduction to Linux Commands

of 13

Transcript of 1.1-Introduction to Linux Commands

  • 7/28/2019 1.1-Introduction to Linux Commands

    1/13

    Introduction to Linuxcommands

  • 7/28/2019 1.1-Introduction to Linux Commands

    2/13

    Linux commands

    man -- displays manual pages.If you do not know about a command xx

    then type $man xx at the command

    prompt $. ls -- List the files and directories in the

    current directory.

    man ls -- show the manual pages about ls cat first.c -- displays contents of the file

    first.c

  • 7/28/2019 1.1-Introduction to Linux Commands

    3/13

    Linux commands

    What does $man man do ?

  • 7/28/2019 1.1-Introduction to Linux Commands

    4/13

    Commands

    Many commands take one or more

    arguments.

    $cc first.c -- here cc is the command

    first.c is the argument.

    Arguments gives the necessary data source

    or destination.

    $cp a.out first -- copies the file a.out into afile with name first

  • 7/28/2019 1.1-Introduction to Linux Commands

    5/13

    Commands

    A command can be tailored by giving someoptions.

    $ls -l -l is the option, asking for long

    display of the file information. It displaysalong with files, the time of their creations,owner, permissions, etc.

    $rm temp.c removes the file temp.c This is dangerous. $rm -i temp.c removes, but before doing this

    it asks you to confirm.

  • 7/28/2019 1.1-Introduction to Linux Commands

    6/13

    Commands

    Manual pages gives you all information about

    options, arguments.

  • 7/28/2019 1.1-Introduction to Linux Commands

    7/13

    File system

    The operating system supports a system

    called file system whose objectives are to

    create, maintain and delete the user/system

    information in the form of files. Files can be bundled in the form

    directories/folders.

    In Linux there is only one file system whichmaintains the files of all users.

  • 7/28/2019 1.1-Introduction to Linux Commands

    8/13

    File system

    etc

    bin

    usr

    usr1 usr2

    Root directory

  • 7/28/2019 1.1-Introduction to Linux Commands

    9/13

    File system

    Every user will have a home directory.

    When the user logs into the system, he/she is

    placed at his/her home directory.

    Present working directory is the directory

    where you are working at present.

    $pwd -- displays the present working

    directory.

  • 7/28/2019 1.1-Introduction to Linux Commands

    10/13

    File system

    Navigating the file system.

    $cd dir1 -- moves the present working directory to

    the directory dir1 (if at all dir1 is present in the pwd,

    otherwise it gives an error message) $cd .. -- moves to the parent directory (i.e.,

    moves backwards)

    $mkdir dir1 -- creates a directory with name dir1

    in the pwd. $rmdir dir1 -- removes an empty directory dir1.

  • 7/28/2019 1.1-Introduction to Linux Commands

    11/13

    File permissions

    You cannot read many other files which are

    existing on the system.

    The files are protected against misuse.

    Every file has 3 category of users User (that is you who created the file)

    Group (your group, this group is decided by the

    administator) Others (all others)

  • 7/28/2019 1.1-Introduction to Linux Commands

    12/13

    File permissions

    For every category of users there are 3

    possible actions with a file Read (r)

    Write (w) (with this you can delete the file also !) Execute (x)

    You can modify the file permissions by using

    a command chmod Read about this in the manual pages/other

    books.

  • 7/28/2019 1.1-Introduction to Linux Commands

    13/13

    This lecture gave you a tip of an iceberg.

    Read/explore to know more about your

    system !