Command Line Troubleshooting Tools Reference Guide
Command Line Troubleshooting Tools Reference Guide
Sections
Software and hardware troubleshooting tools
File management
Disk management
Other tools
File management
The following commands allow you to copy files from the command line.
copy
Linux: cp
copy files by moving them from one location to another, such as from one drive to
another
Example: A company decides to upgrade its computers, but it’s still using the
same operating system and wants to keep its data and files intact. The IT
administrator can use copy to move the files and directories from the older
computers to the newer computers. The newer computers will now have
duplicates of the files.
Command Line Tools
Grow with Google: IT Support Certificate
xcopy
copy files with options and control over how to copy files and directories
xcopy /s
includes subdirectories that contain content when copying files
xcopy /j
protects larger files while copying
Example: The hard drive on a computer is beginning to fail. The drive has tested
clean for viruses and other malware, so issue is purely mechanical. The IT
administrator decides to copy all the files on the drive to another drive. Some of
these files are very large and contain important data. The IT administrator
decides to use xcopy and copy all the files without buffering. They add the
switch /j to protect the larger files.
robocopy
copy files with more commands than xcopy, including commands for moving secure
files
robocopy /sec
copies files with security
Example: An IT administrator needs to move files from one place to another with
the security intact. The administrator decides to use robocopy to move the files
with the switch /sec which copies files with security.
Disk management
These commands are used to troubleshoot and perform tasks on a computer’s disk,
file system, and drives.
Command Line Tools
Grow with Google: IT Support Certificate
chkdsk
Linux: fsck
check both the file system and its metadata for physical and logical errors
chkdsk /f
check the drive and repair any issues
sfc
Check the system for corrupted files and look for cached copies of the files to try to
repair them
format
Reset the drive and erase all the data, only putting in data needed to operate the disk
Example: A user has been trying to start a computer, but it won’t consistently
start. When it does go on, it doesn’t stay on long enough to perform any tasks.
There may be a virus on the drive, bad sectors, or a number of other problems.
After explaining to the user all the data on the drive will be erased and getting
permission from the user, an IT professional formats the computer’s drives,
reinstalls the operating system, and checks if it starts up again with a newly
formatted disk.
Command Line Tools
Grow with Google: IT Support Certificate
diskpart
Linux: fdisk
divide a hard drive into separate partitions that act like disks
Other tools
These two commands are helpful tools for an IT administrator to troubleshoot and
gather information about a computer system.
shutdown
Linux: shutdown
shut down the local computer or other computers on the network
shutdown /fw
reboots the computer into the firmware interface after shutdown
Example: A company has decided to shut down all the computers on the internal
network for routine maintenance. The IT administrator uses the shutdown tool
to shut down all the computers in the network.
winver
display the current version of Windows
Command Line Tools
Grow with Google: IT Support Certificate
Network information
This group of commands helps you gather information about the network that you
might need to troubleshoot and solve issues.
ipconfig
Linux (later version): ip
Linux (older versions): ipconfig
display the current network configuration information
ipconfig /all
display full configuration information for all adapters
ping
Linux: ping
check the status of a connection to an address or the server speed of the connection
to determine if a website or router is running slow
Command Line Tools
Grow with Google: IT Support Certificate
Example: A user is successfully connected to a website, but it’s very slow. The
user asks an IT administrator to find out why it is slow. The IT administrator uses
ping to check the router and finds no problem with the speed. Then they use
ping to check the website and they find the website is running slow, not the
user’s computer or the local router.
pathping
send out a request to each of the routers on the path to the destination, check the
packets from each router for loss and latency, and use the information to determine
where the packet loss is happening
tracert
Linux: traceroute
Mac: traceroute
trace the route of a packet of data from the user’s source computer to the destination
system
hostname
Linux: hostname
display the name of one device on a network
Command Line Tools
Grow with Google: IT Support Certificate
netstat
Linux: netstat
display statistics about network activity and configuration, such as user information
about passive and active sockets
Example: An IT administrator needs to know which sockets are active and how
many there are. The administrator uses netstat to get the information.
nslookup
Linux: nslookup
obtain DNS record information by sending queries to the domain name server
net user
add or modifies user accounts, or display user account information
Example: A computer in the company which allows external users access from
other computers is having problems. Huge amounts of files start appearing on
the computer including large photo files and other odd files. The IT
Command Line Tools
Grow with Google: IT Support Certificate
administrator uses the net user tool and finds there is still an account active for
a recently terminated employee. The IT administrator then uses the net user
command and the /delete switch to delete the user account.
net use
Disconnect a computer from a shared resource and display a list of network
connections
Group management
Both of the follwing commands are used to display and update group policies.
gpupdate
update group policy settings
gpresult
display the Resultant Set of Policy (RSoP) for a system
Command Line Tools
Grow with Google: IT Support Certificate