Vous êtes sur la page 1sur 10

DEPARTMENT OF INFORMATION TECHNOLOGY

CENTRE FOR DIPLOMA STUDIES

LAB REPORT
DAT10303 : BASIC OPERATING SYSTEM

LAB

LAB TITLE

UNIX SYSTEM ARCHITECTURE AND


COMMAND

LAB DATE

26 SEPTEMBER 2016

COURSE

1 DAT

SECTION

STUDENT

1. MUHAMMAD SOLIHIN BIN MOHD


SAAD (AA160838)
2. MUHAMMAD NABIL BIN FAHRUDDIN
(AA160623)

LECTURER

TN HJ. HANNES BIN MASANDIG

DATE OF

3 OCTOBER 2016

SUBMISSION
ASSESSEMENT

MARK
LECTURERS
COMMENTS

UNIX COMMAND
1. Files related commands
(a)

ls

- The ls command lists all files in the directory that match


the name. If name is left blank, it will list all of the files in the
directory.
Example:

(b)

mv [filename1] [filename2]

- The mv command allows you to move and rename files. mv


renames file source to dest, or moves the source file (or files)
to directory.
Example:

(c)

cp [filename1] [filename2]

- The cp command is used to make copies of files and


directories.
Example:

(d)

rm filename

- rm removes each specified file. By default, it does not


remove directories. The removal process unlinks a filename
in a filesystem from data on the storage device, and marks
that space as usable by future writes. In other words,
removing files increases the amount of available space on
your disk.
Example:

(e)

chmod

- chmod is used to change the permissions of files or


directories. there is a set of rules for each file which defines
who can access that file, and how they can access it. These
rules are called file permissions or file modes. The command
name chmod stands for "change mode", and it is used to
define the way a file can be accessed.
(f) File Compression
-It is useful to store a group of files in one file for easy
backup, for transfer to another directory, or for transfer to
another computer. It is also useful to compress large files;
compressed files take up less disk space and download faster
via the Internet.

(g) gzip filename


- Gzip reduces the size of the named files using Lempel-Ziv
coding (LZ77). Whenever possible, each file is replaced by
one with the extension .gz, while keeping the same
ownership modes, access and modification times. (The
default extension is -gz for VMS, z for MSDOS, OS/2 FAT,
Windows NT FAT and Atari.) If no files are specified, or if a file
name is "-", the standard input is compressed to the
standard output. Gzip will only attempt to compress regular
files. In particular, it will ignore symbolic links.
Example:

(h) gunzip filename


- gunzip can currently decompress files created by gzip, zip,
compress, compress -H or (Apack. The detection of the input
format is automatic. When using the first two formats, gunzip
checks a 32 bit CRC. For pack, gunzip checks the
uncompressed length. The standard compress format was
not designed to allow consistency checks.
Example:

2. Directories
(a)

mkdir dirname

- Short for "make directory", mkdir is used to create


directories on a file system. If the specified directory does
not already exist, mkdir creates it. More than one directory
may be specified when calling mkdir.
Example:

(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:

(c) ps-u yourusername


- Select by effective user ID (EUID) or name. This selects the
processes whose effective user name or ID is in userlist.
The effective user ID describes the user whose file access
permissions are used by the process. Identical to U and
--user.
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:

(f) du filename date


- du estimates and displays the disk space used by files.
The du (i.e., disk usage) command reports the sizes of
directory trees inclusive of all of their contents and the
sizes of individual files. This makes it useful for tracking
down space hogs, i.e., directories and files that consume
large or excessive amounts of space on a hard disk drive
(HDD) or other storage media.
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:

Vous aimerez peut-être aussi