天天看點

linux常用指令總結 ---不定時更新

一 軟體安裝篇

1.rpm

rpm -ivh xxxxxxxx

2.*.tar.gz

# 1: Uncompress tarball

To uncompress them, execute the following command(s) depending on the extension:

$ tar zxf file.tar.gz

$ tar zxf file.tgz

$ tar jxf file.tar.bz2

$ tar jxf file.tbz2

Now change directory

$ ls

$ cd path-to-software/

# 2: Build and install software

Generally you need to type 3 commands as follows for building and compiling software:

# ./configure

# make

# make install

Where

    * ./configure will configure the software to ensure your system has the necessary functionality and libraries to successfully compile the package

    * make will compile all the source files into executable binaries.

    * Finally, make install will install the binaries and any supporting files into the appropriate locations.

# 3: Read INSTALL / README file

Each tarball comes with installation and build instructions. Open INSTALL or README file for more information:

$ vi INSTALL

二 系統篇

1.系統關機

# shutdown -k 2 Attention:System will shutdown soon!  //帶參數k系統不會實際關機

# shutdown 2 Attention:System will shutdown soon!     //2分鐘後實際執行shutdown指令

最快速關機指令     # shutdown -h now

定時關機指令

# shutdown 9:30

# shutdown +5

# shutdown now

取消關機指令,則隻要按Ctrl+C鍵即可

2.系統重新開機

定時重新開機指令

# shutdown -r 9:30

# shutdown -r +5

# shutdown -r now

另外還有其他3個指令  1.halt  2.poweroff  3.reboot

注意:在實際執行關機前,最好先執行sync指令,因為它可以将記憶體緩沖區内的資料寫回硬碟,以避免正在通路的資料丢失,最後執行shutdown指令。

繼續閱讀