Presentation is loading. Please wait.

Presentation is loading. Please wait.

Basic knowledge about Linux

Similar presentations


Presentation on theme: "Basic knowledge about Linux"— Presentation transcript:

1 Basic knowledge about Linux
2007/05/20

2 Main content Linux Architecture The General Command Vi Text Editor
Input - Output redirection Others

3 Linux Architecture What is linux How Linux Is Different
Linux Distributions Linux Components How Linux Organizes Data

4 What is Linux Linux is an operating system
Properly speaking, the name Linux applies to the Linux kernel Linux kernel not the entire operating system Red Hat Enterprise Linux is entire operating system

5 How Linux Is Different Linux is a cross-platform operating system
Linux is free more important and many Linux applications are distributed in source form

6 Linux Distributions Linux can be freely redistributed, you can obtain it in a variety of ways. Distribution Home page Debian GNU/Linux Fedora Core Red Hat Enterprise Linux SuSE Linux Slackware Linux

7 Linux architecture

8 Different level

9 Linux Components

10 The Linux directory tree
Description /bin User programs and scripts /boot Boot information, including the kernel /dev Device files /etc configuration files /home Users' home directories /lib Libraries, modules, and other object files /opt Used to store large applications /var Dynamic files, such as log files /proc kernel information and configuration items

11 How Linux Organizes Data
Devices Filesystems Directories and Paths File Permissions

12 Devices Linux receives data from, sends data to, and stores data on devices Device Description cdrom CD-ROM drive audio Sound card mouse Mouse ttyn Virtual console printer Printer null Pseudodevice that accepts unlimited output and throws it away

13 File systems Filesystem Description ext2
The predecessor of the ext3 filesystem ext3 The standard Linux filesystem , supported for compatibility iso9660 The standard filesystem used on CD-ROMs msdos used by MS-DOS and Windows. vfat A filesystem compatible with Microsoft's FAT32 filesystem, used by Windows 9x

14 Directories and Paths Home and working directories The directory tree
Absolute and relative pathnames

15 Home and working directories
a special directory known as your home directory. each user has a distinct home directory /home The current directory—or current working directory root user has a special home directory, /root.

16 The directory tree Directories of a Linux system Unlike MS-DOS
root directory, using a forward slash (/)

17 Absolute and relative pathnames
absolute path beginning at the root directory /home/bill/school current directory, as its starting point Bill/school, patrick/school three special directory names . cd ./bill/school .. cd ../patrick/school ~ cd ~

18 File Permissions Each directory and file has user, called owner
Each user belongs to groups The user and the group can be changed later. Access permissions, also known as modes Permission directory file r List the directory Read contents w Create or remove files Write contents x Access files and subdir Execute

19 The options of chmod u: user g: group o: other a: all r: read
w: write (and delete) x: execute (and access directory) +: add permission -: take away permission

20 How to change file mode chmod a+x web.xml chmod web.xml

21 The General Command about directory about file
about system maintenance

22 Command about dir man ,$ man ls ls mkdir( make directory)
$ls –a $ls –l ls –R ls –la mkdir( make directory) rmdir (remove directory) cd (change directory) pwd(print working directory)

23 Command about dir rm(remove files or directories) $rm -i $rm –rf
cp(copy files and directories) mv (move files) clear (clear screen)

24 Command about file cat (concatenate) $ cat web.xml less $less web.xml
The command cat can be used to display the contents of a file on the screen. less $less web.xml The command less writes the contents of a file onto the screen a page at a time head first ten lines of a file to the screen Tail last ten lines of a file to the screen Touch change file timestamps More

25 Command about file grep wc (word count) Sort--sort lines of text files
searches files for specified words or patterns Ps –aux|grep resin wc (word count) Who|wc –l Sort--sort lines of text files Sort web.xml File determine file type $file file /bin/ls Find--search for files in a directory hierarchy $ find / -name web.xml

26 Command about file chmod chown tar
Changes the access mode of the specified files chmod -R mode files Chmod –R 700 web.xml chown Changes the owner of the specified files chown -R userid files Chown –R apache.apache httpd.conf tar Creates a tar file with the specified name tar -zcvf tar_file files tar -zcvf tst.tar.gz tst.c tar –zxvf tar_file

27 Command about system adduser userid Passwd userid df -h du dir free
Displays the amount of free disk space on each mounted file system du dir Displays the amount of disk space used by the current directory du -sh /root free Displays the amount of used and free system memory

28 Command about system hostname name kill process_id ps -aux reboot
Displays (or sets) the name of the host ~]# hostname ~]# support kill process_id kill – ps -aux reboot shutdown -h minutes who ifconfig

29 Vi Text Editor The Vi editor has powerful features to aid programmers
The Vi editor has two modes: command and insert. The command mode allows the entry of commands to manipulate text. The insert mode puts anything typed on the keyboard into the current file. Vi initially starts in command mode

30 How to open a file in Vi vi filename (opens specified file)
$ vi web.xml command mode i, a,o: Enter insert mode When you want to get out of the editor, switch to command mode (press Esc)

31 How to exit editor ESC: from insert mode Enter command mode
$wq Rtn to save the edited file and quit $q! Rtn to quit the editor without saving changes $w filename to save the edited file to new file "filename" $w Save the file without exiting ESC: from insert mode Enter command mode

32 Manual about vi

33 Manual about vi

34 Manual about vi

35 Manual about vi

36 Manual about vi

37 Manual about vi

38 Manual about vi

39 Input - Output redirection
> Redirector Symbol Ls >log >> Redirector Symbol Ps –axu >log < Redirector Symbol Cat < log >null ls >null

40 pipe A pipe is a way to connect the output of one program to the input of another program without any temporary file.

41 pipe

42 Others How to kill an process How to find a software package
how to start a service How to install jdk in Linux how to use scm tool--subversion

43 How to kill an process [root@support conf]# ps axu|grep mysqld
conf]#kil –

44 How to find a software package
conf]# rpm -qa|grep mysql mysql-devel RHEL4.1 mysql RHEL4.1 mysqlclient10-devel RHEL4.1 mod_auth_mysql

45 how to start a service [root@cas ~]# /etc/init.d/httpd status
httpd (pid ) 正在运行... ~]# /etc/init.d/httpd --help

46 How to install jdk in Linux
#sh j2sdk-1_3_1-linux-i386-rpm.bin #rpm -ivh jdk i386.rpm #vi /etc/profile  JAVA_HOME=/usr/java/jdk1.5.0_02 PATH=$JAVA_HOME/bin:/usr/sbin:$PATH export JAVA_HOME PATH USER

47 how to use svn command line
export: #svn export wrgs/ checkout: #svn checkout wrgs/ update: ~]# cd wrgs/ wrgs]# svn update 于修订版 346。 Commit: doc]# svn commit -m "update wrgs.sql" 正在发送 doc/wrgs.sql 传输文件数据. 提交后的修订版为 347。

48 Next ….. Linux shell script language Linux programming tool

49 End! Thank you


Download ppt "Basic knowledge about Linux"

Similar presentations


Ads by Google