Introduction to Solaris

Topics: File system, Core dump, Backup Pages: 89 (17034 words) Published: June 24, 2013



# uname –a  Gives all details about the system
# uname –m  Displays H/W platform (sun4u)
# uname –p  Machine processor architecture (sparc or i386) # uname –i  Machine model architecture (SUNW, Ultra 5_10) # uname –X  Detailed description
# mkdir –p /data/dir  Creates directory and sub directory in one shot # rmdir –r /data  Deletes the directory and all its subdirectory and files # cp –r /data /data1  It copies the directory

# echo $MANPATH
: /usr/local/samba/man:
# echo $PATH  Shows environmental path

Grep Command Options

-i  Searches for both upper & lower case characters
-l  Lists the names of files with matching lines
-n  Proceeds each line with the relative line number in the file -v  Inverts the search to display lines that do not match the pattern -w  Searches for the expression as a complete word.

# find /kris –name file1  Searches for file file1 in /kris directory # find /ris –name file1 –exec ls –l {} \;  Search and display # find /kris –type f –size 0 –exec ls –l {} \;  Search for the file with size 0 # find /kris –user user1  Shows file used by user ‘user1’

$ PATH=$PATH:/usr/ccs/bin:/usr/ucb:  It will get appended to the existing path

# ln –s  Creating symbolic link
# ln  Creating hard link

Unix File Permission

r – 4, w – 2, x – 1
_rw_ r_ _ r_ _ (644)  Default file permission
drwx r_x r_x (755)  Default directory permission

O G O  Permission categories

# ls –n /var/adm
drwxrwxr_x 5 4 4 512 nov 15 14:55 file1

5 - No of hard link to the file or directory
4 – The UID of the owner
4 – The GID of the group
512 – Size
# chmod –R 755  For inherit permission

VI Editor

Inserting and Appending Text

a-Append text after the cursor
A-Appends text at the end of the line
i-Inserts text before the cursor
I-Inserts text at the beginning of the line
o-Opens a new line below the cursor
O-Opens a new line above the cursor
:r Inserts text from another file into the current file

Key Sequence for the VI Editor

n, left arrow or backspaceLeft one characters
j or down arrowDown one line
k or up arrowUp one line
l, right arrow or spacebarRight one character
wForward one word
bBack one word
eTo the end of the current word
$To the end of the line
0 (zero)To the beginning of the line
^To the first non whitespace character on the line
ReturnDown to the beginning of the next line
GGoes to the last line of the file
1GGoes to the first line of the file
:nGoes to the line n
nGGoes to the line n
Ctrl FPages forward one screen
Ctrl DScroll down one half screen
Ctrl BPages back one screen
Ctrl UScrolls up one half screen
Ctrl LRefreshes the screen

Editing files using the VI editing commands

ROverwrites or replace characters to the right of the cursor CChanges or overwrites characters to the end of the line
sSubstitute a string for a character at the cursor
xDeletes a character at the cursor
dwDeletes a word or part of the word to the right of the cursor ddDletes the line containing the cursor
DDeletes the line from the cursor to the right end of the line :n,ndDeletes the line n through n

Using the Text Changing Commands

uUndoes the previous command
UUndoes all changes to the current line
.Repeats the previous command

Search and Replace Command

/stringSearches forward for the string
?stringSearches backward for the string
nSearches the next occurrence of the string
NSearches for the previous occurrence of the string
:%s/old/new/gSearches for the old string and replace it with the new string globally

Using the text copying and Text Pasting Commands

yyYanks a copy of a line
pPuts yanked or deleted text under the line containing the cursor PPuts yanked or deleted text...
Continue Reading

Please join StudyMode to read the full document

You May Also Find These Documents Helpful

  • introduction Essay
  • Introduction Essay
  • introduction Essay
  • introduction Essay
  • Introduction Essay
  • Introduction Essay
  • Essay on Introduction

Become a StudyMode Member

Sign Up - It's Free