Tuesday 6 January 2015

BASIC UNIX COMMANDS

UNIX COMMANDS
Sno
Command
Description
1
date
Displays the Date
2
cal
Displays the calendar
3
pwd
Print name of current/ working directory
4
cat
For creating and displaying files
5
ls
Displays list of files
6
chmod
Change permissions
7
mkdir
To create a directory
8
cd
To change a directory
9
cd  ..
To jump back one level in directory
10
rm
Remove a file
11
rmdir
Remove a directory
12
cp
For Copying files
13
mv
For moving and renaming files
14
wc
Count characters, words and lines
15
head
Displays first part of file
16
tail
Displays last part of file
17
grep
Searching for a pattern in file
18
man
manual
19
telnet
Log into another machine

1)  date: (Displays the date)
Description: Use this command to check the date and time
Syntax: $date
Example: $date
Mon  Jan 6 04:40:00 EDT 2015

2)  cal: Description: This command is used to see the calendar of any specific month or complete year.
Syntax: $ cal
Example: $ cal displays the current calendar.

3)  pwd: Description: print name of current working directory.
Syntax: $pwd
Example: $pwd    
              /home /rit

4)  Cat: Description: this command is used to create, view and concatenate files.
Syntax: 1. $cat > file name   - for creating the file
2. $cat  <file name>  – for viewing the file content
3. $cat <file1><file2> - for concatenating the contents of file1 to file2.
4.$cat >> <file name  -for appending content of the file
Example: $cat> ram
Ram
Is
A
Good
Boy
(at the end of file press ctrl+D to save the file)

5)  ls: Description: to list out all the files & directories available in  our directory.
Syntax : ls
Ex: ls
      ram     rit    sita
      ls r*
      ram     rit

6)  chmod: description: this command is used to change the permission of a file or directory.
Syntax: chmod  o/v/g   +/-   r/w/x   <file name>
Example:
-rw-r- -r—
$chmod 0+wx ram
$chmod 0-x ram
-rw-r- -rw-

7)  mkdir: description: use this command to create a directory.
$mkdir<directory name>
Ex: mkdir abc

8)  cd: (change director)
Description: use cd to change directory. Use pwd to see in what directory you are.
Ex: $cd abc
      $pwd
/home/rit/abc.

9)  cd ..
Description: to jump back one level in directories.
Syntax: $cd ..
/home/rit/abc
cd ..
/home/rit

10)              rm (removes a file)
Description: use rm to remove a file from your directory.
Syntax: $rm <file name>
$rm sita

11)              rmdir (remove a directory)
Description: use this command to remove a directory but the directory should be empty (no files).
Syntax: $rmdir <directory name>
Ex: $rmdir abc.

12)              cp (for copying files)
Description: use cp copy files to another file or directory.
Syntax: $cp <source>  <destination>
Ex: $cp ram xy

13)              mv: (for moving and renaming)
Description : use mv for changing the name of the file.
Syntax: $mv <old file name> <new file name> for renaming
$Mv <file name > <directory name> for moving to directory

14)              wc : (word count)
Description: use this command to count the number of characters, words and lines in a file.
Syntax: $wc <file name>
Ex :$wc zzz
4     9     41   zzz

15)              head: (display the first part of a file)
Description: use this command to see the head of the file.
Syntax: $head <file name> displays the first 10 lines of a file
Ex: $head -2 zzz

16)              tail: (displays the last part of a file)
Description: use this command to see the last part of a file.
Syntax: tail<file name> for the last 10 lines of file
Ex: $tail -2  zzz
Nice
Behavior

17)              grep: (searching for a pattern in a file)
Description: the grep program searches a file/ files for lines that have a certain pattern.
Syntax: $grep pattern files
Example: $grep is zzz xy

18)              man (manual)
Description: this command acts as a manual
Syntax: $man <command name>
Ex: $man cat

19)              telnet:
description: telnet is used to log in another machine
syntax: $telnet ip address
ex: $telnet 10.10.13.32


Oracle Reserved Words

Oracle  Reserved Words The following words are reserved by Oracle. That is, they have a special meaning to Oracle and so cannot be redefi...