0% found this document useful (0 votes)
3K views

Operating System Commands

This document discusses various system calls and UNIX commands. It provides descriptions of 15 common system calls including kill(), fork(), creat(), open(), close(), and exec(). It also lists and describes 18 common UNIX commands for file management, user information, searching files, and more. These include commands like ls, pwd, cd, mkdir, rmdir, cp, and man. The document was written by Khaled Dahrouj for a homework assignment on system calls and UNIX commands.

Uploaded by

Khaled Iyad Dah
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3K views

Operating System Commands

This document discusses various system calls and UNIX commands. It provides descriptions of 15 common system calls including kill(), fork(), creat(), open(), close(), and exec(). It also lists and describes 18 common UNIX commands for file management, user information, searching files, and more. These include commands like ls, pwd, cd, mkdir, rmdir, cp, and man. The document was written by Khaled Dahrouj for a homework assignment on system calls and UNIX commands.

Uploaded by

Khaled Iyad Dah
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Operating System

 Instructor: Dr. Mohamad Al-Ladan

 Title: Unix and System calls

 By: Khaled Dahrouj


HomeWork 1
System Calls:
1) Kill(): Can send a signal to the process that sends a signal to another
process, which terminates the first_one command. The UNIX system
sends a signal to a process when something happens, such as typing
the when something happens, such as typing the interrupt key on a
terminal, or attempting to execute an illegal instruction Signals are
execute an illegal instruction. Signals are also sent to a process with
the kill() system call Its prototype is:
int kill (process_id, signal_name )
int process it, signal name; int process _it, signal _name;

2) Fork():A new process that creates a new process.


3) Creat(): create a new file or rewrite an existing one.
4) Open(): Creates a new open file description.
5) close(): closes a file descriptor, so that it no longer refers to any file
and may be reused.
6) dup(): The dup() system call duplicates an open file descriptor and
returns the new file descriptor.
7) link(): The UNIX system file structure allows more than one named
reference to a given file, a feature called "aliasing" (Aliase: allows you
to have icons for the same file in different folders).
8) unlink(): The opposite of the link() system call is the unlink() system
call. unlink() system call.
9) Wait():Waut until one of the children processes die and return its pid
and termination status.
10) Waitpid():Waits for the process whose pid is given.
11) Getpid(): Return the pid of the process.
12) Getppid(): Return the pid of the parent process.
13) Exit(): The exit() system call ends a process and returns a value to it
parent.
14) Exec(): The UNIX system calls that transform a executable binary
file into a process are the "exec" family of system calls.
15) Pipe(): Pipes are useful for communication between related
processes(inter-process communication).
UNIX Commands:
Chmod(): Is used to change the permissions of files or directories. Chmod
has the following command: ( chmod options permissions file name).
Chmod changes the file mode of each specified file according to mode,
which can be either a symbolic representation of changes to make, or an
octal number representing the bit pattern of the new mode bits. The format
of the symbolic mode is:

[ugoa...][[+-=][perms...]...]
A combination of the letters u,g,o and a controls which users’
access to the file will be changed: the user who owns it (u), other
users in the file’s group (g), other users not in the file’s group (o),
or all users(a). if none of these are given, the effect is as if a were
given, but bits that are set in the umask are not affected.
1) Ls: listing all files in a system.
2) Pwd: print working directory.
3) Cd: takes you back to your home directory.
4) Mkdir: Makes a new directory which you can name it.
5) Rmdir: Removes directory that should be empty.
6) Cp file1 file2: makes a copy of file1 and calls it file2.
7) History: list your last 10 commands and numbers them.
8) Who: displays the the users who logged on.
9) Sort: Command that sorts the specified files.
10) Man: online manual (help) about commands.
11) More: look at file, one page at a time.
12) Rm: Remove or deletes a file.
13) Lpr: sends a file to the printer.
14) Df: checks the amount of free disk space.
15) Passwd: Command that changes the password.
16) Grep: find a which files contain a certain word.
17) Split: splits up a file into sub files.
18) Join: Joins two sorted files on a common key.
19) Alias: is a way of mapping one word to another( example
instead of typing “Dahrouj”, simply making it shorter for “Dah”
20) Shred: Securely remove your file by overwriting then removing.

You might also like