basic commands 1 by thanigai

6

Click here to load reader

Upload: kanchilug

Post on 19-May-2015

494 views

Category:

Education


0 download

DESCRIPTION

Presented By Mr.Thanigairaj

TRANSCRIPT

Page 1: Basic Commands  1 By Thanigai

                        

                          BASIC COMMANDS IN LINUX

                            Session – I

                            Kanchi Linux User Group

                            Presented By 

                                                 ­ Mr.Thanigai

Page 2: Basic Commands  1 By Thanigai

Whoami :arul@arul­desktop:~$ whoamiarul

This command helps to identify login user name

su :arul@arul­desktop:~$ su ­Password: root@arul­desktop:~# 

This command helps to  Switch User from any user to Root user

Root user means (#) symbol will display at the end of terminal default line.

Normal user ($) symbol will display . . .

logout :root@arul­desktop:~# logout

r

arul@arul­desktop:~$ 

logout helps to logout from last login user

root@arul­desktop:~# su ­ arularul@arul­desktop:~$ 

su ­ ' user name ' will also helps to change the user 

clear :arul@arul­desktop:~$ clear

It helps to clear the terminal page (ctl + l )

Page 3: Basic Commands  1 By Thanigai

ls :arul@arul­desktop:~$ ls

Arulalan.jpgarul_gsoc_2009arul.pdfDesktopDocumentsExamples

It helps to list out all files and directories 

ls ­l :arul@arul­desktop:~$ ls ­ltotal 2068980

­rw­r­­r­­  1 arul arul       29055 2009­05­23 23:38 Arulalan.jpgdrwxrwxrwx  3 amma shrini      4096 2009­04­05 14:53 arul_gsoc_2009­rw­r­­r­­  1 arul arul       34217 2009­05­29 19:16 arul.pdf

drwxrwxrwx 12 root root        4096 2009­05­31 14:46 Desktopdrwxrwxrwx  3 root root        4096 2009­05­17 15:39 Documents

It will display list of files with User , Group, Others Permissions  and their size in bytes.

ls ­lh :

arul@arul­desktop:~$ ls ­lhtotal 2.0G

­rw­r­­r­­  1 arul arul    29K 2009­05­23 23:38 Arulalan.jpgdrwxrwxrwx  3 amma shrini 4.0K 2009­04­05 14:53 arul_gsoc_2009­rw­r­­r­­  1 arul arul    34K 2009­05­29 19:16 arul.pdf

drwxrwxrwx 12 root root   4.0K 2009­05­31 14:46 Desktopdrwxrwxrwx  3 root root   4.0K 2009­05­17 15:39 Documents

It will display file size with human readable form .

Page 4: Basic Commands  1 By Thanigai

pwd :arul@arul­desktop:~$ pwd/home/arul

It is precent working directory

cd    cd ..    cd ~  arul@arul­desktop:~$ cd Desktop/arul@arul­desktop:~/Desktop$ cd ..arul@arul­desktop:~$ 

a

cd : change directory

arul@arul­desktop:~/Desktop/Himalayas/linux $ cd ~arul@arul­desktop:~$ 

cd ~ : ~ symbol helps to change directory from any where to home directory.

arul@arul­desktop:~$ cd /homearul@arul­desktop:/home$ lsamma  arul  ftp   lost+found  shrini

sudo :

“ sudo “ helps to give root authendication permission for upcomming commands followed by sudo, with current user's password.

 adduser :arul@arul­desktop:~$ sudo adduser[sudo] password for arul: 

Page 5: Basic Commands  1 By Thanigai

adduser: Only one or two names allowed.arul@arul­desktop:~$ sudo adduser godAdding user `god' ...Adding new group `god' (1004) ...Adding new user `god' (1003) with group `god' ...Creating home directory `/home/god' ...Copying files from `/etc/skel' ...Enter new UNIX password: Retype new UNIX password: passwd: password updated successfullyChanging the user information for godEnter the new value, or press ENTER for the default

Full Name []: GODRoom Number []: 0Work Phone []: Home Phone []: Other []: 

Is the information correct? [Y/n] yarul@arul­desktop:~$ cd /homearul@arul­desktop:/home$ lsamma  arul  ftp  god  lost+found  shrini

adduser helps to add user

chmod :arul@arul­desktop:~/klug$ ls ­ltotal 564drwx­­­­­­ 2 arul arul   4096 2009­05­26 23:50 bajji­rwx­­­­­­ 1 arul arul    616 2009­05­18 11:08 kanchilug emails & b' days­rw­r­­r­­ 1 arul arul    338 2009­05­22 19:43 kanchilug freelist . . .

arul@arul­desktop:~/klug$ chmod o+rwx kanchilug emails & b' days arul@arul­desktop:~/klug$ ls ­ltotal 564drwx­­­­­­ 2 arul arul   4096 2009­05­26 23:50 bajji­rwx­­­rwx 1 arul arul    616 2009­05­18 11:08 kanchilug emails & b' days­rw­r­­r­­ 1 arul arul    338 2009­05­22 19:43 kanchilug freelist 

Page 6: Basic Commands  1 By Thanigai

arul@arul­desktop:~/klug$ chmod 777 kanchilug freelist   arul@arul­desktop:~/klug$ ls ­ltotal 564drwx­­­­­­ 2 arul arul   4096 2009­05­26 23:50 bajji­rwx­­­rwx 1 arul arul    616 2009­05­18 11:08 kanchilug emails & b' days­rwxrwxrwx 1 arul arul    338 2009­05­22 19:43 kanchilug freelist 

chmod : change mode : changing file(s) permissions ( read, write, excute ) to users , groups , Others .

History :arul@arul­desktop:~/klug$ history    1  <?xml version="1.0"?>    2  <stickynotes version="2.26.1"/>

    .    .    .

  173  chmod o+rwx kanchilug emails & b' days   174  ls ­l  175  chmod 777 kanchilug freelist   176  ls ­l  177  history

history helps to retrive past 500 commands excuted in terminal eventhough after shutdown many times. ( By default 500).

we can change change the no of commands which will be store in history file . 

arul@arul­desktop:~/klug$ history > klug_history

we can store all those commands history into a text file .