Uploaded by Zareena Adams

Summary (2)

advertisement
See the inputenc package documentation for explanation. Type H ¡return¿ for immediate help 2
1
PHYCO 1100(1)
Summary
Allamammally Zaheen Bibi
ID: 2015135
December 2020
Abstract
An overview of everything that was taught in the module PHYCO
1100(1) has been typed in this document. A summary on the operating system, namely Linux together with some basic commands have
been detailed out. A brief description on how to use the Latex software
is also written in this document.
Contents
1 Linux
1.1 Introduction . . . . . . . .
1.2 History of linux . . . . . .
1.3 Pros and cons of linux . .
1.4 Linux and GNU . . . . . .
1.5 Logging in . . . . . . . . .
1.5.1 Graphical mode . .
1.5.2 Text mode . . . . .
1.6 The root . . . . . . . . . .
1.7 Some basic commands and
1.8 Files and the file system .
1.8.1 Sorts of files . . . .
1.8.2 Partitioning . . . .
1.8.3 File system layout
1.8.4 Paths . . . . . . .
1.8.5 The shell . . . . . .
1.9 Processes . . . . . . . . .
1.9.1 Daemons . . . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
features
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
2
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
3
3
3
4
4
4
4
5
5
5
6
6
7
7
8
8
8
9
2 Latex
2.1 Introduction . . . . . . . . . . .
2.2 Advantages of using latex . . .
2.3 Disadvantages of using latex . .
2.4 A typical command line session
2.5 Special Characters . . . . . . .
2.6 Packages . . . . . . . . . . . . .
2.7 Writing equations . . . . . . . .
2.8 Some commands . . . . . . . .
2.9 Tables . . . . . . . . . . . . . .
2.9.1 Creating a table . . . . .
2.10 Mathematical Formulae . . . .
2.10.1 Greek letters . . . . . .
1
1.1
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
10
10
10
10
11
11
11
11
12
12
12
13
13
Linux
Introduction
Linux is an operating software which proves to be very beneficial. One
can enjoy these benefits if one learns effectively how to use the operating
system.Linux is the most used and best known operating system. It is different from other operating systems in many ways.The code used to create
Linux is free of charge and accessible for the public to view, edit, and for
users with the appropriate skills can contribute to the modification of the
operating system.
The system consist of a kernel. The latter is the heart of the operating
system. It enables communication between the hardware and the peripherals.
1.2
History of linux
Linux was invented and written by Linus Torvalds, who was curious about
how to seek freely available academic version of Unix (Linux is not Unix).
Unix was developed way before, in the 1960s, by a team of developers in Bell
Labs laboratories.
Linux is a full clone of Unix and the system has now got a lot of users. Today, Linux is well-known as a stable and reliable platform, providing database
and trading services for companies like Amazon, the well-known online bookshop, US Post Office, the German army and many others.
3
1.3
Pros and cons of linux
• Pros:
1. Linux is free.
2. Linux is portable to any hardware platform.
3. Linux was made to keep on running.
4. Linux is secure and versatile.
• Cons:
1. There are far too many different distributions.
2. Linux is not very user friendly and confusing for beginners.
1.4
Linux and GNU
The Linux system is based on GNU tools (Gnu’s Not UNIX), which provide a set of standard ways to handle and use the system. All GNU tools are
open source, so they can be installed on any system.
1.5
Logging in
In order to work on a Linux system directly, a username and password
must be provided. The system can be ran on two modes, the graphical mode
or the text mode.
1.5.1
Graphical mode
This mode is mostly used on desktop computers. While connecting to the
system using graphical mode, the user is first asked to enter his username
and then, in a new window, he will have to type his password. The Enter
key is then used to log in. To continue, a terminal window should be opened.
The terminal window is the control panel for the system and it should always
show a command prompt. The latter displays the user’s login name, and the
current working directory, represented by the twiddle.
4
1.5.2
Text mode
A user in in text mode when the screen is black and showing white characters. The login is different from a graphical login. There are no buttons on
the screen that can be clicked. Once the user has typed his username, he will
have to hit Enter and then type his password to log in. After being accepted
as a valid user by the system, the user may get some more information, called
the message of the day, which can be anything.
1.6
The root
root is the user name or account that by default has access to all commands
and files on a Linux or other Unix-like operating system. It is also referred to
as the root account, root user and the superuser. It is generally considered
a bad idea to connect (graphically) using the root user name, the system
administrator’s account, since the use of graphics includes running a lot of
extra programs, in root’s case with a lot of extra permissions. To keep all
risks as low as possible, use a normal user account to connect graphically.
1.7
Some basic commands and features
Table 1: Quickstart commands
Command
ls
cd directory
passwd
file
cat
pwd
exit or logout
man command
info command
apropos string
info
man
passwd
Meaning
Displays a list of files in the current working directory
change directories
change the password for the current user
filename display file type of file with name filename
textfile throws content of textfile on the screen
display present working directory
leave this session
read man pages on command
read Info pages on command
search the whatis database for strings
Read Info pages about a command
Read manual pages of a command
Change your password
5
Table 2: Key combinations in Bash
Key
Ctrl+A
Ctrl+C
Ctrl+D
Ctrl+E
Ctrl+H
Ctrl+L
Ctrl+R
Ctrl+Z
Tab
Tab Tab
1.8
Functions
Move cursor to the beginning of the command line.
End a running program.
Log out of the current shell session
Move cursor to the end of the command line
Generate backspace character
Clear this terminal
Search command history
Suspend a program
Command or filename completion
Shows file or command completion possibilities
Files and the file system
”On a UNIX system, everything is a file; if something is not a file, it is a
process.”
1.8.1
Sorts of files
• Directories: files that are lists of other files.
• Special files: the mechanism used for input and output.
• Links: a system to make a file or directory visible in multiple parts of
the system’s file tree.
• Sockets: a special file type, similar to TCP/IP sockets, providing interprocess networking protected by the file system’s access control.
• Named pipes: act more or less like sockets and form a way for processes to communicate with each other, without using network socket
semantics
6
Table 3: File types
Symbol
d
l
c
s
p
b
1.8.2
Meaning
Regular file
Directory
Link
Special file
Socket
Named pipe
Block device
Partitioning
A partition is a logical division on a hard disk drive. By dividing the hard
disk in partitions, data can be grouped and separated. When an accident
occurs, only the data in the partition that got the hit will be damaged, while
the data on the other partitions will most likely survive. Most Linux systems
use fdisk at installation time to set the partition type.
There are two kinds of major partitions on a Linux system:
• data partition: normal Linux system data, including the root partition
containing all the data to start up and run the system.
• swap partition: expansion of the computer’s physical memory, extra
memory on hard disk.
1.8.3
File system layout
For convenience, the Linux file system is usually thought of in a tree structure.
7
Table 4: Subdirectories of the Root directory
Directories
Content
\bin
Common programs, shared by the system
\boot
The startup files and the kernel
\dev
Contains references to all the CPU peripheral hardware
\home
Home directories of the common users
\misc
For miscellaneous purposes.
\lib
Library files, includes files for all kinds of programs needed by the system.
\tmp
Temporary space for use by the system, cleaned upon reboot
1.8.4
Paths
A path, which is the way you need to follow in the tree structure to reach a
given file. the path starts with a slash and is called an absolute path. Paths
that don’t start with a slash are called relative paths.
1.8.5
The shell
A shell manages the interaction between the system and its users. It is an
advanced way of communicating with the system, because it allows for twoway conversation and taking initiative. There are different types of shell such
as sh or bash.
1.9
Processes
Interactive processes are initialized and controlled through a terminal session.
In other words, there has to be someone connected to the system to start
these processes; they are not started automatically as part of the system
functions. These processes can run in the foreground, occupying the terminal
that started the program,
8
1.9.1
Daemons
Daemons are server processes that run continuously. Most of the time, they
are initialized at system startup and then wait in the background until their
service is required. An example is the networking daemon, xinetd, which is
started in almost every boot procedure.
Table 5: Controlling processes and more commands
Command
Meaning
regular command
Runs this command in the foreground.
command Run this command in the background.
jobs
Show commands running in the background.
Ctrl+Z
Suspend a process running in the foreground.
Ctrl+C
Interrupt a process running in the foreground.
%n
By using the % expression, a job can be referred to using its number
bg
Reactivate a suspended program in the background.
fg
Puts the job back in the foreground.
kill
End a process
at
Queue jobs for later execution,
crontab
Maintain crontab files for individual users.
nice
Run a program with modified scheduling priority.
pstree
display a tree of processes,
sleep
Delay for a specified time.
time
Time a command or report resource usage.
top
Display top CPU processes.
uptime
Show how long the system has been running.
vmstat
Report virtual memory statistics.
w
Show who is logged on and what they are doing.
wall
Send a message to everybody’s terminals.
who
Show who is logged on.
write
Send a message to another user.
9
2
Latex
2.1
Introduction
LaTeX is a software system for document preparation. When writing, the
writer uses plain text as opposed to the formatted text found in ”What You
See Is What You Get” word processors like Microsoft Word, LibreOffice
Writer and Apple Pages. In latex, it is easier and faster to type words and
mathematical formulae.
2.2
Advantages of using latex
1. Professionally crafted layouts are available, which make a document
really look as if “printed.”
2. The typesetting of mathematical formulae is supported in a convenient
way.
3. Users only need to learn a few easy-to-understand commands that specify the logical structure of a document.
4. Even complex structures such as footnotes, references, table of contents, and bibliographies can be generated easily.
5. Free add-on packages exist for many typographical tasks not directly
supported by basic LATEX.
6. TEX, the formatting engine of LATEX 2, is highly portable and free.
Therefore the system runs on almost any hardware platform available.
2.3
Disadvantages of using latex
1. Although some parameters can be adjusted within a predefined document layout, the design of a whole new layout is difficult and takes a
lot of time.
2. It is very hard to write unstructured and disorganized documents.
10
2.4
A typical command line session
\documentclass{article}
\begin{document}
Small is beautiful
\end{document}
2.5
Special Characters
#$%{}\
The above symbols are reserved characters that either have a special
meaning under LATEX or are not available in all the fonts.
2.6
Packages
While writing a document, Specific enhancements called packages should be
used to enhance the capabilities of Latex. These packages are helpful when
the user wants to add graphics or color to texts.
Packages are activated using the command \usepackage{package}
2.7
Writing equations
To type Einstein’s formula:
e = m · c2 ,
We use the line session:
\begin{equation}
e = m \cdot cˆ2 \; ,
\end{equation}
11
(1)
2.8
Some commands
\textbf
to make a text bold
\textit
to write a text in italic
\\or\newline
line break
\newpage
starts a new page
\begin{itemize}
listing
\textcolor
change the color of a text
\tableof contents
create table of content
\par
starts new paragraph
\underline
underline a text
\f ootnote{text}
Enter footnote
2.9
Tables
The tabular environment can be used to typeset beautiful tables with optional horizontal and vertical lines.
2.9.1
Creating a table
\begin{center}
\begin{tabular}{|r|l|}
\hline1
Fruit & Color \\
\hline
Strawberry & Red \\
\hline
Banana & Yellow \\
\hline
Orange & Orange \\
\hline
\end{tabular}
\end{center}
Result :
Fruit
Strawberry
Banana
Orange
1
Color
Red
Yellow
Orange
The hline command is used to create the horizontal line separating each rows.
12
2.10
Mathematical Formulae
c 2 = a2 + b 2
To write the above formula, the following commands were entered:
\begin{math}
cˆ{2} = aˆ{2} + bˆ{2}
\end{math}
Other ways to write the mathematical formulae is by enclosing them
between $ and $.
n
X
π2
1
=
n→∞
k2
6
k=1
lim
The above formula looks complicated to write, but, thanks to the facilities
provided by the software, it can be easily done in a matter of second if the
following commands are appropriately entered:
\begin{displaymath}
\lim {n\to\inf ty}
\sum {k = 1}ˆn\f rac{1}{kˆ2}
= \f rac{\piˆ2}{6}
\end{displaymath}
To type
2.10.1
√
x, the command \sqrt{x} is used.
Greek letters
Lowercase Greek letters are entered as \alpha, \beta, \gamma and uppercase letters
are entered as \Gamma, \Delta.
13
Math Commands Greek letters
\lambda
λ
\xi
ξ
\pi
π
\mu
µ
\P hi
φ
\Omega
Ω
References
[1] Introduction to Linux
A Hands on Guide
Machtelt Garrels
[2] The Not So Short Introduction to LATEX
by Tobias Oetiker Hubert Partl, Irene Hyna and Elisabeth Schlegl
04 April, 2004
14
Download