SANJAY GHODAWAT POLYTECHNIC PRACTICAL PLAN Name of Faculty: - Mr. PISE S.P. Course: - CSE Subject and Code: -LPR (17816) Course/Semester/Master: - CW-6-G EXPERIMENT NO. 01 Name of Experiment Implement following commands with their options: ps and kill. df and du mount and umount. (4 Hours) Prerequisite of experimentation. Basic knowledge about linux command. Equipment/ Instrumentation Linux Operating System. Procedure (Key Points) Open shell terminal Set ps command and get information of process. Set $ ps –ag command for real time process monitoring. Use kill command to kill process by ID $kill 1020 Use killall command to kill all processes. Kill with process name $killall processname Stop all process $kill 0 Df command is used to check disk available space. $df $df –h The du command shows the disk usage for a specific directory (by default, the current directory). $du –c $du –h Mount Command mount -t vfat /dev/sdb1 /media/disk Unmount Command $umount In between check Points during experimentation/ execution of practical. Check command result and notice that results. Safety Measures Do not kill system processes. Analysis of Results/ experimentation Note down all results after command execution. Assignments. Describe Linux file structure in details.
22
Embed
SANJAY GHODAWAT POLYTECHNIC - … $ ps –ag command for real time process monitoring. Use kill command to kill process by ID $kill 1020 Use killall command to kill all processes.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
SANJAY GHODAWAT POLYTECHNIC
PRACTICAL PLAN
Name of Faculty: - Mr. PISE S.P. Course: - CSE
Subject and Code: -LPR (17816) Course/Semester/Master: - CW-6-G
EXPERIMENT NO. 01
Name of Experiment Implement following commands with their options:
ps and kill. df and du mount and umount. (4 Hours)
Prerequisite of experimentation. Basic knowledge about linux command.
Equipment/ Instrumentation Linux Operating System.
Procedure (Key Points)
Open shell terminal
Set ps command and get information of process.
Set $ ps –ag command for real time process monitoring.
Use kill command to kill process by ID
$kill 1020
Use killall command to kill all processes.
Kill with process name
$killall processname
Stop all process
$kill 0
Df command is used to check disk available space.
$df
$df –h
The du command shows the disk usage for a specific
directory (by default, the current directory).
$du –c
$du –h
Mount Command
mount -t vfat /dev/sdb1 /media/disk
Unmount Command
$umount
In between check Points during
experimentation/ execution of
practical.
Check command result and notice that results.
Safety Measures Do not kill system processes.
Analysis of Results/
experimentation
Note down all results after command execution.
Assignments. Describe Linux file structure in details.
SANJAY GHODAWAT POLYTECHNIC
PRACTICAL PLAN
Name of Faculty: - Mr. PISE S.P. Course: - CSE
Subject and Code: -LPR (17816) Course/Semester/Master: - CW-6-G
EXPERIMENT NO. 02
Name of Experiment Implement grep and tar commands. (4 Hours)
Prerequisite of experimentation. Basic command knowledge.
Equipment/ Instrumentation OS - Linux operating system
Procedure (Key Points)
Open Linux shell
Before performing grep command need files for searching
data
Type in shell
Create sample files in linux in home directory
$cat file1
One two three four
$man grep
Check grep manual and performing operating
$grep two file
Use different attributes
Use tar command for archiving file
$man tar
$tar –cvf test.tar /test1/test2
In between check Points during
experimentation/ execution of
practical.
Use different parameters and attributes in grep and tar
command examples.
Safety Measures Do not practicing with system files.
Analysis of Results/
experimentation
Note down result of different attributes used in examples
Assignments. Explain grep and tar commands with 4 examples.
SANJAY GHODAWAT POLYTECHNIC
PRACTICAL PLAN
Name of Faculty: - Mr. PISE S.P. Course: - CSE
Subject and Code: -LPR (17816) Course/Semester/Master: - CW-6-G
EXPERIMENT NO. 03
Name of Experiment Implement setting of global and local environment variable,
shell environment variables. (4 Hours)
Prerequisite of experimentation. Basic command knowledge.
Equipment/ Instrumentation OS - Linux operating system
Procedure (Key Points)
Open Linux shell
$ echo $SHELL
would give you the name of the current shell you are using.
To see a list of the environment variables that are already set
on your machine, type the following-
$ env
Display current environment variables-
$set
Printing shell , environment variables
$printenv
$env VAR1="blahblah" command_to_run
command_options
Creating Environment variables
$test_var=testing
$echo test_var
$export test_var
$echo $test_var
e.g $export PATH=${PATH}:/home/cse/bin
Removing Environment Variables
$unset test_var
Seting PATH variable
$ PATH=$PATH:/home/rich/test
Setting Shell variables
$test_var='cse'
To define a temporary value to a shell variable use the
command: $set variable_name=value
In between check Points during
experimentation/ execution of
practical.
Use different parameters and attributes in shell commands
Safety Measures Do not practicing with system files.
Analysis of Results/
experimentation
Note down result of different attributes used in examples
Assignments.
SANJAY GHODAWAT POLYTECHNIC
PRACTICAL PLAN
Name of Faculty: - Mr. PISE S.P. Course: - CSE
Subject and Code: -LPR (17816) Course/Semester/Master: - CW-6-G
EXPERIMENT NO. 04
Name of Experiment Create users, groups .Set permissions and ownership.
View the /etc/passwd file and describe its syntax.
View the /etc/shadow file and describe its syntax.
View the /etc/group file and describe its syntax. (4 Hours)
Prerequisite of
experimentation.
Basic command knowledge.
Equipment/
Instrumentation
OS - Linux operating system
Procedure (Key Points)
Adding a new user
Open Linux shell
# /usr/sbin/useradd –D
You can test this by creating a new user account using the default
system parameters
# /usr/sbin/useradd test
Changing the default values is a snap:
# useradd -D -s /bin/tsch
Removing a user
# /usr/sbin/userdel -r test
Modifying a user
Usermod
passwd and chpasswd
# passwd test
The chpasswd command reads a list of login name and
password pairs (separated by a colon) from the standard input, and
automatically encrypts the password and sets it for the user
account.
chsh, chfn, and chage
# chfn test
# finger rich
# chfn test
# finger test
The /etc/group file
Creating new groups
# /usr/sbin/groupadd shared
# /usr/sbin/usermod -G shared test
Modifying groups
# /usr/sbin/groupmod -n sharing shared
Default file permissions
$ touch newfile
$ ls -al newfile
$ umask
Changing permissions
Format: chmod options mode file
SANJAY GHODAWAT POLYTECHNIC
PRACTICAL PLAN
Name of Faculty: - Mr. PISE S.P. Course: - CSE
Subject and Code: -LPR (17816) Course/Semester/Master: - CW-6-G
$ chmod 760 newfile
$ ls -l newfile
$ chmod o+r newfile
Changing ownership
The format of the chown command is:
chown options owner[.group] file
# chown dan newfile
# ls -l newfile
The /etc/passwd file
$man passwd
$ cat /etc/passwd
The /etc/shadow file
The /etc/shadow file contains one record for each user account on