Professional Documents
Culture Documents
Preparation
Sudo su-
Apt-get install fakeroot build –essential
Apt-get install crash kexec- tools
makedumpfile kernel –wedge
Apt-get build-dep linux
Apt-get install git core libncurses5
libncurses5-dev
Apt-get install libelf-dev libdw-dev
asciidoc binutils-dev
Exit
Creating branch
To see all the available kernels available type
the following command:
-git tag-l| sort –V
Git checkout ubuntu-2.6.35.-23.37 –b core2
-this will create a branch called core2.
*file:debian.master/rules.d/i386.mk
--search for the line:
*flavours = generic generic-pae virtual
-change it in:
* flavours = generic generic-pae virtual
core2
Ordinary files
Ordinary files can contain text, data or
program information. Files cannot contain
other files or directiories unlike other
operating systems, unix filenames are not
broken into a name part and an extension
part(although extensions are still frequently
used as a means to classify files). Instead they
can contain any keyboard character expect or
‘/’ and be up to 256 characters long(note
however that characters such as *.?,# and &
have special meaning in most shells and should
not therefore be used in filenames). Putting
spaces in filenames also makes them difficult to
manipulate – rather use the underscore”_”
Directories
*directories are containers or folders that hold
files and other directories.
Devices
*to provide applications with easy access to
hardware devices, unix allows them to be used
in much the same way as ordinary files. There
are 2 types of devices in unix- block oriented
devices which transfer data in blocks (e.g. hard
disk) and character –oriented devices that
transfer data on a byte-by-byte basis (e.g.
modems and dumb terminals)
Links
*a link is a pointer to another file. There are
two types of links – a hard link to a file is
indistinguishable from the itself. A soft link (or
symbolic link) provides an indirect pointer or
shortcut to a file. A soft link is implemented as
a directory file entry containing a pathname.
Unix-iin directory-iiin butets??????(sangiin
butets gsn ug)
Geriiin daalgawar
< Linux's directory structure - 1.2 >
As you may have noticed, Linux organizes its files differently from Windows. First the directory
structure may seem unlogical and strange and you have no idea where all the programs, icons,
config files, and others are. This tuXfile will take you to a guided tour through the Linux file
system. This is by no means a complete list of all the directories on Linux, but it shows you the
most interesting places in your file system.
</>
The root directory. The starting point of your directory structure. This is where the Linux system
begins. Every other file and directory on your system is under the root directory. Usually the root
directory contains only subdirectories, so it's a bad idea to store single files directly under root.
Don't confuse the root directory with the root user account, root password (which obviously is
the root user's password) or root user's home directory.
/etc/inittab
A text file that describes what processes are started at system bootup and during normal
operation. For example, here you can determine if you want the X Window System to start
automatically at bootup, and configure what happens when a user presses Ctrl+Alt+Del.
/etc/fstab
This file contains descriptive information about the various file systems and their mount points,
like floppies, cdroms, and so on.
/etc/passwd
A file that contains various pieces of information for each user account. This is where the users
are defined.
/usr/doc
Documentation for the user apps, in many file formats.
/usr/share
Config files and graphics for many user apps.
/usr/src
Source code files for the system's software, including the Linux kernel.
/usr/include
Header files for the C compiler. The header files define structures and constants that are needed
for building most standard programs. A subdirectory under /usr/include contains headers for
the C++ compiler.
/usr/X11R6
The X Window System and things for it. The subdirectories under /usr/X11R6 may contain
some X binaries themselves, as well as documentation, header files, config files, icons, sounds,
and other things related to the graphical programs.
Most likely your machine isn't a part of a network like this, but it doesn't mean that /usr/local
is useless. If you find interesting apps that aren't officially a part of your distro, you should install
them in /usr/local. For example, if the app would normally go to /usr/bin but it isn't a part
of your distro, you should install it in /usr/local/bin instead. When you keep your own
programs away from the programs that are included in your distro, you'll avoid confusion and
keep things nice and clean.
/var/log
A directory that contains system log files. They're updated when the system runs, and checking
them out can give you valuable info about the health of your system. If something in your system
suddenly goes wrong, the log files may contain some info about the situation.
/var/mail
Incoming and outgoing mail is stored in this directory.
/var/spool
This directory holds files that are queued for some process, like printing.
The /mnt directory contains mount points for different devices, like /mnt/floppy for the floppy
drive, /mnt/cdrom for the CD-ROM, and so on. However, you're not forced to use the /mnt
directory for this purpose, you can use whatever directory you wish. Actually in some distros,
like Debian and SuSE, the default is to use /floppy and /cdrom as mount points instead of
directories under /mnt.
2 sariin 17 lecture 3
Shell
*command line interpreter or shell
- provides a traditional user interface for the
Unix operating system and for unix-like systems
*users direct the operation of the computer
-entering command inputs as text
-creating text scripts of one or more such
commands.
*the most influential Unix are
-Bourne shell (bash, sh)
-C shell (csh)
#!/bin/sh
MY_MESSAGE=”Hello world”
Echo $MY_MESSAGE
There must be no spaces around the
“=”sign
*#!/bin/sh
*echo What is your name?
*read MY_NAME
*echo “Hello $MY_NAME – hope you’re well.”
*myvar2.sh
-#!/bin/sh
-echo “MYVAR is: $MYVAR”
-MYVAR=”hi there”
-echo “MYVAR is: $MYVAR”
Ajilluulj uzsen ni:
*$./myvar2.sh
*MYVAR is:
*MYVAR is: hi there
*MYVAR=hello
*$./MYVAR2.sh
*MYVAR is:
*MYVAR is: hi there
*$export MYVAR
*$./MYVAR2.sh
*MYVAR is: hello
*MYVARis: hi there
#!/bin/sh
Echo “what is your name?”
Read USER_NAME
Echo “HELLO $USER_NAME”
Echo “I will create you a file called $
{USER_NAME}_FILE”
Touch “${USER_NAME}_FILE”