📄 00000001.htm
字号:
<eg> %echo TEST > test.1 <BR> %echo test >> test.1 <BR> %cat test.1 <BR> TEST <BR> test <BR> % <BR> <BR> 另外还有一种是标准错误输出(standard error),用来显示错误讯息,如果output <BR>被转向,我们还是可以立刻在萤幕上看到错误讯息。">&"可以把它转向,">>&" 则是附 <BR>加在档案後面。 <BR> <BR> 再介绍管道的观念。"|" 是管道的符号,它的性质就像一根管子,用来连接左右两 <BR>边的输出和输入。左边指令的output,会当作右边指令的input ,如此一来,我们就可 <BR>以对output做筛选的工作,只留下想要的资料。 <BR> <BR> <eq> %ps -aux | grep <name> <BR> 就可以看到<name>所有正在执行的程式。 <BR> <BR>□行程(process) <BR> <BR> <BR> <BR> 一个正在执行中的程式,我们称做process 。UNIX是多工的系统(multitasking), <BR>可以同时执行多个程式,让好几个人同时使用系统,执行程式。执行程式可分为两种: <BR>前景执行(foreground)和背景执行(background)。一般我们在shell 下执行程式,一直 <BR>要等到程式结束才能继续输入指令,这就是前景执行。如果说我们不想等待程式结束, <BR>或是执行时间太长,就可以将程式放到背景去执行,系统会自动执行它,而你就可以去 <BR>做别的事了。 <BR> 怎样才能把程式放入背景?只要在指令後面加上"&" 就可以了。一但你在背景执行 <BR>程式,系统会传回"[n] xxxx",n 是job id,xxxx是process id。每一个process 都有 <BR>process id,而且不会有重覆。 <BR> 要想停止前景执行的程式,可以按<Ctrl-C>中止,若是想暂停一下,可以按 <BR><Ctrl-Z>暂时停止执行,要恢复执行可以用fg或bg来决定前景或背景执行。 <BR> <BR> <eq> %xtetris& <BR> [1] 5678 <BR> % <BR> <BR>□万用字元(wildcard) <BR> <BR>在UNIX中,万用字元对输入档名非常有帮助。现在想看一下有哪些指令可用,你先打入 <BR> <BR> %cd /bin <BR> %ls -al <BR> <BR> %ls -al <BR> <BR>你会发现好多执行档,如果你只想找"m" 开头的档案,可以键入 <BR> <BR> %ls m* <BR> <BR>就可以做到。万用字元有三种: <BR> <BR> * 代表任意长度的字串 <BR> ? 代表任何的单一字元 <BR> [...] 代表区间内定义的任一字元 <BR> <BR> <eq> <BR> c* 代表cat ,cp ,cal ...任意长度且开头为c 。 <BR> ca? 代表cat,cal ...三个字且前二字为ca。 <BR> ca[a-z] 代表caa,cab,caz ... 三个字且头二字为ca第三字为a到z。 <BR> <BR>附录A 指令介绍 <BR> <BR>yppasswd change your password <BR> <BR>man <name> see the manual page of <name> <BR> <BR> <BR> <BR>who who is logged in on the system <BR> <BR>whoami display the effective current username <BR> <BR>w who is logged in, and what are they doing <BR> <BR>groups <username> show the user's group name <BR> <BR>quota -v <username> show the quota limited on user <BR> <BR>du disply disk usage <BR> <BR>pwd print working directory name <BR> <BR>cd <dirname> change directory to another directory <BR> <BR>cd change directory to your home directory <BR> <BR>ls list the contents of a directory <BR> options: <BR> -a list all entries <BR> -l list in long format <BR> <BR> -l list in long format <BR> -g show the group ownership <BR> -R recursively list subdirectories encoutered <BR> -F mark directories with '/', executable files <BR> with '*' <BR> <BR> <eg> ls -al <BR> ls -lF <BR> <BR>cat <filename> catenate and display a file <BR> <BR>more <filename> display a file page by page <BR> <BR>echo display a string <BR> <eg> %echo Hello World <BR> Hello World <BR> % <BR> <BR>cp <file1> <file2> copy files <BR> <BR>rm <filename> remove a file <BR>rm -r <dirname> recursively remove a directory <BR> <BR> <BR> <BR>mv <filename> <newname> rename a file (directory) <BR>mv <filename> <dirname> move a file to the directory <BR> <BR>mkdir <dirname> creat a new directory <BR>rmdir <dirname> remove an empty directory <BR> <BR>ln <filename> link a file <BR> option: -s symbolic link <BR> <BR>chmod <Mode> <filename> change the permission mode of file <BR> absolute:400 read by owner <BR> 200 write by owner <BR> 100 execute by owner <BR> 040 read by group <BR> 020 write by group <BR> 010 execute by group <BR> 004 read by others <BR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -