Lab 2 - Unix Command
Lab 2 - Unix Command
LAB REPORT
DAT10303 : BASIC OPERATING SYSTEM
LAB
LAB TITLE
LAB DATE
26 SEPTEMBER 2016
COURSE
1 DAT
SECTION
STUDENT
LECTURER
DATE OF
3 OCTOBER 2016
SUBMISSION
ASSESSEMENT
MARK
LECTURERS
COMMENTS
UNIX COMMAND
1. Files related commands
(a)
ls
(b)
mv [filename1] [filename2]
(c)
cp [filename1] [filename2]
(d)
rm filename
(e)
chmod
2. Directories
(a)
mkdir dirname
(b)
cd dirname
- The cd command, which stands for "change directory",
changes the shell's current working directory. The cd
command is one of the commands you will use the most
at the command line in linux. It allows you to change your
working directory. You use it to move around within the
hierarchy of your file system.
- Example:
(c)
pwd
- Print the name of the working directory. pwd prints the full
pathname of the current working directory.
Example:
3.Finding Things
(a) grep string filename(s)
- grep, which stands for "global regular expression print,"
processes text line by line and prints any lines which match a
specified pattern.
Example:
4.Other Commands
(a) whoami
- whoami prints the effective user ID. This command prints
the username associated with the current effective user ID.
Running whoami is the same as running the id command
with the options -un.
Example:
(b) passwd
- The passwd command is used to change the password of a
user account. A normal user can run passwd to change their
own password, and a system administrator (the superuser)
can use passwd to change another user's password, or
define how that account's password can be used or changed.
Example:
(d)
kill PID
- The kill command sends the specified signal such as kill
process to the specified process or process groups. If no
signal is specified, the TERM signal is sent. Please note
that kill command can be internal as part of modern shells
built-in function or external located at /bin/kill. Usage and
syntax remain similar regardless internal or external kill
command. Each time you start, the system is
automatically assigned a unique process identification
number (PID). A PID is automatically assigned to each
process when it is created on the system.
(e)
quota v
- report and optionally fix quota usage. quota generates a
report listing quota roots, giving their limits and usage.
Example:
(g)
cal
- Display a conveniently-formatted calendar from the
command line. In general, if no options are given, cal
displays the current month at the command line. It's a
quick and convenient way to glance at the dates of the
month, and can be useful as part of a login script.
Example:
(h)
man commandname
- On Linux and other Unix-like operating systems, man is
the interface used to view the system's reference
manuals. man is the system's manual viewer; it can be
used to display manual pages, scroll up and down, search
for occurrences of specific text, and other useful functions.
Example: