basic commands 1 by thanigai
DESCRIPTION
Presented By Mr.ThanigairajTRANSCRIPT
BASIC COMMANDS IN LINUX
Session – I
Kanchi Linux User Group
Presented By
Mr.Thanigai
Whoami :arul@aruldesktop:~$ whoamiarul
This command helps to identify login user name
su :arul@aruldesktop:~$ su Password: root@aruldesktop:~#
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@aruldesktop:~# logout
r
arul@aruldesktop:~$
logout helps to logout from last login user
root@aruldesktop:~# su arularul@aruldesktop:~$
su ' user name ' will also helps to change the user
clear :arul@aruldesktop:~$ clear
It helps to clear the terminal page (ctl + l )
ls :arul@aruldesktop:~$ ls
Arulalan.jpgarul_gsoc_2009arul.pdfDesktopDocumentsExamples
It helps to list out all files and directories
ls l :arul@aruldesktop:~$ ls ltotal 2068980
rwrr 1 arul arul 29055 20090523 23:38 Arulalan.jpgdrwxrwxrwx 3 amma shrini 4096 20090405 14:53 arul_gsoc_2009rwrr 1 arul arul 34217 20090529 19:16 arul.pdf
drwxrwxrwx 12 root root 4096 20090531 14:46 Desktopdrwxrwxrwx 3 root root 4096 20090517 15:39 Documents
It will display list of files with User , Group, Others Permissions and their size in bytes.
ls lh :
arul@aruldesktop:~$ ls lhtotal 2.0G
rwrr 1 arul arul 29K 20090523 23:38 Arulalan.jpgdrwxrwxrwx 3 amma shrini 4.0K 20090405 14:53 arul_gsoc_2009rwrr 1 arul arul 34K 20090529 19:16 arul.pdf
drwxrwxrwx 12 root root 4.0K 20090531 14:46 Desktopdrwxrwxrwx 3 root root 4.0K 20090517 15:39 Documents
It will display file size with human readable form .
pwd :arul@aruldesktop:~$ pwd/home/arul
It is precent working directory
cd cd .. cd ~ arul@aruldesktop:~$ cd Desktop/arul@aruldesktop:~/Desktop$ cd ..arul@aruldesktop:~$
a
cd : change directory
arul@aruldesktop:~/Desktop/Himalayas/linux $ cd ~arul@aruldesktop:~$
cd ~ : ~ symbol helps to change directory from any where to home directory.
arul@aruldesktop:~$ cd /homearul@aruldesktop:/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@aruldesktop:~$ sudo adduser[sudo] password for arul:
adduser: Only one or two names allowed.arul@aruldesktop:~$ 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@aruldesktop:~$ cd /homearul@aruldesktop:/home$ lsamma arul ftp god lost+found shrini
adduser helps to add user
chmod :arul@aruldesktop:~/klug$ ls ltotal 564drwx 2 arul arul 4096 20090526 23:50 bajjirwx 1 arul arul 616 20090518 11:08 kanchilug emails & b' daysrwrr 1 arul arul 338 20090522 19:43 kanchilug freelist . . .
arul@aruldesktop:~/klug$ chmod o+rwx kanchilug emails & b' days arul@aruldesktop:~/klug$ ls ltotal 564drwx 2 arul arul 4096 20090526 23:50 bajjirwxrwx 1 arul arul 616 20090518 11:08 kanchilug emails & b' daysrwrr 1 arul arul 338 20090522 19:43 kanchilug freelist
arul@aruldesktop:~/klug$ chmod 777 kanchilug freelist arul@aruldesktop:~/klug$ ls ltotal 564drwx 2 arul arul 4096 20090526 23:50 bajjirwxrwx 1 arul arul 616 20090518 11:08 kanchilug emails & b' daysrwxrwxrwx 1 arul arul 338 20090522 19:43 kanchilug freelist
chmod : change mode : changing file(s) permissions ( read, write, excute ) to users , groups , Others .
History :arul@aruldesktop:~/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@aruldesktop:~/klug$ history > klug_history
we can store all those commands history into a text file .