Download presentation
Presentation is loading. Please wait.
1
Yep, you need to know this
The Command Line Yep, you need to know this
2
The Basics Start with the Prompt, what the computer tells you when ready for a command You type a command and press ENTER when you want to send it to the computer Computer may come back with text about what it did (or did not do) and then will present the Prompt once more
3
Accessing the Command Line
Search dialog box; type CMD or COMMAND Right-click shortcut and select Run As Administrator for commands that affect Windows; use sudo for Mac and Linux Command line interpreter or shell Mac and Linux shell is bash Mac uses Terminal
4
Focus Command Line always focused on a drive and directory; prompt will show both C:\Windows\System32> has focus on C: drive and Windows\System32 folder Change focus Type drive letter and colon, then ENTER Type CD and directory name to drill down Type CD .. To go up a level DOS will remember drive and directory
5
Filenames Everything is a file to the computer
Each file has a name: 8.3 format Windows allows 255 characters in file name Extension (should be) unique to application that created the file; changing the file extension does not change the file contents Windows uses file extension to determine: a) Program that created it and b) What icon to use for the file – same for Mac and Linux
6
ASCII American Standard Code for Information Interchange
Each unique method of binary organization is called a file format ASCII defines 256 eight-bit characters First, universal, file format still used for configuration files
7
Folders Also called directories
Any file at the root of the directory tree is said to be in the Root Directory A folder within a folder is a sub-directory or subfolder and is “under” that folder Any folder can have many subfolders and files; names have to be unique unless in different folders
8
Path The route to a file; listing of drive and directory structure to get to the file: C:\Windows\System32\Notepad.exe This is the path to the file and its full name Mac and Linux use tilde (~); use pwd to have system show full path
9
Command.com Shifts command to upper case Looks within command.com
Looks within the current directory (focus) Looks in directories specified in the PATH Returns “Bad command or file name” <command> /? Will bring up help on the command
10
Oh No! DOS will do what you say, not what you mean so double-check spelling and syntax before the Enter key is pressed I wanted a directory listing, but I typed DEL instead of DIR – made for a very bad day
11
DIR Shows the contents of the current directory
Can show another directory if you point it there: dir c:\windows Dir /w will give you a five-column display Dir /p will pause at each screenful of information Mac and Linux use ls; -l gives long listing
12
CD Change directory CD <directory name> will take you down to that directory CD .. Will take you up one directory level CD \ will take you to the root directory for the drive
13
Move between drives Type the drive name followed by a colon and then press enter A: will take you to the A: drive C: will take you to the C: drive Command will remember what directory you were in on each drive when you switch
14
MD MD <name> to make a directory; or mkdir
New directory is directly below current directory Automatically creates . (dot) and .. (double-dot) files. Dot is current directory; double-dot is parent directory (one up) Does not tell you anything if it worked
15
RD RD <name> to remove (empty) directory (only . and .. Files remain; rmdir works for all Removes directory below current directory RD <name> /s will remove files, subdirectories and directory; -r switch for Mac and Linux
16
Running a Program Your computer can only run files with the extensions: .exe, .com or .bat You do not have to type the extension to run the file/program
17
ATTRIB Attrib <name> displays the attributes (H,S,R,A) for a file Attrib <name> + turns on the attribute Attrib <name> - turns off the attribute
18
Wildcards * (shift-8) replaces any number of characters
? Replaces just one character Can be used anywhere a file name is legal DIR a*.* will find any file that starts with “a” in the directory and has any extension
19
REN Renames a file name to a new name
REN <old name> <new name>
20
DEL BE VERY CAREFUL WITH THIS COMMAND!!!!
Deletes one or more (if you use wildcards) files; all gone, no going back Will not remove directories Actually, replaces the first character with Σ You don’t get a response Rm in Mac and Linux, rm –r for files and folders
21
Copy/Move Copy <what> <where>
Copy d:\win98\*.* c:\win98\*.* will copy all files from the D: drive (optical drive) win98 directory to the C:\WIN98 directory – will not change file names There is no “undo” for copy/move gone wrong Copy is cp and move is mv in Mac and Linux Linux example on pg is backwards
22
XCOPY Allows copying of directories, files and subdirectories at one time Xcopy c:\data d:\data /s/e will copy everything in the c:\data directory to a d:\data directory including files and subdirectories (/s) even if empty (/e)
23
Robocopy Robust file copy command
Allows you to copy files and directory structures across a network Use cp –R (recursive) and mv in Mac and Linux with folder names
24
CHKDSK Command line version of Error Check
Usually fails when you start it because it can not lock the drive; will run next time Windows restarts /F to fix errors it finds, /R to attempt repair
25
Format Writes a new file system to a volume (or partition) so it can hold an OS or data Format c: /s will format c: drive and install system files (DOS) Format destroys all data on the partition, so be very careful
26
Hostname Will give you the name of the computer
27
Gpupdate There are thousands of group policies
When you make changes on a local machine (part of a domain), it can take up to 16 hours for effect to be seen Gpupdate happens right now
28
gpresult When you want to know a quick overview of all security policies applied to a user or computer on your network Gpresult /USER <username> /R for summary report
29
SFC System File Checker SFC /scannow
Will attempt to set computer disk to be the same as installation disk; I think it eats Service Packs
30
Shutdown Guess what it does
31
PowerShell More powerful replacement/add-in to Command Line
Get-ChildItem . –Include *.jpg –Recurse –Force will find all the .jpg files and any mention of jpg file(s)
32
More Mac and Linux Ifconfig is similar to our ipconfig /all command but you can use it to change items or disable items; has been replaced with ip command Iwconfig is for wireless LANs Ps to see processes running on your system; ps aux: all users, show process owner, process not attached to a terminal Grep is used to search thru text files and command output
33
More Mac and Linux Apt-get. Ubuntu linux for Advanced Packaging Tool; for installing programs. Red Hat uses RPM Apt-get update will go look for current versions of programs Apt-get install vim will download and install vim (text editor) Sudo apt-get update and upgrade will update your system like Windows Update
34
vi Vi the basic and ever present text editor
Vi fred will start vi and start a new file ZZ to save work and exit vi, :w to just save, :q! to just quit <esc> to go to command mode, i to go to insert mode
35
dd Create an exact, bit-by-bit image of any form of mass storage
Dd if=<source device> of=<destination> Basically, this is what Norton Ghost did
36
Shutdown Couple of options here: now and –r for restart
37
Passwd Allows you to change password Have to know the old password!
If logged in as root, can change any user’s password
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.