Home
GNU Emacs
編 輯 器
Emacs / XEmacs Quick Reference 速 成 表
Linux Command
企 鵝 指 令
Filesystem
檔 案 系 統
Restart
重 新 啟 動
Kernel Compilation
編 譯 系 統 核 心
網 路 小 品
企 鵝 巧 手
Linux Link
企 鵝 網 址
自 言 自 語

Linux Command 企 鵝 指 令

Most of the following command also work on Unix.

其實以下的指令大部份都可在 Unix 上運作。


Account Management 帳號管理

Command
指令
Description, Syntax & Example
解說、語法及例子
adduser

Create user account
新增使用者帳號

adduser newuser

groupadd

Create user group
新增群組

groupadd newgroup

groupdel

Delete user group
刪除群組

group existgroup

passwd

Change password
修改密碼

su

Enable a user to temporarily become another user. Default user is root.
臨時登入成另一使用者,預設值是 root

useradd

Create user account
新增使用者帳號

useradd newuser

userdel

Delete user account
刪除使用者帳號

userdel existuser

whoami

Who am I
檢視自己的 Login Name

Return 返回

Background Jobs 背景作業

Command
指令
Description, Syntax & Example
解說、語法及例子
%

job number

&

execute the command background

bg

place the job from suspend to background

CTRL-z

interrupt a job and stop it (suspended)

fg [%n]

bring the specified job number from background to foreground

jobs

list the jobs being run in background

kill [%n]

kill the specified job number

ps

list all currently running process include background job

Return 返回

Basic Operation 基本操作

Command
指令
Description, Syntax & Example
解說、語法及例子
cd

Stands for "change directory". Changes the current working directory. If no directory is specified, then the user is returned to their home directory
切換當前目錄

cd

move to home directory

cd ~

move to home directory

cd ..

move one directory up

cd dirname

change to a specific directory dirname

clear

Clear terminal screen
清除螢幕

dir

same as "ls" without options

ls

Display Information about files and directories
列出檔案清單

ls

display information in short format

ls -l

display information in long format

ls -a

display information for every file including hidden file in a directory

man

Display online help
顯示線上說明文件

man command

pwd

Report current directory
顯示目前的工作目錄

Return 返回

Compress & Decompress 壓縮及解壓

Command
指令
Description, Syntax & Example
解說、語法及例子
tar

parameter 參數

-x

expand the .tar file
解開 tar 檔案

-c

create the tar file
打包成 tar 檔案

-z

compress to / decompress from tar file
壓縮 / 解壓

-v

display the output onscreen
顯示運作過程資訊

-f

specify subdirectory and filename
指定子目錄與檔案

tar zxvf tarfile.tar.gz
Decompress the compressed tar file to specify subdirectory and filename, display the output onscreen.
* The first step to install application.

tar zcvf tarfile.tar.gz SubD/
Create a compress file, "SubD/" is the subdirectory to be compressed.
* Useful to backup data such as user account etc...

tar ztf tarfile.tar.gz
view the content of tarfile.tar.gz
檢視壓縮檔案內容

zip

Compress Files
壓縮檔案

zip myfiles *.txt

unzip

Decompress Files
解壓檔案

unzip myfiles

Return 返回

Files Management 檔案管理

Command
指令
Description, Syntax & Example
解說、語法及例子
cat

Concatenates files
連接檔案

cat appendfile >> originalfile

chmod

Change the permissions mode of file or directory
改變檔案與目錄存取權限

chmod 755 dirname
chmod ug+rx dirname

cp

Copy files
複製檔案

cp from-filename to-filename

du

Displays the amount of space being used by the specified directories or files
查看目前目錄所佔的硬碟空間

less

Similar to more but allows backward movement
向上下翻頁顯示檔案(全螢幕)

less filename
ps | less

ln

Creates a symbolic link to a files
建立目標檔案連結

ln -s originalfile linkfile

mkdir

Create new directories
建立目錄

mkdir newdirectory

more

Display file contents in full screen and page by page
向下翻頁顯示檔案(全螢幕)

more filename
ps | more

mv

Move files
搬移檔案

mv filename targetdirectory

rm

Delete files
刪除檔案

rm filename

 

rm -r dirname

delete directory and files recursively

rmdir

Delete empty directories
刪除空目錄

rmdir emptydirectory

Return 返回

Filters 過濾器

Command
指令
Description, Syntax & Example
解說、語法及例子
grep

Looks for patterns found in files and reports when these patterns are found
搜尋字串

ps aux | grep "sendmail"

sort

Sort and merge text files
排序

sort <unsort.txt >sorted.txt

tr

Translates or maps characters in a file from one form to another

tr -d \015\032 <dosfile >linuxfile
tr abc zyx

Return 返回

Login & Logout 登入及登出

Command
指令
Description, Syntax & Example
解說、語法及例子
login

login
登入

[ctrl]+d

logout and return to login screen
登出及返回登入畫面

logout

logout and return to login screen
登出及返回登入畫面

exit

logout and return to login screen
登出及返回登入畫面

su <user>

login to another user login session, default user is "root"
登入為另一用戶

rlogin

Remote Login
遠端登入

Return 返回

Modules 模組

Command
指令
Description, Syntax & Example
解說、語法及例子
depmod

Handle dependency description for loadable kernel Modules
處理模組間的依賴性。

modprob

High level handling of loadable Modules
優化模組 - 裝上指定的模組及另一些沒有指定,但必須用到的模組。

insmod

Install loadable kernel Module
裝上指定的模組。

lsmod

List Loaded Modules
列出所有裝上的模組。

rmmod

Unload loadable Module
清除已裝上的指定模組。

lspci

List all PCI devices include Mother Board Chipset
列出所有主機板上晶片組及 PCI 介面

Return 返回

Networking 網路工具

Command
指令
Description, Syntax & Example
解說、語法及例子
finger

Displays information about users on the system
顯示使用者資料

finger  
finger username  
ifconfig

Monitor and change the state of network interfaces
查閱與設定網路介面

ifdown

Disconnect ppp connection
解除 ppp 連線

ifdown ppp0

ifup

Connect ppp connection
接駁 ppp 連線

ifup ppp0

netstat

displays the status of network connections on TCP, UDP, RAW or UNIX sockets to the system
觀察主機與其他電腦之間的連線狀況,封包傳輸等資料

nslookup

Queries the DNS to return information about specific hosts and networks
向 DNS 查詢主機與網路資訊

ping

Requests packet echos from network hosts
測試網路連接狀況

telnet

To access remote computers
操作遠端電腦

Return 返回

Setup 設定工具

Command
指令
Description, Syntax & Example
解說、語法及例子
kbdconfig

Keyboard Configuration
鍵盤設定程式

linuxconf

Linux Configuration, text mode and X-Win mode.
Linux 設定程式

mouseconfig

Mouse Configuration
滑鼠設定程式

netcfg

Red Hat Linux network configuration tool, X-Win mode only.
紅帽子 Linux 網路設定工具

netconf

Network Configuration, text mode and X-Win mode.
網路設定程式

ntsysv

System Service
設定系統啟動時的執行程式

setup

Setup Menu
設定功能表

sndconfig

Soundcard Configuration
音效咭設定程式

timeconfig

Timezone Configuration
時區設定程式

Xconfigurator

X Window Configuration.
X Win 設定程式

xf86config

Traditional X Window Configuration
傳統的 X Win 設定程式

XF86Setup

XFree GUI X Window Configuration
XFree 圖形介面 X Win 設定程式

Return 返回

System Management 系統管理

Command
指令
Description, Syntax & Example
解說、語法及例子
df

Reports the amount of free disk space on any currently mounted filesystem
顯示目前硬碟所剩空間

mount

attach the device to the filesystem
掛上週邊設備

mount /dev/hdc /mnt/cdrom

mount the secondary master IDE CDROM to directory /mnt/cdrom

mount /dev/fd0 /mnt/floppy

mount the floppy disk A to directory /mnt/floppy

mount /mnt/cdrom

mount the CDROM to directory /mnt/cdrom

mount /mnt/floppy

mount the floppy disk to directory /mnt/floppy

mount

display the mounted device information

umount

detach the device from the filesystem
掛下週邊設備

umount /mnt/cdrom
umount /mnt/floppy

Return 返回

System Shutdown & Restart 系統關閉及重新啟動

Command
指令
Description, Syntax & Example
解說、語法及例子
reboot

Reboot the system now
立即重新啟動系統

init 6

Reboot the system now
立即重新啟動系統

[ctrl]+[alt]+[del]

Reboot the system now
立即重新啟動系統

halt

Halt the system now
立即關閉系統

shutdown

Shutdown the System
關閉系統

parameter 參數

-r

Reboot the system when the shutdown is complete.

-h

Halt the system when the shutdown is complete.

 

shutdown -r now

Reboot the system now

shutdown -h now

Halt the system from now

shutdown -r +15

Reboot the system after 15 minutes from now

shutdown -h +15

Halt the system after 15 minutes from now

shutdown -r 23:00

Reboot the system on 11 p.m.

shutdown -h 23:00

Halt the system on 11 p.m.

Return 返回
本 頁 最 後 更 新 日 期 :2002年02月20日