You are on page 1of 78

User Commands

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 11
08/02/2010
About Copyright

This document has been authored by Atanu Mandal


(atanu@aclabs.net) and contains original material.
Some of the slides may contain material sourced from various
other sources under the fair use principle. Wherever possible,
the author has attributed these source(s). Any such credit
omission may please be excused as human error. The author
would be thankful if such omissions are brought to his notice
and he will correct them in later versions of this document.
Any one may reproduce completely or in part, any portion(s)
or all of this document for spreading knowledge. The only
requirement is that this page may not be removed or modified
in the reproduction and the author (Atanu Mandal) is given due
credit for his hard work.
Refer to the end of this document for more details.

01:03:16PM
01:03:16
01:03:16 PM
PM
info@ackabs.net +91.9911064207 11/04/2014
Module
Module -- 22
In this module...

We will cover the following topics


Logging in
Getting Help

Concepts

Navigation

User level commands

* Create/Modify/Delete
* File Contents Manipulation
* Printing
* Communication
* Tools & Utilities
* Maintenance

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 33
08/02/2010
Introduction

Basic Unix commands to get familiar with Unix in general and Solaris
in particular

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 44
08/02/2010
Logging In

First of all you should be logged on to the Operating System. Let's see how
to do this --

The system will generally present a login screen. The actual appearance will

vary from system to system but will contain the following two items -

Login

Password

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 55
08/02/2010
Getting Help/On-line manual

man
The operating system comes with an on-line reference manual. You can refer
to this manual using the "man" command.

Syntax: man <command_name>


Example:

man ls

would display the "ls" manual pages from the on-line reference manual.
This on-line manual is also called the "man pages".

This
This works
works perfectly
perfectly ifif you
you know
know the
the command.
command. But
But what
what ifif you
you do
do
NOT
NOT know
know the
the command???
command???

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 66
08/02/2010
Getting Help/On-line manual

apropos
You can use the "apropos" command to find other commands based on
keywords. For instance you want search for command(s) related to
networking then

apropos network

would display a list of all the commands/files which are related to the
keyword
"network".

Using apropos &


Using apropos man, think
& man, think about
about how
how can
can you
you explore
explore the
the
operating
operating system.
system.

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 77
08/02/2010
Getting Help/On-line manual

man -k keyword

Similar to apropos. In case you do not have apropos command in your


system then you can use the above command.

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 88
08/02/2010
Flags or Switches

Flags
The commands may accept various flags or switches. These flags change the

behavior of the command. Usually the flags are preceeded by a "-" character
(unlike the "/" character used in DOS commands).

Example:
ls -al the "-al" are the flags.

The flags can be given in any order and can be combined in groups,
example,
"ls -a -l" is same as "ls -al".

TIP
Most
Most of
of the
the commands
commands support
support aa "-h"
"-h" oror "-?"
"-?" flag.
flag. This
This flag
flag usually
usually
displays
displays aa brief
brief help
help text
text describing
describing the
the command.
command.
01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 99
08/02/2010
Piping - |

| Standard output of one command to the standard input of


another

ls | more

|
| P

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 10
10
08/02/2010
Redirection - >
Redirect Standard OUTPUT to file (overwrite mode)

ls > file

> F

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 11
11
08/02/2010
Redirection - >>

Redirect Standard OUTPUT to file (append mode)

ls >> file

>>
P

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 12
12
08/02/2010
Background & Foreground

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 13
13
08/02/2010
Navigation

Navigational commands deal with navigating and exploring the filesystem

/ (root)
(S) | (HP)(L)
|
+----+---+----+---+----+----+---+---+---+---+---+---+---+--+
| | | | | | | | | | | | | | |
| sbin | mnt | devices | proc | lib | | boot | |
bin etc dev usr tmp opt | var |
| | | |
| | stand home
default +-----+--+--+-----+
| | | |
| | | |
bin lib adm local

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 14
14
08/02/2010
Navigation

Absolute Path
The files and directories can be located anywhere in the filesystem. A user can
reach any given file by following or specifying a "path". Every item in the
filesystem has a unique path with reference to the "root". This unique path is
known as "absolute path".

The absolute path of any file is nothing but the path (starting for the root) which
a user would have to take to reach the given file. In computer terms, this is the
sequence of sub-directories which must be traversed (using the "cd" command)
for reaching a file.

/usr/bin/test.txt
^
|
The leading "/" indicates the main root of the filesystem.

Thus in the above example to reach "test.txt" we have to start from "/" then go to
"usr", followed by "bin".
01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 15
15
08/02/2010
Navigation

Relative Path

Absolute path is always set with reference to the root whereas the relative
pathis set with respect to the user's current location in the filesystem. The
current location can be found by using the "pwd" command.

Thus an absolute path will always start with a leading "/" while the relative path
will not.

A path can be thought of as the address of the item in the filesystem.

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 16
16
08/02/2010
Navigation

pwd -- present working directory


Displays present working directory i.e. the directory where
you are currently working or located.
Syntax: pwd

cd -- Change to a different directory


Syntax: cd [ directory ]
Note: If directory name is not specified then working directory is
changed to the user's home directory.

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 17
17
08/02/2010
Navigation

ls -- list
List the contents of directory
Syntax: ls [-options] [ directory | file... ]
Wildcards (*,?) are acceptable directory/file arguments.

What is a wildcard?
Wildcards are special characters which can expand or replace other
regular characters. Unix has two wildcards with respect to filenames; the
asterisk (*) and the question mark (?).

Asterisk (*) - if a filename name argument contains "*" then it will be


expanded to zero or any number of characters.

Question mark (?) - similarly a "?" will be expanded by one character.


Two "?"s by two characters, and so on...
01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 18
18
08/02/2010
Navigation

no. of links File/Dir/Device/Link name

owner name last modification


mode/permission bits Month,Day,Time
size

-rw------- 1 root root 751 Dec 15 1991 .profile


drwxr-xr-x 2 bin bin 2416 May 06 20:47 bin
-r-------- 1 bin bin 78725 Jan 23 1992 boot
drwxrwxrwt 3 sys sys 368 May 10 16:25 tmp
-r--r----- 1 bin mem 594631 May 06 19:21 unix
drwxrwxr-x 21 root auth 336 May 07 17:11 usr

others
- : regular file group
d : directory group name
c : char dev owner
b : block dev
l : link

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 19
19
08/02/2010
Navigation: dot file

no. of links File/Dir/Device/Link name

owner name last modification


mode/permission bits Month,Day,Time
size

-rw------- 1 root root 751 Dec 15 1991 .profile


drwxr-xr-x 2 bin bin 2416 May 06 20:47 bin
-r-------- 1 bin bin 78725 Jan 23 1992 boot
drwxrwxrwt 3 sys sys 368 May 10 16:25 tmp
-r--r----- 1 bin mem 594631 May 06 19:21 unix
drwxrwxr-x 21 root auth 336 May 07 17:11 usr

others
- : regular file group
d : directory group name
c : What
char
What devdoes
does the '' .'.' (dot)
owner
the (dot) in
in front
front of
of aa filename
filename mean?
mean?
b : block dev
l : link

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 20
20
08/02/2010
Navigation

clear -- Clear a terminal/monitor screen


Syntax: clear [term]
Note : Some systems might have a second command named
"cls"
(usually linked to "clear") performing the same function.
Example: clear <RET>

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 21
21
08/02/2010
Navigation
find -- Find files matching a given selection criteria
Syntax: find <start search directory> -name
<filename> -print -exec <command>
Example: Suppose we want to search for a file name "abc.txt" and we
would like "find" to start searching from the "/usr"
directory, then we will use "find" in the following manner -
find /usr -name "abc.txt" -print

You
Note
Notecan
You Text
can use
use wildcards
Text wildcards with
with the -name option
the -name option

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 22
22
08/02/2010
Navigation

grep -- Search files for a given pattern


We saw the method for searching files when we know the name but
suppose we want to search for file(s) containing a certain character string.
In this case we can use the "grep" command.
Syntax: grep <character string> <filename(s) to search>
Example: grep "abc" *.txt
this will search all the files ending in ".txt" and show the ones
which have "abc" string.

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 23
23
08/02/2010
A Titillating taste of Regular Expression

The grep search pattern can be expressed in Regular Expressions or RE or


regex to increase the power of grep and quite a few of other *nix
commands!!

grep 'bad*' *.txt


grep 'bad*boy' *.txt

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 24
24
08/02/2010
Navigation

head -- Display the starting few lines of the file (usually the first 10
lines by default).

Syntax: head [-n] <filename>


where "n" is the number of lines to display.

Example: head -15 abc.txt


will display the first 15 lines of the file "abc.txt"

tail -- Display the last portion of a file (usually the last 10 lines
by default).

Syntax: tail [-n] <filename>


where "n" is the number of lines to display from the end of
file.
01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 25
25
08/02/2010
Navigation

more -- View one screen full data at a time

Quite frequently you will find that more than one screen full of data being
flashed on your display and that too very fast. Some people might suggest scroll
lock and some might talk about CTRL-S & CTRL+Q sequence. These methods
are just sufficient if you have a pre-historic machine. A better way is to use the
"more" command.

Syntax: more <filename>


Use this form if you just want to read a file e.g. more abc.txt

<output program name> | more


Use this form if some command gives voluminuos output e.g.
ls -al | more

Note: Lot of newer operating systems have other commands which give you
similar functionality with additional features like SCO Unix has the "pg"
command and the tongue-in-cheek "less" command in Linux.
01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 26
26
08/02/2010
Navigation

which -- locate a command; display its pathname or alias

$ which ls
/bin/ls

whereis locate the binary, source, and manual page files for a command

$ whereis ls
ls: /bin/ls /usr/share/man/man1/ls.1.gz

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 27
27
08/02/2010
Create/Modify/Delete

In this section we will talk about commands which allow us to


create, modify and delete objects in the filesystem as well as the
contents of those objects

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 28
28
08/02/2010
Create/Modify/Delete

cp -- Copy files

Syntax: cp source_file dstination_file


cp source_file(s) destination_directory

Example: cp testfile /tmp/testfile2


cp * /tmp/testdir

mv -- Move or rename files and directories. This command can used


for renaming a file as well as moving a file from one location
(directory) to another.

Syntax: mv filename new_filename

Example: mv test1 test2


mv test1 /tmp/test1
01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 29
29
08/02/2010
Create/Modify/Delete

ln -- link files

Syntax: ln source_file destination_file


ln -s entry destination_directory
ln -s entry non-existent file

Example: ln testfile /tmp/testfile2

touch -- create new file/change file access and modification times

Example: touch testfile

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 30
30
08/02/2010
Create/Modify/Delete

mvdir -- Move or rename a directory (deprecated in most modern


systems)

Syntax: mvdir dirname new_dirname

Example: mvdir /tmp/dir1 /tmp/dir2

rm -- Remove or delete files or directories

Syntax: rm [-options] filename ...

Example: rm filename
rm -r dirname
recursively remove all files and sub-directories in the
directory "dirname" and then remove the directory itself.
rm -i *
display all the files in the current directory, ask
confirmation and then remove the confirmed files one-by-one.
01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 31
31
08/02/2010
Create/Modify/Delete

mkdir -- create new sub-directories


Syntax: mkdir [-p] dirname ...
Example: mkdir test <RET>
this will create a directory named "test" in the current directory.
mkdir -p /tmp/tmp2/tmp3/test <RET>
this will create the non-existant parent directories (tmp2 and
tmp3 before creating "test")

rmdir -- Remove directories


Syntax: rmdir [-options] dirname ...
Example: rmdir /tmp/test
the given directory "dirname" should be empty.
Note: This command is safer than the "rm -r" command for removing
directories.
01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 32
32
08/02/2010
Create/Modify/Delete

vi or vedit -- visual editor


This is a full screen editor available on all makes and versions of
unix and most of the unix-like operating systems.
Syntax: vi <filename>
vedit <filename>
The first form is meant for advanced users while the second is for
the beginner.
More details about "vi" will be the subject for a later session.

view -- Screen oriented text viewer. It is same as "vi" except that the
target file is opened in read-only mode.

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 33
33
08/02/2010
File Contents Manipulation

In this section we will talk about various tools available for


manipulating file contents

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 34
34
08/02/2010
File Contents Manipulation

cat -- Concatenates and displays files


Syntax: cat <filename> ...
Examples:
cat filename -- display a file's content
cat filename1 filename2 > filename3
The two files (filename1 and filename2 are joined and the
resultant file is named as filename3. Similarly more than two files can
also be joined together.

paste -- Merge lines of the given files horizontally or in parallel

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 35
35
08/02/2010
Create/Modify/Delete

od Octal Debugger view file contents in Octal/ASCII and other formats


Syntax: od [options] <filename>

od -a <filename>
od -c <filename>

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 36
36
08/02/2010
File Contents Manipulation

wc -- Counts lines, words and characters in a given file


Syntax: wc [-<options>] <filename>

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 37
37
08/02/2010
File Contents Manipulation
ADV

cmp -- Compare two files byte-by-byte. cmp will write no output if the
files are the same. Under default options, if they differ, it writes to standard
output the byte and line numbers at which the first difference occurred.
Bytes and lines are numbered beginning with 1.

Syntax: cmp <file1> <file2>

Show 1st difference position


cmp <file1> <file2>
Show 1st difference position, byte number & value
cmp -b <file1> <file2>
Show all differing bytes (number & value)
cmp -bl <file1> <file2>

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 38
38
08/02/2010
File Contents Manipulation

diff -- Compares two files line-by-line and output a list of changes


necessary to convert file1 into file2. No output will be produced if the files
are identical. Can also be used to compare two directories.
Syntax: diff <file1> <file2>

Compare two files:


diff <file1> <file2>

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 39
39
08/02/2010
File Contents Manipulation
ADV

Compare two files and view result side-by-side:


diff -y <file1> <file2>

Compare two directories:


diff -qr <dir1> <dir2>

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 40
40
08/02/2010
File Contents Manipulation

cut -- Cut out selected fields of each line of a file

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 41
41
08/02/2010
File Contents Manipulation
ADV

split -- Split a file into as many required pieces with each piece
containing n number of lines.

Syntax: split l linecount file

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 42
42
08/02/2010
File Contents Manipulation

sort -- Sorts and merges lines of all the named files together.
Syntax: sort file(s)...

uniq -- removes duplicate lines from a sorted file

Syntax: uniq file1

expand -- Convert tabs to spaces in given file(s)

Syntax: expand file(s)

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 43
43
08/02/2010
File Contents Manipulation

tr -- Translate, squeeze, and/or delete characters from standard input,


writing to standard output.

Syntax: tr [OPTION]... SET1 [SET2]

Example: cat <ifn> | tr [a-z] [A-Z] > <ofn>

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 44
44
08/02/2010
File Contents Manipulation

Translate each digit in file1 to a X (number sign), and write the result to
file2.
tr "0-9" "[X*]" <file1 >file2

Translate all lower case characters in file1 to upper case and write the result
to standard output.
tr "[:lower:]" "[:upper:]" <file1

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 45
45
08/02/2010
File Contents Manipulation
compress -- Compress data for storage using adaptive Lempel-Ziv
alogorithm.

compress file

uncompress -- Uncompresses files which have been compressed by


"compress"

uncompress file.Z

zcat -- Display contents of files compressed by "compress" command.

zcat file.Z

Original
Original file
file replaced
replaced by
by aa file
file with .Z extension
with .Z extension

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 46
46
08/02/2010
File Contents Manipulation
pack -- Compresses files using Huffman (minimum redundancy)
codes on a byte-by-byte basis.

pack file

unpack -- Unpack files packed by "pack"

unpack file.z

pcat -- Provides "cat" like functionality for packed files

pcat file.z

Original
Original file
file replaced
replaced by
by aa file
file with .z extension
with .z extension

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 47
47
08/02/2010
File Contents Manipulation

spell -- Checks spelling of the words in the given files against a


spelling list.

Syntax: spell [b]file...

-b : British Spelling

Example: spell <filename> # spell checks the file


filename

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 48
48
08/02/2010
File Contents Manipulation

aspell -- Interactively spell check.

Syntax: aspell [b]file...

-b : British Spelling

Example: aspell -c <filename> # spell checks the file filename

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 49
49
08/02/2010
File Contents Manipulation

file -- Determine file type

file file...

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 50
50
08/02/2010
Communication

In this section we will talk about commands used for Communication

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 51
51
08/02/2010
Communication

write -- Write messages to another user


mesg -- Allow/disallow messages sent to a terminal

wall write
wall write to
to all
all users
users SU
SU command
command

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 52
52
08/02/2010
Communication

mail -- Interactive message processing system

talk -- Chat/talk between two logged in users. It is a two-way,


screen-oriented communication program.

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 53
53
08/02/2010
Communication

ftp -- Upload/Download files

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 54
54
08/02/2010
Communication

sftp (L) secure file transfers

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 55
55
08/02/2010
Communication

telnet login to remote servers

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 56
56
08/02/2010
Communication

ssh secure login to remote servers

scp secure copy (remote file copy program)

How
How do
do you
you login
login to
to aa remote
remote Unix/Linux
Unix/Linux server
server securely?
securely?

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 57
57
08/02/2010
Tools & Utilities

In this section we will talk about various Tools & Utilities

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 58
58
08/02/2010
Tools & Utilities

cal -- Print/display a Gregorian calendar


The cal utility writes a Gregorian calendar to standard output. If the year
operand is specified, a calendar for that year is written. If no operands are
specified, a calendar for the current month is written.
Syntax: cal [[month] year ]
month to be displayed, represented as a decimal integer from 1
(January) to 12 (December). The default is the current month.
year for which the calendar is displayed, represented as a decimal
integer from 1 to 9999. The default is the current year.

calendar -- Reminder Service


The calendar utility consults the file calendar in the current directory and
writes lines that contain todays or tomorrows date anywhere in the line
to standard output. Most reasonable month-day dates such as Aug. 24,
august 24, 8/24, and so forth, are recognized, but not 24 August or 24/8.
On Fridays and weekends tomorrow extends through Monday.
01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 59
59
08/02/2010
Tools & Utilities

banner -- display text in large letters

logname -- display logged in user's login name

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 60
60
08/02/2010
Tools & Utilities

date Display/set the date and time


Displays the date and time to standard output or attempts to set
the system date and time. By default, the current date and time will be
written. Setting is allowed by superuser.

bc -- Calculator - preprocessor for "dc"

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 61
61
08/02/2010
Maintenance & Control

In this section we will talk about various commands which help in


Maintenance

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 62
62
08/02/2010
Maintenance & Control

tty -- Display user's terminal name

su -- Switch User

su

su -

su <username>

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 63
63
08/02/2010
Maintenance & Control

who -- List who is logged on the system


list the users name, terminal line, login time, elapsed time since activity
occurred on the line, and the process-ID of the command interpreter
(shell) for each current UNIX system user.
The general format for output is:
name [state] line time [idle] [pid] [comment] [exit]
where:
name users login name.
state capability of writing to the terminal.
line name of the line found in /dev.
time time since users login.
idle time elapsed since the users last activity.
pid users process id.
comment comment line in inittab(4).
exit exit status for dead processes. .

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 64
64
08/02/2010
Maintenance & Control

whoami -- displays the current effective user ID (EUID).

who am i -- displays the users real user ID (UID)

How
How will
will demonstrate
demonstrate the
the difference
difference between
between the
the above
above two
two
commands?
commands?
HINT:
HINT: Switch
Switch User
User
01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 65
65
08/02/2010
Maintenance & Control

w -- Displays a summary of the current activity on the system, including


what each user is doing.
Syntax: w [user]
Example: w
10:54am up 27 day(s), 57 mins, 1 user, load average: 0.28,
0.26, 0.22
User tty login@ idle JCPU PCPU what
ralph console 7:10am 1 10:05 4:31 w
The heading line: current time, system uptime, the number of
users logged in, the average number of jobs in the run queue
over the last 1, 5 and 15 minutes.
The fields displayed (per user): login name, the tty the user is on,
the time of day the user logged on (in hours:minutes), the
idle time the number of minutes since the user last typed anything (in
hours:minutes), the CPU time used by all processes and their
children on that terminal (in minutes:seconds), the CPU time
used by the currently active processes (in minutes:seconds),
the name and arguments of the current process.

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 66
66
08/02/2010
Maintenance & Control

chgrp -- Change group


chmod -- Change access permissions for files/directories
chown -- Change owner

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 67
67
08/02/2010
Maintenance & Control

passwd -- Change login password

How
How do
do you
you choose
choose aa good
good password?
password?

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 68
68
08/02/2010
Maintenance & Control

ifconfig Find the current IP address and other network


connection details.

route Find current default gateway

Cat /etc/resolv.conf Find current Nameservers

hostname Find current hostname

ping Check connectivity

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 69
69
08/02/2010
Maintenance & Control

ps -- Report process status

kill -- Kill or terminate a process

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 70
70
08/02/2010
Maintenance & Control

df -- Display file system disk usage

du -- Report estimated file/disk usage

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 71
71
08/02/2010
Maintenance & Control

uname -- Display system information

uname -a

id -- print real and effective user and group Ids

id <username>

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 72
72
08/02/2010
Maintenance & Control

tar -- Tape Archive. Actually the name of this command is a


misnomer in the sense that it can archive (i.e., store/restore) files
to/from a variety of media like floppy, magnetic tape and
cartridges, and even on the hard drive (as a standard file). You will
be using this command more frequently, for saving your files to
floppies and tapes, than any other command.
Syntax: tar [options] [file(s)]

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 73
73
08/02/2010
References

Unix/Linux Man Pages

01:03:16PM
01:03:16
01:03:16 PM
PM
info@ackabs.net +91.9911064207 11/04/2014
Module
Module -- 74
74
That's all, folks!!
...till we meet again...

01:03:16 PM
+91.9911064207 Unix
Unix -- User
User -- 75
75
08/02/2010
Acknowledgements

Unix/Linux Man Pages and their various authors


Wikipedia

01:03:16PM
01:03:16
01:03:16 PM
PM
info@ackabs.net +91.9911064207 11/04/2014
Module
Module -- 76
76
Copyright

This document has been authored by Atanu Mandal


(atanu@aclabs.net) and contains original material.
Some of the slides may contain material sourced from various
other sources under the fair use principle. Wherever possible,
the author has attributed these source(s). Any such credit
omission may please be excused as human error. The author
would be thankful if such omissions are brought to his notice
and he will correct them in later versions of this document.
Any one may reproduce completely or in part, any portion(s)
or all of this document for spreading knowledge. The only
requirement is that this page may not be removed or modified
in the reproduction and the author (Atanu Mandal) is given due
credit for his hard work.

01:03:16PM
01:03:16
01:03:16 PM
PM
info@ackabs.net +91.9911064207 11/04/2014
Module
Module -- 77
77
Versions

No record of prior versions


13/01/1997
13/09/1999
08/02/2008
06/04/2014
25/Apr/2014
02.May/2015
17-Jan-2017

01:03:16PM
01:03:16
01:03:16 PM
PM
info@ackabs.net +91.9911064207 11/04/2014
Module
Module -- 78
78