cmd

SS64 cmd/ ps reference

https://ss64.com/

CMD

ARP – Address Resolution Protocol. View the contents of the local ARP cache table

arp -a

TRACERT
Trace Route – Find the IP address of any remote host. TRACERT is useful for troubleshooting large networks where several paths can be taken to arrive at the same point, or where many intermediate systems (routers or bridges) are involved.

tracert www.ba.no

Lookup IP addresses on a NameServer.

nslookup www.ba.no

Route, Manipulate network routing tables. Route packets of network traffic from one subnet to another by modifying the route table.

IP networks use routing tables to direct packets from one subnet to another. The Windows Route utility allows you to view the device’s routing tables. To do so, simply type Route Print.

The cool thing about the Route command is that it not only shows you the routing table, it lets you make changes. Commands such as Route Add, Route Delete, and Route Change allow you to make routing table modifications on an as needed basis. The changes that you make can be persistent or nonpersistent, depending on whether you use the -P switch (Create a persistent route – survives system reboots.)

route print

PATHPING
Trace route and provide network latency and packet loss for each router and link in the path. Combines the functionality of PING and TRACERT.

pathping www.ba.no

PATH
Display or set a search path for executable files at the command line.

Changes made using the PATH command are NOT permanent, they apply to the current CMD prompt only and remain only until the CMD window is closed.

To permanently change the PATH use

Control Panel, System, Environment, System Variables
Control Panel, System, Environment, User Variables

path

FIND
Search for a text string in a file & display all the lines where it is found.

find ” string” path

/V Display all lines NOT containing the specified string.
/C Count the number of lines containing the string.
/N Display Line numbers.
/I Ignore the case of characters when searching for the string.

FC
Compare the contents of two files or sets of files. Display any lines which do NOT match.

fc file1 file2

When FC is used for an ASCII comparison (default), it will display differences between two files in the following order:

Name of the first file
Lines from filename1 that differ between the files
First line to match in both files
Name of the second file
Lines from filename2 that differ
First line to match

ROBOCOPY
Robust File and Folder Copy.
By default Robocopy will only copy a file if the source and destination have different time stamps or different file sizes.

/S : Copy Subfolders.
/E : Copy Subfolders, including Empty Subfolders.
/SEC : Copy files with SECurity (equivalent to /COPY:DATS).
/R:n : Number of Retries on failed copies – default is 1 million.
/W:n : Wait time between retries – default is 30 seconds.

Creating batch scripts:

https://www.tutorialspoint.com/batch_script/batch_script_variables.htm

Powershell

Comments Off on SS64 cmd/ ps reference