《unix基本命令》由会员分享,可在线阅读,更多相关《unix基本命令(42页珍藏版)》请在金锄头文库上搜索。
1、UNIX 基本命令介绍1 1RC/OMCB case within ChinaRC/OMCB case within China看当前窗口是用什么用户登陆-whoamiomtsh-rcsysadm-/export/local /usr/ucb/whoamircsysadm2 2RC/OMCB case within ChinaRC/OMCB case within China从一个用户转到另一个用户 -suomtsh-rcsysadm-/export/local su - rootPassword: Sun Microsystems Inc. SunOS 5.8 Generic Patch F
2、ebruary 2004You have new mail.emenv.sh is called!localhost: DISPLAY=:0.0/opt/omc/ium_omcenv.sh is called by /etc/profile/opt/omc/ium_dbmenv_client.sh is called by /etc/profileomtsh-root-/rootomtsh-root-/root /usr/ucb/whoami root3 3RC/OMCB case within ChinaRC/OMCB case within China回到原来的用户-exitomtsh-r
3、oot-/root /usr/ucb/whoamiroot omtsh-root-/root exit omtsh-rcsysadm-/export/local /usr/ucb/whoami rcsysadm omtsh-rcsysadm-/export/local/OMC/home/rcsysadm 4 4RC/OMCB case within ChinaRC/OMCB case within China进入到某一个目录-cdomtsh-root-/root cd /etcomtsh-root-/etc5 5RC/OMCB case within ChinaRC/OMCB case wit
4、hin China显示当前目录-pwdomtsh-root-/ pwd/etc6 6RC/OMCB case within ChinaRC/OMCB case within China显示目录下的内容-lsomtsh-root-/etc ls acct fsck mknod project sock2path aliases fsdb mnttab protocols sulogin7 7RC/OMCB case within ChinaRC/OMCB case within China显示目录下的内容的详细清单-ls -lomtsh-root-/etc ls -ltotal 486drwxr
5、-xr-x 2 adm adm 512 Jan 26 2005 acctlrwxrwxrwx 1 root root 14 Jan 26 2005 aliases - ./mail/aliasesdrwxr-xr-x 2 root sys 512 Jan 26 2005 amidrwxr-xr-x 2 root bin 512 Jan 26 2005 apache-rwxr-r- 1 root sys 604 Jan 27 2005 asppp.cf8 8RC/OMCB case within ChinaRC/OMCB case within China显示目录下的隐含文件 -ls -laom
6、tsh-rcsysadm-/etc ls -latotal 509 drwxr-xr-x 43 root sys 3584 Sep 15 15:53 . drwxr-xr-x 28 root root 1024 Mar 11 2005 -rw-r-r- 1 root root 2236 Sep 15 15:50 .cpr_config -rw- 1 root other 0 Mar 14 2005 .group.lock -rw- 1 root other 0 Feb 1 2005 .hosts.lock -rw-r-r- 1 root sys 2020 Jan 28 2005 .login9
7、 9RC/OMCB case within ChinaRC/OMCB case within China分页显示-ls l |moreomtsh-root-/etc ls -l |moretotal 486drwxr-xr-x 2 adm adm 512 Jan 26 2005 acctlrwxrwxrwx 1 root root 14 Jan 26 2005 aliases - ./mail/aliasesdrwxr-xr-x 2 root sys 512 Jan 26 2005 amidrwxr-xr-x 2 root bin 512 Jan 26 2005 apache-rwxr-r-
8、1 root sys 604 Jan 27 2005 asppp.cf-more-1010RC/OMCB case within ChinaRC/OMCB case within China已知文件名,但不知在哪个目录 下,需要查找。 -find / -name hostsomtsh-root-/ find / -name hosts /etc/hosts1111RC/OMCB case within ChinaRC/OMCB case within China已知文件名 的某些字符,但不知 具体名字,也不知在哪个目录下, 需要查找。 -find / -name “*hos*”omtsh-ro
9、ot-/etc find / -name “*hos*“/usr/share/man/sman1/hostid.1 /usr/share/man/sman1/hostname.1 /usr/share/man/sman1m/check-hostname.1m /usr/share/man/sman1m/hostconfig.1m1212RC/OMCB case within ChinaRC/OMCB case within China显示文件内容-cat /etc/hostsomtsh-root-/ cat /etc/hosts# # Internet host table # 127.0.0
10、.1 localhost 192.168.3.56 omtsh omtsh.local loghost 192.168.3.55 ompsh #added by IUM 192.168.8.1 ATMport #added by IUM1313RC/OMCB case within ChinaRC/OMCB case within China分页显示文件内容 -more /etc/hostsomtsh-root-/ more /etc/hosts# # Internet host table # 127.0.0.1 localhost 192.168.3.56 omtsh omtsh.loca
11、l loghost 192.168.3.55 ompsh #added by IUM 192.168.8.1 ATMport #added by IUM 192.168.3.57 Router #added by IUM 192.168.3.61 computer1 #added by IUM 192.168.3.60 computer2 #added by IUM -more-1414RC/OMCB case within ChinaRC/OMCB case within China显示本机的 Ip地址,子网延码和 广播地址.-ifconfig -aomtsh-root-/ ifconfig
12、 -aeri0: flags=1000843 mtu 1500 index 2inet 192.168.3.56 netmask ffffff00 broadcast 192.168.3.255ether 0:3:ba:86:b3:6f 1515RC/OMCB case within ChinaRC/OMCB case within China显示本机有无缺省路由。-netstat -rompsh-root-/root netstat -r Routing Table: IPv4Destination Gateway Flags Ref Use Interface - - - - - - 19
13、2.168.3.0 ompsh U 1 364605 ce0 224.0.0.0 ompsh U 1 0 ce0 default Router UG 1 5909 localhost localhost UH 147 510571 lo01616RC/OMCB case within ChinaRC/OMCB case within China显示机器名与它的IP地址的对应 关系。 -more /etc/hostsomtsh-root-/ more /etc/hosts# # Internet host table # 127.0.0.1 localhost 192.168.3.56 omts
14、h omtsh.local loghost 192.168.3.55 ompsh #added by IUM 192.168.8.1 ATMport #added by IUM 192.168.3.57 Router #added by IUM 192.168.3.61 computer1 #added by IUM 192.168.3.60 computer2 #added by IUM1717RC/OMCB case within ChinaRC/OMCB case within China从本机登陆到其他机器 -telnetomtsh-root-/ telnet 192.168.8.56Trying 192.168.8.56.telnet: Unable