天天看點

Dos和Linux常用指令對比

指令描述

ms-dos

linux

linux example

複制檔案

copy

cp

cp this.ext that.txt

移動檔案

move

mv

mv this.txt dir/

列出檔案

dir

ls

ls -l

清除螢幕

cls

clear

關閉指令視窗

exit

顯示或設定日期

date

删除檔案

del

rm

rm this.txt

輸出到控制台

echo

echo this message

使用簡單文本

編輯器編輯檔案

edit

pico

pico this.txt

比較檔案内容

fc

diff

diff file1 file2

在檔案中查找字元串

find

grep

grep “this word or phrase” this.txt

顯示指令幫助

command /?

man/info

man/info command

建立目錄

mkdir

mkdir directory

檢視檔案内容

more

more/less

more/less this.txt

重命名檔案

ren

mv this.txt that.txt

顯示目前檔案目錄

chdir

pwd

<code>echo $pwd</code>

用相對路徑改變目錄

cd pathname

cd /path/to/place/

用絕對路徑改變目錄

cd..

cd ../path/

顯示或設定時間

time

顯示網絡統計資訊

netstat

netstat -nat

顯示網絡設定

ipconfig

ifconfig

ifconfig eth0

打開/關閉系統服務

net start/stop service

services name start/stop

services sshd restart

dns查詢

nslookup

host

host -a baidu.com

ping主機

ping

ping -c5 baidu.com

跟蹤到指定主機的路徑

tracert

traceroute

traceroute baidu.com

繼續閱讀