CompTIA A+ 220-1002 Commands
net
Allows you to configure various networking options such as services.
CHKDSK /F
Check for disk errors, not bad sectors.
cmd
Command Prompt Enables Shell
XCOPY
Command in the command-line interface used to copy multiple directories at once, which the copy command could not do.
CHKDSK/V
Displays the name of each file in every directory as the disk is checked.
ipconfig /all
Enables the MAC address information to be displayed from the command prompt
grep
Filter files The grep (Globally search a Regular Expression and Print) command is used to search and filter the contents of files, displaying the lines that match the search string. The search string can be a simple text value to match (a literal) or can use a sophisticated pattern-matching system called regular expressions (regex). grep is especially useful for searching long files such as system logs. For example, the following command displays only the lines in the Linux system log file for messages that contain the text uid=1003, ignoring the case of the text with the -i switch: grep -i "uid=1003" /var/log/messages The grep command can also be used to search a directory for a certain file. The ls -l | grep audit command returns a long listing of any files in the current directory whose name contains audit.
ipconfig /flushdns
Flush the DNS resolver cache
CHKDSK /X
Forces the volume to dismount first, if necessary. It also includes the functionality of /f.
CONVERT
In computing, convert is a command-line utility included in the Windows NT operating system line. It is used to convert volumes using the FAT file systems to NTFS.
ls
Linux command line - List files The ls command is used to display a folder in the same way as dir at the Windows command prompt. Popular parameters include -l to display a detailed (long) list and -a to display all files including hidden or system files. The following example shows the entire contents of the /etc directory in a detailed format: ls -l -a /etc
mkfs
Linux command-line program used to format a partition
mkswap
Linux command-line program used to format a swap partition. The swapon command is used to activate the partition as swap space.
CHKDSK /R
Locate the bad sectors on the target hard disk and try to recover the readable information from the bad sectors (implies /F).
dd
Make a copy of an input file (if=) to an output file (of=) and apply optional conversions to the file data. One notable use of dd is to clone a disk (in the following, sda might be the fixed drive and sdb a removable drive): dd if=/dev/sda of=/dev/sdb. Linux command line.
CHKDSK/B
NTFS only. It clears the list of bad clusters on the volume and rescans all allocated and free clusters for errors. It includes the functionality of /r. Use this parameter after imaging a volume to a new hard disk drive.
CHKDSK/C
NTFS only. It does not check cycles within the folder structure, which reduces the amount of time required to run CHKDSK.
CHKDSK/I
NTFS only. It performs a less vigorous check of index entries, which reduces the amount of time required to run CHKDSK.
CHKDSK/scan
NTFS only. It runs an online scan on the volume.
passwd
Password Utility The passwd command allows a user to change their own password or superuser (root) to change or reset someone else's. When a user runs the command, Linux will prompt first for the existing password then the new one, twice. The superuser can reset another user's password by typing the user name after the command. The existing password is not required in this case. To reset the password for the user fredb, the superuser would enter the command passwd fredb
su
Switch user The su command allows a Linux user to switch to another user account, including superuser (or root) if another user id is not specified. The command will prompt the user for the password of the account (or root) before switching to it. Using su without an option retains the original user's profile and variables. The switched user also remains in the home directory of the original user. Using su - changes users and launches a new shell under the context of that new user. This is a much better practice.
SFC
The System File Checker command is used to verify and repair system files.
regedit.exe
The ____ tool allows a user to connect to the active registry database and make changes that are effective immediately.
ipconfig
The utility used to display TCP/IP addressing and domain name information in the Windows client operating systems.
fdisk
Used to create and manage partitions on a Linux hard disk.
SYSPREP
Utility built into Windows for image deployment over the network. Preps the system to be moved as an image file.
nslookup
a tool used to query the DNS system to find the IP addresses for domain names, and vice versa
cd
change directory The cd command is used to change your working directory. Typical syntax would be: cd /etc—change directory to /etc. This is an absolute path (begins with /) so will work regardless of your current directory. cd documents—change your directory to a subdirectory called documents. This is a relative path. The documents directory must exist below the current directory. cd ..—change your directory to the parent directory of the one you are currently working in.
cp
copy a file or directory The cp command is used to create a copy of files either in the same or different folder with the same or different name. For example: cp file1.txt file1.old—copy file1.txt in the current working directory to a new file called file1.old in the same directory. cp /etc/hosts /tmp—copy the file hosts from the directory /etc into the directory /tmp, keeping the file name the same. cp -v /var/log/message* /home/usera—copy all files beginning with the name message from the /var/log directory into /home/usera. The -v option displays the files copied.
mv
move a file or directory The mv command is used to either move files from one directory to another or rename a file. For example: mv /home/usera/data.txt /tmp—move the file data.txt from the /home/usera directory to the /tmp directory, keeping the file name the same. mv alarm.dat /tmp/alarm.bak—move and rename the file alarm.dat in the current directory to alarm.bak in /tmp. mv /var/log/app1.dat /var/log/app1.old—rename the file app1.dat in the /var/log folder to app1.old.
devmgmt.msc
opens device manager from runline
diskmgmt.msc
opens disk management console from runline
compmgmt.msc
opens the Computer Management console from runline
pwd
print working directory The pwd command simply displays the current directory you are working in. Any commands you use which don't specify a directory will assume your current one. The prompt on some distros will show your current working directory or a ~ symbol, which indicates you are in your home directory. Linux command line
help
provides list of available commands
rm
remove files The rm command is potentially very dangerous if used incorrectly. Although its main role is to delete files, with an additional parameter (-r) it can also be used to delete directories. For example: rm data.old—remove the single file data.old from the current working directory. rm /var/log/*.bak—remove all files ending in .bak from the /var/log directory. rm -r /home/usera/data—remove the contents of the entire directory tree underneath the folder /home/usera/data.
DISKPART Command
shows the partitions and lets you manage them on the computers hard drives.
sudo
super user do The sudo command allows a normal user to run specified commands with superuser privilege level. The superuser first has to edit the /etc/sudoers file listing the commands and users that are allowed to run them. The user enters the sudo command followed by the path of the command they wish to run. The user might be asked to confirm his or her password, if it has not been cached recently.
netstat
A TCP/IP troubleshooting utility that displays statistics and the state of current TCP/IP connections. It also displays ports, which can signal whether services are using the correct ports.
nbtstat
A Windows utility that is used to view and manage NetBIOS name cache information.