医学ppt--linux常用commod.ppt

上传人:本田雅阁 文档编号:3534455 上传时间:2019-09-08 格式:PPT 页数:38 大小:6.51MB
返回 下载 相关 举报
医学ppt--linux常用commod.ppt_第1页
第1页 / 共38页
医学ppt--linux常用commod.ppt_第2页
第2页 / 共38页
医学ppt--linux常用commod.ppt_第3页
第3页 / 共38页
医学ppt--linux常用commod.ppt_第4页
第4页 / 共38页
医学ppt--linux常用commod.ppt_第5页
第5页 / 共38页
点击查看更多>>
资源描述

《医学ppt--linux常用commod.ppt》由会员分享,可在线阅读,更多相关《医学ppt--linux常用commod.ppt(38页珍藏版)》请在三一文库上搜索。

1、Start To Play ,Open Your VM (Of Cause!),First Step is?,Then,Wait, if we already have a server,You can use different tools Putty VNC,Putty,Normally, we can use this tool,VNC,How about we already have the desktop, can we use that?,Example: VNC Viewer,Easy way ,Example: VNC Sever Configuration,But, bef

2、ore we can use this tool, we need to configure our server.,Install yum install tigervnc-server Start and set password: vncserver :1 Configure: vim /etc/sysconfig/vncservers Add a line VNCSERVERS=“1:root“ Restart the VNC server service vncserver restart If we want the SVN server starts automatically

3、chkconfig vncserver on,Play With Linux ,cd, ls Were already mentioned,Navigate,Normally, we have to use command line,I dont want to re-type the same word,Try to use history: history !lineNum Ctrl + R,What if my command typing is wrong ?,Command line editing In this case, you need command line editin

4、g Moving Ctrl-a Move cursor to the beginning of the line. Ctrl-e Move cursor to the end of the line. Ctrl-f Move cursor forward one character; same as the right arrow key. Ctrl-b Move cursor backward one character; same as the left arrow key. Alt-f Move cursor forward one word. Alt-b Move cursor bac

5、kward one word. Ctrl-l Clear the screen and move the cursor to the top left corner. The clear command does the same thing.,Command line editing Editing Ctrl-d Delete the character at the cursor location Ctrl-t Transpose(exchange)the character at the cursor location with the one preceding it. Alt-t T

6、ranspose the word at the cursor location with the one preceding it. Alt-l Convert the characters from the cursor location to the end of the word to lowercase. Alt-u Convert the characters from the cursor location to the end of the word to uppercase.,What if my command typing is wrong (Con.) ?,Comman

7、d line editing Cut And Paste Ctrl-k Kill text from the cursor location to the end of line. Ctrl-u Kill text from the cursor location to the beginning of the line. Alt-d Kill text from the cursor location to the end of the current word. Alt-Backspace Kill text from the cursor location to the beginnin

8、g of the word. If the cursor is at the beginning of a word, kill the previous word. Ctrl-y Paste the text at the cursor location.,What if my command typing is wrong (Con.) ?,Command: ls, cd sh startStore.sh, ./startStore.sh,Execute command / script,Normally, it is the easiest part,But, some exceptio

9、ns are also exist ,Exceptions You May Meet,Env variables issue Set the required environment variables Format issue dos2unix Command not found Install the required softwares Access right su, sudo, chown, chgrp, chmod,How To Install The Required Softwares (1),Almost all software for a Linux system can

10、 be found on the Internet. How will them be provided: Most of them are package files Rest of them are source code,How To Install The Required Softwares (2),Most distributions belong to one of two camps of packaging technologies The Debian “.deb” camp Debian, Ubuntu, Xandros, Linspire The Red Hat “.r

11、pm” camp Fedora, CentOS, Red Hat Enterprise Linux, OpenSUSE, Mandriva, PCLinuxOS,How To Manage The Required Softwares On Debian,Through repository: apt-get install package_name apt-get remove package_name Through package: dpkg -install package_file apt-get remove package_name,How To Manage The Requi

12、red Softwares On Red Hat,Through repository: yum install package_name yum erase package_name Through package: rpm -i package_file yum erase package_name,How To Install The Required Softwares From Source Code,Dowload: wget ftp Unpacked tar xzf diction-1.11.tar.gz Build ./config make install,Got Error

13、s ?,Check log: VI, cat, less Pipe Search,Now, I can execute the scripts, but I got errors after I execute them,VI Introduction,Start - vi filename Quit - :q! / wq Command mode VS Input mode Initially, Command mode From Command mode to Input mode - Type “i” From Input mode to Command mode Type “Esc”,

14、Move Cursor In VI,numberG To line number. For example, 1G moves to the first line of the file. G To the last line of the file. Ctrl-f or Page Down Down one page. Ctrl-b or Page Up Up one page. 0 (zero) To the beginning of the current line $ To the end of the current line. ,Basic Editing In VI,a Ente

15、r Input mode and move cursor beyond the current location of cursor. A Enter Input mode and move cursor beyond the end of the line. o Enter Input mode and open a line below the current line. O Enter Input mode and pen a line above the current line. ,Deleting In VI,dd Delete the current line. 5dd The

16、current line and the next 4 lines. dG From the current line to the end of the file. d$ From the cursor position to the end of the current line. d0 From the cursor position to the beginning of the current line. u Undo ,Cutting, Copying And Pasting In VI,d The d command will be used as both delete and

17、 cut. p/P To copy the text after/before the cursor. yy Copy the current line. 5yy Copy the current line and the next 4 lines. yS Copy from the current cursor to the end of line. y0 Copy from the current cursor to the begin of the line. yG Copy from the current cursor to the end of the file. J Contac

18、t the lines below to the current line.,Finding And Replacing In VI,f Find character in one line. Type semicolon to repeat. / Find in the whole file. Type “n” to repeat. :%s/Line/line/g Replace. % is a shortcut meaning from the first line to the last line. Alternately, the range could have been speci

19、fied 1, 5. s Specifies the operation. In this case, substitution (search and replace) g means “global”, if omitted, only the first instance of the search string on each line is replaced,Common Search Methods,locate It look up path in database. updatedb To update the database for locate. find Find fi

20、les base on different conditions.,I/O Redirect,The result of commands: stdout Status and error messages: stderr The default output is connect to screen The inputs are from the standard input: stdin The default input is connect to the keyboard I/O Redirect allows us to change the direction of outputs

21、 and inputs,STDOUT Redirect,Operator “” Examples ls -l /usr/bin ls-output.txt test.txt Empty the file or create a new file. echo “sh startStorefront.sh” startStore.sh 3. Operator “” Append content instead of empty the content.,STDERR Redirect,A program can produce output on any of several numbered f

22、ile streams. We have referred to the first three of these file streams as standard input, output and error, the shell references them internally as file descriptors zero, one and two, respectively. Example ls -l /bin/usr 2 ls-error.txt Redirect the second file stream which refers to the stderror to

23、the file.,Get Together,ls -l /bin/usr ls-output.txt 2&1 There are two redirect: Redirect output to ls-output.txt Redirect STDERR to STDOUT Newer way for this task: ls -l /bin/usr & ls-output.txt Redirect STDERR and STDOUT to the ls-output.txt through “&”,If we can output both STDOUT and STDERR into

24、the same file,Exception,ls -l /bin/usr 2 /dev/null /dev/null This file is a system device called a bit bucket which accepts input and does nothing with it.,If we write a script, and the there are too many log which we want to ignore,STDIN Redirect,cat cat movie.mpeg.0* movie.mpeg Concact files cat l

25、azy_dog.txt Create new file through the STDIN “” cat lazy_dog.txt Read content from file and output to screen,Pipelines,Operator “|” The standard output of one command can be piped into the standard input of another. ls -l /usr/bin | less ls /bin /usr/bin | sort | less,Eventually, The Reason Is ,The

26、re is a process already running! ps ef | grep java tail f storefront.log kill -9 1234 The disk is full df H du -sh * | sort -nr | head du -sh * | sort -nr | less,Dont Play So Hard ,Some times, you can use cron to help you to do the scheduled job. vi /etc/crontab 00 18 * * * root /usr/sbin/bakmysql s

27、udo /etc/init.d/cron restart Dont type so much, use tab to auto complete the command. Make the long commands to short ones with alias. alias startStore=cd /home/atg-student & ./startStore.sh Make the long file paths to short paths through ln. ln -s /workspace/proj-src/server-scripts/startStore.bat /scripts/startStore.bat,Dont Play So Hard,Hey, let Linux to help you to do something!,http:/billie66.github.io/TLCL/index.html,References,

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 其他


经营许可证编号:宁ICP备18001539号-1