linux基本命令實踐 這哥們太強了 轉__linux

來源:互聯網
上載者:User

----------------尋找檔案方法----------------------

find . -name "project_supply_sign.xsl"

----------------ftp方法---------------------------

[root@ecapp1 shx3]# cd common

[root@ecapp1 common]# cd js

[root@ecapp1 js]# ftp 172.0.2.21

Connected to 172.0.2.21.

220 (vsFTPd 2.0.1)

530 Please login with USER and PASS.

530 Please login with USER and PASS.

KERBEROS_V4 rejected as an authentication type

Name (172.0.2.21:root): app1

331 Please specify the password.

Password:

230 Login successful.

Remote system type is UNIX.

Using binary mode to transfer files.

ftp> cd songyc

250 Directory successfully changed.

ftp> get util.js

local: util.js remote: util.js

227 Entering Passive Mode (172,0,2,21,226,163)

150 Opening BINARY mode data connection for util.js (30380 bytes).

226 File send OK.

30380 bytes received in 0.0051 seconds (5.9e+03 Kbytes/s)

ftp> quit

##################### 用jar命令打war包 ##############################################

拷貝:

[root@emed4test song_temp]# cp ../shx3.war ./

解壓:

[root@emed4test song_temp]# jar -xvf ./shx3.war       解壓到目前的目錄

刪除war:

[root@emed4test song_temp]# rm -f ./shx3.war

壓縮:

[root@emed4test song_temp]# jar -cvf ../shx3.war .

如果在被壓縮目錄下,則執行上面的命令,

如果在上一級目錄:

jar -cvf shx3.war ./被壓縮目錄

[root@emed4test root]# clear              清屏  ctrl+l

*************************************************************************

[root@emed4test root]# finger root        顯示使用者資訊

Login: root                             Name: root

Directory: /root                        Shell: /bin/bash

On since Thu Feb  9 10:29 (CST) on pts/3 from 172.25.60.118

On since Thu Feb  9 09:57 (CST) on pts/0 from 172.25.50.96

   1 hour 2 minutes idle

Mail last read Thu Dec 29 06:03 2005 (CST)

No Plan.

***************************************************************************

[root@emed4test root]# whoami   顯示目前使用者

root

[root@emed4test root]# who am i   顯示目前使用者帶日期

root     pts/3        Feb  9 10:29 (172.25.60.118)

***************************************************************************

[root@emed4test root]# date   顯示系統時間

Thu Feb  9 11:04:41 CST 2006

***************************************************************************

[root@emed4test root]# last   顯示此前使用者登入資訊

root     pts/3        172.25.60.118    Thu Feb  9 10:29   still logged in   

root     pts/0        172.25.50.96     Thu Feb  9 09:57   still logged in   

root     pts/0        172.25.83.246    Thu Feb  9 09:05 - 09:21  (00:16)    

duanxw   pts/1        172.25.60.118    Tue Feb  7 09:04 - 09:14  (00:10)

***************************************************************************

[root@emed4test root]# history|more   顯示此前執行所有命令,每屏一停

   27  kill -9 28251

   28  ps -ef|grep java

   29  mkdir logs

   30  nohup ./startWebLogic.sh &

   31  tail -f nohup.out

   32  ps -ef|grep java

   33  kill -9 28388

   34  rm -rf nohup.out

   35  nohup ./startWebLogic.sh &

   36  cd /opt/httpd2fordata/bin/

   37  ./apachectl start

   38  ./apachectl stop

***************************************************************************

[root@emed4test root]# uptime   顯示從上次重起到現在的時間

 11:09:24  up 19 days, 21:16,  2 users,  load average: 0.02, 0.05, 0.01

***************************************************************************

[root@emed4test root]# ps   顯示目前使用者正在執行的進程

  PID TTY          TIME CMD

30419 pts/3    00:00:00 bash

30457 pts/3    00:00:00 man

***************************************************************************

[root@emed4test root]# ps axu | more   顯示可控及不可控所有進程,每屏一停

USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND

root         1  0.0  0.0  1364   72 ?        S    Jan20   0:18 init

nobody   22702  0.0  0.0  4888  376 ?        S    Feb07   0:00 [httpd]

root     29101  0.0  0.0  4164    4 ?        S    Feb08   0:00 /bin/sh ./startWebLogic.sh

root     29120  0.2  8.0 810720 82504 ?      S    Feb08   3:13 /opt/j2sdk1.4.2_08/bin/java -client -Xms32m -

Xmx200m -XX:MaxPermSize=128m -Xverify:none -Dweblogic.Name=myserver -Dweblogic.ProductionModeEnabled= -Djava

.security.policy=/opt/bea/weblogic81/server/lib/weblogic.policy weblogic.Server

root     29280  0.0  0.0  4164  172 ?        S    Feb08   0:00 /bin/sh /opt/bea/projects/shx3/startWebLogic.

sh

***************************************************************************

[root@emed4test root]# top    ------持續顯示各進程系統資源使用方式-----

 11:16:21  up 19 days, 21:22,  2 users,  load average: 0.23, 0.22, 0.09

85 processes: 66 sleeping, 1 running, 0 zombie, 18 stopped

CPU0 states:   4.0% user   0.1% system    0.0% nice   0.0% iowait  95.3% idle

CPU1 states:   0.0% user   0.0% system    0.0% nice   0.0% iowait 100.0% idle

Mem:  1030284k av, 1008176k used,   22108k free,       0k shrd,  119136k buff

                    767660k actv,       0k in_d,   20896k in_c

Swap: 2040244k av,  187196k used, 1853048k free                  325008k cached

  PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME CPU COMMAND

29300 root      25   0  409M 403M 31032 S     3.9 40.0  14:04   0 java

30543 root      15   0  1184 1184   856 R     0.3  0.1   0:00   0 top

    1 root      15   0    96   72    52 S     0.0  0.0   0:18   1 init

***************************************************************************  

[root@emed4test root]# free    ----------顯示記憶體使用量情況--------------

             total       used       free     shared    buffers     cached

Mem:       1030284    1008448      21836          0     119152     325104

-/+ buffers/cache:     564192     466092

Swap:      2040244     187232    1853012

或可使用 cat/proc/meminfo 查看記憶體使用量的詳細情況

***************************************************************************

[root@emed4test root]# df -h    顯示所有檔案系統硬碟使用方式

Filesystem            Size  Used Avail Use% Mounted on

/dev/sda2              15G   12G  2.2G  85% /

/dev/sda1              99M   15M   79M  16% /boot

none                  504M     0  504M   0% /dev/shm

***************************************************************************

[root@emed4test root]# du / -bh|more       顯示每個進程中檔案的硬碟使用狀況

8.0K    /lost+found/#508086/_appsdir_shx3_war/shx3.war/META-INF

8.0K    /lost+found/#508086/_appsdir_shx3_war/shx3.war/WEB-INF/classes/net/emedchina/address/db/map

48K     /lost+found/#508086/_appsdir_shx3_war/shx3.war/WEB-INF/classes/net/emedchina/address/db

***************************************************************************

[root@emed4test root]# cat /proc/cpuinfo -------顯示伺服器各處理器的詳細參數----------

processor       : 0

vendor_id       : GenuineIntel

cpu family      : 6

model           : 8

model name      : Pentium III (Coppermine)

stepping        : 10

cpu MHz         : 999.552

cache size      : 256 KB

physical id     : 0

siblings        : 1

fdiv_bug        : no

hlt_bug         : no

f00f_bug        : no

coma_bug        : no

fpu             : yes

fpu_exception   : yes

cpuid level     : 2

wp              : yes

flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse

bogomips        : 1992.29

processor       : 1

vendor_id       : GenuineIntel

cpu family      : 6

model           : 8

model name      : Pentium III (Coppermine)

stepping        : 10

cpu MHz         : 999.552

cache size      : 256 KB

physical id     : 0

siblings        : 1

fdiv_bug        : no

hlt_bug         : no

f00f_bug        : no

coma_bug        : no

fpu             : yes

fpu_exception   : yes

cpuid level     : 2

wp              : yes

flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse

bogomips        : 1998.84

***************************************************************************

[root@emed4test root]# cat /proc/interrupts 顯示當前伺服器的所有中斷

           CPU0       CPU1       

  0:   90130655   82403120    IO-APIC-edge  timer

  1:          5          7    IO-APIC-edge  keyboard

  2:          0          0          XT-PIC  cascade

  8:  &nbs

聯繫我們

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

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

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.