get started

命令

Windows Command

*nix Shell

File
Commands

List Directory

dir

ls

Make Directory

mkdir

mkdir

Change Directory

cdchdir

cd

Copy Directory

xcopy

cp -r

Remove Directory

rmdirrd

rmdirrm -r

File Tree

tree

ls -R

Create or Update File

echo “” > filename (use IO redirect)

touch

Delete(Remove) File

delerase

rm

Copy File

copy

cp

Make Link

mklink

ln

Move(Rename) File

moverenrename

mvrename

Compare File

comp
fc /b(byte)

fc /l(ASCII letter)

fc /u(Unicode letter)

diff(line by line)
comm(sorted line by line)
cmp(byte by byte)

File Attribute

attrib(Attribute)

caclsicacls(ACL)

chmod(Change Mode)

chown(Change Owner)

chgrp(Change Group)

Match String

find
findstr

grep
sed
awk

Sort Text File

sort

sort

I/O

Output File

type

cat

More Display

more

moreless

Clear Screen

cls

clear

Output

echo

echo

Redirect

> Output>> Output(append)< Input<<Input(append)

System

Date and Time

datetime

date

Location of App

where

whichwhereis

Help Manual

help

helpinfoman

Variable

set

set
export(Environment)

Host Name

hostname

hostname

Shutdown

shutdown

/s
/h
/r

shutdown
halt
 poweroff
reboot

Service
Manage

Service Controller

sc(CLI)
services.msc(GUI)

service(script in /etc/init.d)
systemctl(since rhel7)

Service Status

sc query <service>

sc queryex <service>

service <service> status

Start Service

net start <service>

sc start <service>

service <service> start

systemctl start <service>

Stop Service

net stop <service>

sc stop <service>

service <service> stop

service stop <service>

Service Status

sc query <service>

sc queryex <service>

service <service> status

Pause Service

net pause <service>

sc pause <service>

Don’t Have

Continue Service

net continue <service>
sc continue <service>

Create Service

sc create <service>

Delete Service

sc delete <service>

Config Service

sc qc <service> (query configuration)

sc config <service>

chkconfig
systemctl

User
Manage

Add User

net user <username> [password] /add

useradd <username>

Delete User

net user <username> /delete

userdel <username>

Add Group

net group <groupname> /add
net localgroup <groupname> /add

groupadd

Delete Group

net group <groupname> /delete
net localgroup <groupname> /delete

groupdel

Set Password

net user <username> [password]

passwd

Query Users

query user

quser

query session

qwinsta

whow

Current User

whoami
echo %username%

whoami

Log Off

logoff

 

Send Message to Others

msg

write

Process
and
Task

Process Info

tasklist

query process

qprocess

ps(process snapshot)
top(real-time info)
jobs(jobs status)

Kill Process

taskkilltskill

kill

Schedule Task

atschtasks

atcrontab

Start Task(Job)

start

fg(foreground)
 bg(background)or &
(fg, bg work with jobs)

Network

PING

ping

ping

Trace Route

pathpingtracert

traceroute

Network Interface

ipconfig

ifconfig

Route Table

route

route

DNS

nslookup

nslookup

Net Statistics

netstat

netstat

ARP Table

arp

arp

FTP Client

ftp

ftp

TFTP

tftp

tftp

Telnet

telnet

telnet

Login Client

mstsc

ssh