- ---------------Chapter 1---------------
- Basic Unix and Solaris Concepts
- shell type
- Bourne shell sh
- Korn shell ksh
- C shell csh
- Bourne-again shell bash
- tcsh
- filesystem
- opt
- etc
- dev
- usr
- kernel
- var
- export
- User Accounts
- /etc/passwd
- root :x :0 :1:Super User:/:bin/sh
- 需要密码 组id
- /etc/shadow
- ---------------Chapter 2---------------
- Basic Unix Commands
- Syntax
- $Command [options][arguments]
- 256 one line
- different from DOS
- Case sensitive
- different command prompt:/
- clear
- pwd
- id id root id -a root
- cd ..(parent directory) ~(home) .(current)
- ls -a -R -t -l
- -F filetype
- /
- *可执行
- (none)文本
- chmod
- chmod g/u/a +/- r/w/x filename
- chmod 766 filename
- touch
- mkdir -p(无父目录,一次创建)
- cp -i(提示覆盖)-r(复制目录)
- mv -i(move or rename file and directories)
- rm -i -r
- rmdir (empty_dir)
- ln [-s] source_file target_file
- 硬链接ln /unix/02/text.txt tt删除源文件还可以用
- 软链接ln -s /unix/02/text.txt tt
- man
- ---------------Chapter 3---------------
- Metacharacters 元字符
- ls d*(zero or more)
- ls d?(single character)
- ls [b-f]b* (match a set or range ,single character )
- ; enter multiple commands on a command line cd;ls
- > output to a file cal >a.txt
- < input from file instead of keyboard
- >> append to output to a existing file
- piping takes the output of one command and passes it as input into a fallowing command
- ls -l /etc | more
- ls -l /etc | tee -a etc.lst
- tee 指令会从标准输入设备读取数据,将其内容输出到标准输出设备,同时保存成文件。
- ---------------Chapter 4---------------
- Text Viewer or Editor
- cat filename(s)
- cat /dev/null >cat1.txt 清空文件
- cat /etc/passwd | awk -F: '{print $1 "/t" $6}' /
- 显示部分信息 以:为间隔 一部分和六部分 无空格
- more
- head
- tail
- vi
- ^ 行首
- $ 行尾
- G 文件尾
- 1G 文件头
- nG n行
- H 屏幕头
- M 屏幕中
- L 屏幕底
- Ctrl+f 下翻
- Ctrl+b 上翻
- 插入i a o O
- 删除x dw 3dw dd 5dd :5,10d
- 修改r cw cc C
- 复制移动yw yy/Y dw dd p
- :1,2co3复制行1,2在行3后
- :4,5m6移动4,5在6后
- 保存 :w
- :w newfile
- :wq
- :q!
- 高级
- ~ 改变大小写
- J 当前行和下一行连接
- u 废除
- :set nu 显示行号
- :2l 光标停留在指定行
- 21G 光标停留在指定行
- /串 往下查找
- ?串 往上查找
- n 继续查找
- :r file2 插入文件
- :l,$s/旧串/新串/g 替换全文(:%s/旧串/新串/g)
- ---------------Chapter 5---------------
- Find things on unix
- users
- who
- who am i
- whoami
- find path expression[action]
- find / -name perl
- find . -mtime 10 -print
- find /etc-user 0 -size +400 -print
- find ~ -perm 777 >~/holes
- find /export/home -type f -atime +365 -exec rm {} /;
- grep 到文件内查找
- grep root /etc/passwd
- ls -la | grep -i 'sep 1'(-i case non-sensitive)
- ls file*|xargs grep dd
- wc 计算单词,字符,行数
- wc [option]filename(s)
- -l Conts lines
- -w Counts words
- -C Counts characters
- du 硬盘使用
- ps /usr/bin/ps
- -e list every process now running
- -f Generates a full listing
- -U uidlist processes whose real UID or login names age given
- ps -ef | grep talnet 列出telnet进程
- kill [-signal] process -id
- kill pid
- kill -9 pid(force)
- sleep pid & 后台执行
- pkill sleep 按名称关闭
- job control
- jobs display which jobs are currently running
- fg %n (job num)
- bg %n (job num)
- stop %n(bash不可用)(pid)
- kill %n (pid )
- Control+c
- Control+z
- ---------------Chapter 6---------------
- network basic
- ping
- ifconfig
- netstat
- telnet
- rlogin
- ftp
- cd,lcd
- dir
- bye
- bin,asc
- get,put,mget,mput
- hash
- prompt
- ---------------Chapter 7---------------
- Unix shell
- change Environment variables
- Cshell
- %setenv
- %echo
- %csh
- path
- Bshell
- alias
- source
- export
- crontab -l -r -e
- mailx
- 定时服务
Unix _Solaris_笔记
最新推荐文章于 2024-11-05 16:28:11 发布