14. rmdir or rm –r - to remove the directory
mv – move or rename the directory or file
15. mv continues … ( if destination directory already exists
“ mv “ moves source directory to destination directory ).
16. cp - It copies directories and files from one location to
another location.
“ cp “command copies only files from one location to another
location. “ cp - r “ Can be used to copy directories.
17. “ cat “ command is used to create or read the contents
of the files.
To append some more content with the existing file “ >> “
can be used.
18. “ file “ is a command which tells you the property of file or
Directory.
19. “ more “ command displays the file contents page wise.
20. “ less “ command displays the file content like “ more “
command but, it has to be closed with “ q “.
21. “ touch “ is the command which creates zero length files or
it puts time stamp on the file or files which are already exist.
22. “ head “ command displays the file contents with “ – “option
23. “ tail “ command displays file contents like “ head “
with “ - , + “ option.
24. “ sort “ command displays file contents in ascending and
descending order.
25. “ wc - word count “ command displays words, lines, chars,
bytes, mem size and all.
26. “ which “ command shows the location of the commands,
which are set in environment variable “ PATH “
27. “ df – Disk free “ command shows the disk space level
29. “ tty “ the terminal command shows the pseudo terminals.
30. “ echo “ command show the given value or shows the value
of the environment varriables.
31. “ grep “ is the command which displays the line with the
matching pattern. It can be executed with more options.
Option Definition
-i Searches for both uppercase and lowercase characters
-l Lists the names of files with matching lines
-n Precedes each line with the relative line number in the file
-v Inverts the search to display lines that do not match the
pattern
-c Counts the lines that contain the pattern
-w Searches for the expression as a complete word, ignoring
those matches that are substrings of larger words.
32. The “ grep “ command supports several regular expression
Meta characters to further define a search pattern. This table
describes some of the regular expression meta characters.
Regular expression meta characters:
Metacharacter Purpose Example Result
^ Beginning of ’^pattern’ Matches all lines
line anchor beginning
with “pattern”
$ End of line ’pattern$’ Matches all lines
anchor ending
with “pattern”
33. Additional regular expression meta characters:
Metacharacter Purpose Example Result
Matches one ’p.....n’ Matches lines
.
character containing a
“p,” followed by
Five characters,
and followed
by an “n”
Matches the ’[a-z]*’ Matches
*
preceding Lowercase
item zero or Alphanumeric
more times characters or
nothing at all
34. “ grep “ continues …
Metacharacter Purpose Example Result
Matches one Matches lines
character in ’[Pp]attern’ Containing
[] “Pattern” or
the pattern
“pattern”
Matches one Matches lines that
character not do not contain “a”
[^] ’[^am]
in the pattern through “m” and
attern’ followed by“attern”
42. Egrep
The egrep command searches the contents of one or more files
for a pattern using extended regular expression metacharacters.
Extended regular expression metacharacters include the regular
expression metacharacters that the grep command uses, plus
some additional metacharacters.
43. Egrep
Metacharacter Purpose Sample Result
+ Matches one or ’[a-z]+ark’ Matches one or more
more of the lowercase letters
preceding followed by “ark” (for
characters example, “airpark,”
“bark,” “dark,”
“landmark,” “shark,”
“sparkle,” “trademark”)
? Matches zero ‘patte[r?]’ Matches lines
or one Containing the literal
character character or
metacharacter it
follows
x|y Matches either x or ’apple | orange’ Matches for either
y expression
80. Using VI Editor
Identifying the Fundamentals of vi Editor operation
• Introducing the vi editor modes of operation
• The command mode
• The edit mode
• The last line mode
• Switching between the command and edit modes
• Introducing the vi command
92. File Archives
tar
-c - to create tar archive
-v - to get verbose
-f - the out put device or directory
-t - table of contents
-x - extract from the tar archive
93. To create tar archive Example
To see the table of content
101. Solaris User Administration
Each user account consists of five main components:
• User name
• Password
• User’s home directory
• User’s login shell
• User initialization files
102. Managing User Accounts
Before you can add user accounts to the system, you must
determine the following information for each new user:
• Login name
• User identification (UID) number
• Group identification (GID) number
• Comment
• home directory
• Login shell
• Password aging
103. Storing User and Group Account information
The Solaris Operating Environment stores user account and group account
information in the following system files:
• /etc/passwd – Authorized system users have login account entries in the
/etc/passwd file.
• /etc/shadow – All passwords are encrypted and maintained in a separate
shadow file named
/etc/shadow.
• /etc/group – The /etc/group file defines the default system group accounts.
107. Command line User Account Administration
The following command-line tools add, modify, and delete
user accounts and group accounts on the local system:
• useradd – Adds a new user account
• usermod – Modifies a user’s account
• userdel – Deletes a user’s account
• groupadd – Adds (creates) a new group account
• groupmod – Modifies a group account
• groupdel – Deletes a group account