AIX作業系統基本命令

來源:互聯網
上載者:User
login: 輸入使用者名稱(例如:user01)password: 輸入使用者口令若使用者名稱及口令均正確,則使用者將登陸成功。此時系統會出現命令提示字元$或#,即表示可接收使用者輸入的作業系統命令。退出系統:或 exit或logout。例:#(or$)exit#(or$)Ctrl^D注,#為ROOT使用者的命令提示字元,$為一般使用者password命令用於建立或修改使用者的密碼。如:#password passwd: —輸入舊口令new passwd: —輸入新口令re-enter new paswd: —重新輸入新口令mkdir:用於建立目錄$ mkdir oracle$ lsoracle$rm:用於刪除檔案或目錄(rm –r 刪除目錄時目錄內有內容,用-r一起刪除)$ rm -r oracle$ ls$mv:用於改變檔案或目錄名$ mkdir ll$ lsll$ mkdir kk$ lskk ll$ mv ll kk$ lskk$ cd kk$ lsll$cd:用於進入系統某一級目錄中去$ cd /$ pwd/$ cd /home/oracle$ pwd/home/oracle$功能:顯示目錄中的內容,列出目前的目錄中所有檔案的檔案名稱參數說明:a:列出目錄中所有檔案d:列出所有子目錄l:列出長格式檔案資訊舉例:ls –a:列出目前的目錄中的所有檔案$ ls -a#UNTITLED# .dt createdbscripts oracle. .dtprofile dead_letter smit.log.. .profile ll smit.script.TTauthority .sh_history make.log websm.log.Xauthority afiedt.buf mbox websm.script$ls –l:顯示檔案的詳細資料$ ls -ltotal 295-rw-r--r-- 1 201 dba 3 Sep 01 15:24 #UNTITLED#-rw-r--r-- 1 201 dba 51 Jul 08 18:18 afiedt.bufdrwxrwxr-x 2 201 dba 512 May 08 11:49 createdbscriptsdrwx------ 2 201 dba 512 Jun 19 09:27 dead_letterdrwxr-xr-x 2 201 dba 512 Sep 22 10:17 ll-rw-r--r-- 1 201 dba 95987 Apr 18 14:51 make.log-rw------- 1 201 dba 11174 Sep 17 09:15 mboxdrwxr-xr-x 3 201 dba 512 Sep 22 10:21 oracle-rw-r--r-- 1 201 dba 8971 Sep 20 11:08 smit.log-rw-r--r-- 1 201 dba 5437 Sep 20 11:08 smit.script-rw-r--r-- 1 201 system 1682 Sep 02 15:18 websm.log-rw-r--r-- 1 201 system 21441 Sep 02 15:10 websm.script$顯示當前登陸到系統中的使用者的資訊舉例:# fingerLogin Name TTY Idle When Site Infooracle ??? *l0 2:02 Mon 09:05oracle ??? p4 1:59 Mon 09:05root ??? p0 Mon 11:06# finger oracleLogin name: oracleDirectory: /usr/oracle/ora90 Shell: /usr/bin/kshOn since Sep 22 09:05:35 on lft0, 2 hours 2 minutes Idle Time (messages off)On since Sep 22 09:05:41 on pts/4, 1 hour 59 minutes Idle Time from :0.0No Plan.#功能:顯示後台進程的有關資訊。單獨使用ps將顯示由當前終端啟動的後台進程的PID、終端號、進程已執行時間以及啟動該進程的命令文法:ps -options 參數說明: -e:顯示系統內當前啟動並執行所有後台進程 -f:除ps所提供的資訊外,還顯示使用者名稱、PPID(父進程ID)及啟動時間 -l:除ps所提供的資訊外,還顯示 User ID, PPID 和進程優先順序例:# ps PID TTY TIME CMD 803034 pts/0 0:00 -ksh 917524 pts/0 0:00 ps# ps -ef UID PID PPID C STIME TTY TIME CMD root 1 0 0 09:03:04 - 0:00 /etc/init root 90262 1 0 09:03:42 - 0:00 /usr/ccs/bin/shlap64 root 106572 139368 0 09:03:30 - 0:01 /usr/lpp/X11/bin/X -D /usr oracle 123030 155720 0 09:05:36 - 0:00 dtwm root 139368 1 0 09:03:29 - 0:00 /usr/dt/bin/dtlogin -daemo oracle 155720 172088 0 09:05:35 - 0:00 /usr/dt/bin/dtsession root 163946 245824 0 09:04:28 - 0:00 /usr/sbin/rsct/bin/rmcd -r root 172088 139368 0 09:03:30 - 0:00 dtlogin <:0> -daemo oracle 180378 188526 0 09:06:20 pts/4 0:00 -ksh root 188526 483470 0 09:06:10 pts/4 0:00 -ksh root 196670 303186 0 09:04:34 - 0:00 rpc.ttdbserver 100083 1 root 204866 245824 0 09:04:34 - 0:00 /usr/sbin/rsct/bin/IBM.Aud oracle 221370 581780 0 09:05:41 - 0:03 /usr/dt/bin/dtterm root 229440 1 0 09:03:41 - 0:01 /usr/sbin/syncd 60 root 237626 1 0 09:03:42 - 0:00 /usr/lib/errdemon root 245824 1 0 09:03:47 - 0:00 /usr/sbin/srcmstr root 262240 245824 0 09:03:50 - 0:00 /usr/sbin/syslogd root 278642 245824 0 09:04:28 - 0:00 /usr/sbin/rsct/bin/ctcasd root 286806 245824 0 09:04:30 - 0:00 /usr/sbin/rsct/bin/IBM.CSM oracle 295050 1 0 09:07:03 - 0:00 ora_dbw0_ORCL root 303186 245824 0 09:03:59 - 0:00 /usr/sbin/inetd root 311380 245824 0 09:03:53 - 0:00 sendmail: accepting connec root 319566 245824 0 09:03:56 - 0:00 /usr/sbin/portmap root 327760 245824 0 09:04:02 - 0:00 /usr/sbin/snmpd root 335954 245824 0 09:04:06 - 0:00 /usr/sbin/dpid2 root 344150 245824 0 09:04:09 - 0:00 /usr/sbin/hostmibd oracle 368788 1 0 11:09:35 - 0:00 oracleORCL (LOCAL=NO) root 376946 1 0 09:04:18 - 0:00 /usr/sbin/cron root 385122 245824 0 09:04:12 - 0:00 /usr/sbin/biod 6 oracle 393320 1 0 09:07:03 - 0:00 ora_reco_ORCL daemon 401510 245824 0 09:04:15 - 0:00 /usr/sbin/rpc.statd root 409726 1 0 09:04:28 - 0:00 /usr/bin/itesmdem itesrv.i root 417902 245824 0 09:04:18 - 0:00 /usr/sbin/rpc.lockd root 434288 1 0 09:04:25 - 0:00 /usr/sbin/uprintfd root 442484 245824 0 09:04:25 - 0:00 /usr/sbin/writesrv root 450676 245824 0 09:04:22 - 0:00 /usr/sbin/qdaemon root 458874 245824 0 09:04:31 - 0:00 /usr/sbin/rsct/bin/IBM.Ser oracle 475266 1 0 09:05:35 - 0:00 /usr/dt/bin/ttsession -s oracle 483470 221370 0 09:05:41 pts/4 0:00 /usr/bin/ksh oracle 491646 1 0 09:07:02 - 0:00 ora_pmon_ORCL oracle 499860 1 0 09:07:33 pts/4 0:08 /usr/oracle/ora90/bin/tnsl oracle 524452 1 0 09:07:03 - 0:01 ora_ckpt_ORCL root 532612 1 0 09:04:25 lft0 0:00 /usr/sbin/getty /dev/conso root 540830 245824 0 09:04:32 - 0:00 /usr/sbin/rsct/bin/IBM.ERr imnadm 557194 1 0 09:04:25 - 0:00 /usr/IMNSearch/httpdlite/h root 565388 1 0 09:04:25 - 0:00 /usr/lpp/diagnostics/bin/d oracle 573584 1 0 09:07:03 - 0:01 ora_smon_ORCL oracle 581780 123030 0 09:05:41 - 0:00 /usr/dt/bin/dtexec -open 0 oracle 589978 1 0 09:07:03 - 0:00 ora_lgwr_ORCL oracle 598188 1 0 09:17:14 - 0:00 oracleORCL (LOCAL=NO) oracle 606440 1 0 11:09:28 - 0:00 oracleORCL (LOCAL=NO) oracle 622592 1 0 11:09:49 - 0:00 oracleORCL (LOCAL=NO) oracle 631032 1 0 11:09:34 - 0:00 oracleORCL (LOCAL=NO) oracle 638984 1 0 11:09:47 - 0:00 oracleORCL (LOCAL=NO) oracle 647404 1 0 10:58:31 - 0:01 oracleORCL (LOCAL=NO) oracle 655384 1 0 10:46:10 - 0:00 oracleORCL (LOCAL=NO) oracle 663756 1 0 11:09:38 - 0:00 oracleORCL (LOCAL=NO) oracle 671964 1 0 10:57:32 - 0:00 oracleORCL (LOCAL=NO) oracle 679998 1 0 11:09:32 - 0:00 oracleORCL (LOCAL=NO) oracle 688340 1 0 11:01:09 - 0:00 oracleORCL (LOCAL=NO) oracle 696500 1 0 11:09:32 - 0:00 oracleORCL (LOCAL=NO) oracle 704756 1 0 11:09:32 - 0:00 oracleORCL (LOCAL=NO) oracle 712916 1 0 09:31:17 - 0:00 oracleORCL (LOCAL=NO) oracle 721104 1 0 09:33:58 - 0:00 oracleORCL (LOCAL=NO) root 729308 803034 4 11:09:56 pts/0 0:00 ps -ef oracle 737532 1 0 11:07:43 - 0:00 oracleORCL (LOCAL=NO) oracle 753856 1 0 09:34:03 - 0:00 oracleORCL (LOCAL=NO) oracle 762104 1 1 11:09:53 - 0:00 oracleORCL (LOCAL=NO) oracle 770280 1 0 11:09:46 - 0:00 oracleORCL (LOCAL=NO) oracle 778466 1 0 11:04:42 - 0:00 oracleORCL (LOCAL=NO) oracle 786634 1 0 11:09:50 - 0:00 oracleORCL (LOCAL=NO) oracle 794656 1 0 11:08:10 - 0:00 oracleORCL (LOCAL=NO) root 803034 1056846 0 11:06:38 pts/0 0:00 -ksh oracle 811034 1 0 10:59:20 - 0:00 oracleORCL (LOCAL=NO) oracle 819402 1 0 09:47:03 - 0:00 oracleORCL (LOCAL=NO) oracle 827620 1 0 10:10:40 - 0:00 oracleORCL (LOCAL=NO) oracle 835810 1 0 10:57:30 - 0:00 oracleORCL (LOCAL=NO) oracle 843988 1 0 09:49:16 - 0:00 oracleORCL (LOCAL=NO) oracle 852190 1 0 10:52:22 - 0:00 oracleORCL (LOCAL=NO) oracle 860378 1 0 09:33:55 - 0:00 oracleORCL (LOCAL=NO) oracle 868586 1 0 10:52:21 - 0:00 oracleORCL (LOCAL=NO) oracle 876796 1 0 11:09:29 - 0:00 oracleORCL (LOCAL=NO) oracle 884784 1 0 10:59:22 - 0:00 oracleORCL (LOCAL=NO) oracle 893164 1 0 10:42:26 - 0:00 oracleORCL (LOCAL=NO) oracle 909556 1 0 11:09:49 - 0:00 oracleORCL (LOCAL=NO) oracle 917528 1 1 11:09:53 - 0:00 oracleORCL (LOCAL=NO) oracle 925948 1 0 11:09:47 - 0:00 oracleORCL (LOCAL=NO) oracle 942326 1 0 11:07:47 - 0:00 oracleORCL (LOCAL=NO) oracle 950360 1 0 11:07:35 - 0:00 oracleORCL (LOCAL=NO) oracle 958486 1 0 11:09:39 - 0:00 oracleORCL (LOCAL=NO) oracle 974934 1 0 11:07:23 - 0:00 oracleORCL (LOCAL=NO) oracle 983294 1 0 10:48:40 - 0:00 oracleORCL (LOCAL=NO) oracle 999438 1 0 10:58:51 - 0:00 oracleORCL (LOCAL=NO) oracle 1007638 1 0 10:52:27 - 0:00 oracleORCL (LOCAL=NO) oracle 1015834 1 0 11:08:09 - 0:00 oracleORCL (LOCAL=NO) oracle 1024012 1 0 09:45:28 - 0:00 oracleORCL (LOCAL=NO) oracle 1032230 155720 0 11:08:33 - 0:00 /usr/dt/bin/dtexec -open 0 oracle 1040390 1 0 10:58:52 - 0:00 oracleORCL (LOCAL=NO) root 1056846 303186 0 11:06:38 - 0:00 telnetd -a oracle 1064970 1 0 10:05:40 - 0:00 oracleORCL (LOCAL=NO) oracle 1081404 1 0 11:09:31 - 0:00 oracleORCL (LOCAL=NO) oracle 1089562 1 0 11:09:32 - 0:00 oracleORCL (LOCAL=NO) oracle 1097770 1 1 11:09:53 - 0:00 oracleORCL (LOCAL=NO) oracle 1105962 1 0 11:09:32 - 0:00 oracleORCL (LOCAL=NO) oracle 1114198 1 0 11:07:47 - 0:00 oracleORCL (LOCAL=NO) oracle 1122406 1 0 11:07:00 - 0:00 oracleORCL (LOCAL=NO) oracle 1130564 1 0 10:27:48 - 0:00 oracleORCL (LOCAL=NO) oracle 1138778 1 0 10:57:28 - 0:00 oracleORCL (LOCAL=NO) oracle 1146948 1 0 11:07:26 - 0:00 oracleORCL (LOCAL=NO) oracle 1155106 1032230 0 11:08:33 - 0:00 /usr/dt/bin/dtscreen oracle 1163312 1 0 11:09:39 - 0:00 oracleORCL (LOCAL=NO) oracle 1171526 1 0 11:00:39 - 0:01 oracleORCL (LOCAL=NO) oracle 1179700 1 0 10:53:31 - 0:00 oracleORCL (LOCAL=NO) oracle 1196136 1 0 11:09:32 - 0:00 oracleORCL (LOCAL=NO) oracle 1204300 1 0 10:58:52 - 0:00 oracleORCL (LOCAL=NO) oracle 1212516 1 0 10:54:08 - 0:00 oracleORCL (LOCAL=NO) oracle 1220718 1 0 10:42:22 - 0:00 oracleORCL (LOCAL=NO) oracle 1237084 1 0 10:42:20 - 0:00 oracleORCL (LOCAL=NO) oracle 1245250 1 0 11:09:33 - 0:00 oracleORCL (LOCAL=NO) oracle 1253470 1 0 11:08:09 - 0:00 oracleORCL (LOCAL=NO) oracle 1261658 1 0 11:09:32 - 0:00 oracleORCL (LOCAL=NO) oracle 1269822 1 0 10:28:05 - 0:10 oracleORCL (LOCAL=NO) oracle 1294398 1 0 10:46:13 - 0:00 oracleORCL (LOCAL=NO) oracle 1302590 1 0 10:46:08 - 0:00 oracleORCL (LOCAL=NO) oracle 1310814 1 0 11:09:34 - 0:00 oracleORCL (LOCAL=NO) oracle 1318996 1 0 11:04:45 - 0:00 oracleORCL (LOCAL=NO) oracle 1335400 1 0 11:09:47 - 0:00 oracleORCL (LOCAL=NO) oracle 1343576 1 0 11:09:39 - 0:00 oracleORCL (LOCAL=NO) oracle 1351830 1 0 11:09:31 - 0:00 oracleORCL (LOCAL=NO) oracle 1368176 1 0 11:09:32 - 0:00 oracleORCL (LOCAL=NO)## ps -l F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD 240001 A 0 803034 1056846 1 60 20 20009284 952 pts/0 0:00 ksh 200001 A 0 1114200 803034 1 60 20 2003549a 488 pts/0 0:00 ps#功能:殺死後台進程文法:kill -num PID舉例: kill –9 23094 (-9 是軟體終止進程的訊號,是不可忽略的)功能:在一個或多個目錄中尋找符合指定條件的檔案,顯示檔案名稱或對這些檔案進行特定的操作文法:find path expression參數說明: -typef檔案 d目錄 -size+n檔案大小超過n blocks(1block=512 bytes) -n檔案大小小於n blocks n檔案大小等於n blocks -mtime+xX天以前被修改的檔案 -xX天以內被修改的檔案 -permonum訪問指定許可權的檔案(許可權以8進位表示) mode訪問指定許可權的檔案(許可權以字母表示,如rwx) -userUser屬於使用者user的檔案 -o邏輯‘或’ 舉例:find . –name ‘unix’ –print 在目前的目錄及其子目錄中尋找檔案名稱為“m*”的所有檔案(‘*’是萬用字元)並顯示檔案名稱。# find . -name "unix" -print./usr/lib/boot/unix./usr/oracle/ora90/inventory/filemap/md/demo/unix./usr/oracle/ora90/inventory/filemap/ultrasearch/tools/remotecrawler/scripts/unix./usr/oracle/ora90/md/demo/unix./usr/oracle/ora90/ultrasearch/tools/remotecrawler/scripts/unix./upload/Disk2/stage/Components/oracle.sysman.website.nls/9.2.0.1.0/1/DataFiles/Expanded/websitehtm/unix./unix#find . –name ‘m*’ –exec ls –l {} \;在目前的目錄及其子目錄中尋找檔案名稱為“m*”的所有檔案(‘*’是萬用字元)並顯示詳細的檔案清單資訊。-exec 使得find以非互動的方式執行-exec後的命令。‘{}’用於保留find的尋找結果,並將其作為ls –l 的輸入。find . –name ‘m*’ –ok  rm {} \;在目前的目錄及其子目錄中尋找檔案名稱為“m*”的所有檔案(‘*’是萬用字元)刪除之。-ok 使得find以互動的方式執行-ok後的命令。find . -perm 644 -mtime +4 –print在目前的目錄及其子目錄中尋找許可權為644、4天以前被修改過的檔案。功能:在檔案或標準輸入中搜尋與指定格式相匹配的行文法:grep [options] pattern [file1 file 2..] 參數說明:-v:顯示與指定格式不匹配的行 -c:統計滿足條件的行數 -l:只顯示滿足匹配條件的檔案名稱-n:顯示滿足條件的行所在的行號-I:尋找時忽略大小寫-w:做全單詞匹配舉例:grep a websm.log 搜尋.profile檔案中與mail匹配的行並顯示。# grep a websm.logcom.ibm.websm.preferences.WXPreferenceException: Unable to load preferences from /WebSM.pref.Default settings will be used. This preference file will be updatedif the Check Button in the Exit Confirmation Dialog is checked. at com.ibm.websm.preferences.WSPreferenceImpl.loadData(WSPreferenceImpl.java:185) at com.ibm.websm.preferences.WCPreferences.LoadData(WCPreferences.java:194) at com.ibm.websm.preferences.WCPreferences.(WCPreferences.java:111) at com.ibm.websm.console.WConsole.getPreferences(WConsole.java:592) at com.ibm.websm.console.WConsole.getPrefData(WConsole.java:559) at com.ibm.websm.console.WConsole.(WConsole.java:119) at com.ibm.websm.console.WConsole.main(WConsole.java:1294) com.ibm.websm.bridge.directory.WDirectoryException: Caught EOFException whilereading the stream header at com.ibm.websm.bridge.directory.WDirectory.get(WDirectory.java:128) at com.ibm.websm.preferences.WSPreferenceImpl.loadData(WSPreferenceImpl.java:178) at com.ibm.websm.preferences.WCPreferences.LoadData(WCPreferences.java:194) at com.ibm.websm.preferences.WCPreferences.(WCPreferences.java:111) at com.ibm.websm.console.WConsole.getPreferences(WConsole.java:592) at com.ibm.websm.console.WConsole.getPrefData(WConsole.java:559) at com.ibm.websm.console.WConsole.(WConsole.java:119) at com.ibm.websm.console.WConsole.main(WConsole.java:1294)#grep –v mail .profile 顯示與mail不匹配的行。grep “^a[0-9]z$” filename在filename中尋找以’a’開頭、以’z’結尾、中間包含數字’0’-‘9’的串。

相關文章

Beyond APAC's No.1 Cloud

19.6% IaaS Market Share in Asia Pacific - Gartner IT Service report, 2018

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。