Linux

What is Linux?

Linux, pronounced Linnucks, is an operating system, which is free or nearly free and is distributed in source form. Linus Torvalds, a Finnish computer science student, began work on a kernel for a Unix-like system in the early 1990s and finally finished it with other programmers around the world. The kernel had been integrated with other GNU software, which was founded by MIT scientist Richard Stallman, to produce a fully functional operating system, which called Linux. The first Linux version was released in March of 1994.

Installation of Red Hat 7.1

To install Linux on your computer is not that difficult if you have some basic knowledge about your computer. Red Hat is the most popular Linux today and it makes the installation easier.

When you want to install Linux and don't want to discard the operating systems you are familiar with on your computer, things maybe become a little bit difficult. First, you should get enough hard disk space for Linux. Then you have to assure the free space is using Linux partition not FAT or NTFS. Luckly, PartitionMagic is a very good tool to do those things.

Red Hat requires you to define three partitions: boot, swap, and file partitions during the installation. Lilo is suggested not to place at MBR. After installation, you'd better read some documents at /usr/doc/HOWTO.

To let Linux live with MS Windows, lilo should be installed at its own root partition not MBR. Use the following commands to boot it up with Windows.

#mount -t msdos /dev/hda1 /mnt/c //mount your C: to linux
#dd if=/dev/hda7 bs=512 count=1 of=/mnt/c/bootsect.lnx 
//maybe yours's hda5 (root partition) #umount /mnt/c
Change boot.ini on C drive by adding a line C:\bootsect.lnx="Linux" . Read only property should be changed also. Reboot your computer and you will enjoy multi-boot operating systems.

Basic of Linux

hi

Installation of applications
#cp filename.tar.gz /root
#tar xvzf filename.tar.gz
#./configure
#make
#make install
#make clean
#make distclean

Exit the system
shutdown/halt/reboot
shutdown -h/-r now
Ctrl+Alt+Del for RedHat

Exit X window
logout
Ctrl+Alt+BackSpace

Virtual console
Alt+Fn

Floppy disk/CD-ROM
#mount -t ext2 /dev/fd0 /mnt/dos //linux system
#mount -t msdos /dev/fd0 /mnt/floppy //floppy disk
#mount -t iso9660 /dev/hdc /mnt/cdrom //hda-hdd, hdc-cd-rom, hdd-cd-rw
#umount /mnt/floppy //exit floppy disk
#mke2fs /dev/fd0 1440 //create a file system on the fd

RedHat ls - color display
open /etc/bashrc
alias ls="ls --color"

#file myfile //file type
#whereis myfile //file path
#find . -name 'myfile' -print //find myfile at /usr
.tar.gz file #tar zxpvf my.tar.gz touch //create a new file
rm //remove files
more , less //read a file
mv //rename a file
cp //copy a file
apropos
.profile = autoexec.bat
mc/mkdir/rmdir/cd/pwd/tree

adduser newuser
passwd newuser
/usr/sbin/groupadd mygroup
/usr/sbin/useradd -g mygroup newuser

Command Function

df
Shows the amount of free disk space (in 1K blocks) on each mounted filesystem.

du
Shows the amount of disk space (in 1K blocks) used by the working directory and its subdirectories.

free
Shows memory usage statistics, including total free memory, memory used, physical memory, swap memory, shared memory, and buffers used by the kernel.

ps
Shows the active processes (instances of running programs) associated with this login session. Use the -a option to list all processes.

top
Shows a continually updated display of active processes, and the resources they are using. Type the q key to exit.

uptime
Shows the current time, the amount of time logged in, the number of users logged in, and system load averages.

users
Shows each login session.

w
Shows a summary of system usage, currently logged-in users, and active processes.

who
Shows the names of users currently logged in, the terminal each is using, the time each has been logged in, and the name of the host from which each logged in (if any).

vi

Esc - Cmd/Text
i - <insert>
r - replace text or press <insert> twice
x - delete the char
dd - delete a line
set number - display line number
:u - undo
:wq - save & exit
:q! - not save & exit
:w - save
:w filename - save as

tar and rpm

# tar cvfz backup.tar.gz /etc/
# tar xvfz backup.tar.gz
z - backup file

# rpm -ivh //install
# rpm -Uvh //upgrade
# rpm -e //remove
--force //overwrite existing files
--nodeps //don't depend on other files

 

Compile C, C++, Java

ftp://ftp.gnu.org/pub/gnu/

#vi {xxx.c, xxx.cpp, xxx.java}

#cc -o exefile xxx.c
#c++ -o exefile xxx.cpp
#exefile

#javac xxx.java
java xxx

Database

 

Tech

1.

Web Sites

RPM package
Eric S. Raymond's Linux Reading List HOWTO
Gary Singleton's Gary's Place: Linux News Tips and Links
Joshua Go's Linux Guide
Linux Documentation Project
Linux Journal Web Page
Linux Journal's Linux Gazette
Linux Resources
Linux Web Ring
Linux Weekly News
Renaissoft's Linux Resources
Robert Kiesling's Linux Frequently Asked Questions with Answers (FAQ)

LinuxNewbie
TUCOWS Linux

Newsgroup

FAQs, HOWTOs, READMEs, etc. - comp.os.linux.answers
Writing Linux applications and porting applications to Linux - comp.os.linux.development.apps
Linux kernels, device drivers, and modules - comp.os.linux.development.system