BASICS of DOS John H

Total Page:16

File Type:pdf, Size:1020Kb

BASICS of DOS John H BASICS OF DOS John H. Ristroph, Ph.D., P.E. Engineering and Technology Management Program University of Louisiana at Lafayette This paper explains basic DOS file management commands available through the DOS prompt of Windows 95 and later. It initially assumes that the files on disk C: are organized into directories, as illustrated in Figure 1. Root Dir1 Dir2 --- DirN DirA FileD File1 FileA FileF FileB FileE File2 File2 FileG FileC --- FileM MileHi Figure 1. Sample Files and Directories Directories: A directory is a special file that contains information about other files, including their addresses or locations on the disk. The root directory is the top level directory shown in Figure 1. It contains the addresses of the directories named Dir1, Dir2, ..., DirN and the files named File1, File2, ..., FileM, MileHi. The directories Dir1, Dir2, ..., DirN contain the addresses of still more directories and/or files. Two different files can have the same name if they are in different directories, such as File2 in the root directory and File2 in the Dir1 directory. Each directory is essentially a separate address book that keeps track of only its own files. Most DOS systems are set up so that the name of the directory is part of the prompt, so the user knows which directory the computer is currently using to find file addresses. Changing Directories and Current Directories: To use addresses in the root directory, first “change” to it by entering the change directory command followed by a backslash: cd \ The Enter key must be pressed after every DOS command, so it is not shown here. After changing to the root directory, then the prompt for drive C: would be: C:\> By default, commands refer to files having addresses given by the “current directory” shown in the prompt. For example, the command C:\> more File2 will cause the contents of the File2 whose address is given by the root directory to be displayed one screen at a time. One way to see the contents of the File2 whose address is given by directory Dir1 is first to change to Dir1 and and then give the more command: C:\> cd Dir1 1 C:\Dir1> more File2 The root directory is now “above” the current directory (Dir1). One way to go to the directory "above" the current is: C:\Dir1> cd .. In this case, the root directory becomes current and the prompt becomes: C:\> File Names: A file's complete or fully qualified name consists of all the information that DOS needs to find it: its drive letter, followed by any directory name separated by backslashes, and then the filename. For example, C:\Dir2\DirA\FileG is the fully qualified name of FileG. The part of the fully qualified name that precedes the file’s name is referred to as that file’s path name. If the user is currently on drive C:, then C: is optional and does not need to be included in the path name. Using a file's fully qualified name permits its reference without first changing to its directory. For example, the user can be in the root directory and input C:\> more \Dir2\DirA\FileG to display FileG. Alternatively, the user can first change to the directory and then use more: C:\> cd \Dir2\DirA C:\Dir2\DirA> type File2 Filenames can have two parts, separated by a period, such as filename.ext. The first or primary name can be up to 8 alphanumeric characters (plus a few others, such as the underscore, dash, or dollar sign), and the extension can be up to 3 alphanumeric characters. Directories usually have only a primary name. In DOS, file names are not case sensitive, so FileA and filea refer to the same file. DOS abbreviates long Windows' names. Wildcards: Some commands can be made to refer to more than one file by the use of wildcards. For example, the following commands make directory DirN the current directory and then erase all of its files: C:\Dir2\DirA> cd \DirN C:\DirN> erase *.* The erase command causes files to be erased, and an asterisk (*) stands for any primary name or extension. A question mark (?) stands for any one character. For example, suppose that the user is in the root directory. Then File? refers to files FileA, FileB, ..., and FileM, but not file MileHi. Similarly, ?ile? refers to all of the files but MileHi, since it has one more character than the others. However, ?ile* refers to all of the files in the root directory (excluding directories). ASCII files: ASCII (American Standard Code for Information Interchange) files contain only characters normally used in typing. They do not contain special characters that are found in executable files, graphics images, or word processor files. The edit command of DOS can be used to prepare ASCII files, or files can be exported from word processors in ASCII format. Edit is mouse driven and has a Help button in its upper right corner that can be clicked. Executable Files: Programs are stored in files with names that sometimes have the extensions .exe or .com, such as kermit.exe. Such files are called executable files. Execute a program by inputting the primary name of the executable file that contains it. If that file's directory is current, then only the primary name is needed; otherwise the path name must be 2 placed in front of the primary name. For example, a user in a directory PROGRAM that contains prog1.exe can input C:\PROGRAM> prog1 causes prog1 to execute. Batch files are ASCII files that contain several the names of several programs, one per line. Inputting the primary name of the batch file causes each one of those programs to execute, one after another. The execution of batch files or programs frequently can be stopped by pressing the Ctrl and C keys simultaneously (^C). If the user is not in the executable file's directory, then giving its fully qualified name will cause it to execute. For example, a user in the root directory who does not wish to change to directory PROGRAM can input: C:\> \PROGRAM\prog1 Another way is to give special instructions to the computer using the path command. This command gives DOS a list of directories in which to search when it cannot find an executable file in its current directory. When a computer is booting up, it is usually given a list of directories to search by a file in the root directory named autoexec.bat, including the one that contains DOS commands. Selected DOS Commands: Provide below is a brief list of fundamental DOS commands. Each command is illustrated with an example. Further details can be obtained by using the Help command of DOS (also described below). ^C (pressing the Ctrl and C keys simultaneously) can interrupt and stop the execution of many commands. cd\ changes to the root directory. cd\Dir2\DirA changes to any other directory, such as \Dir2\DirA. copy file1 file2 copies the contents of the first file and assigns the new file the second name. If a file already has the name file2, it is destroyed. Remember that fully qualified names must always be given for any file not in the current directory. copy file1 + file2 combines file1 and file2. The combined file is named file1, and file2 is not changed. In general, only ASCII files should be combined. dir lists the contents of a directory. dir /w provides an abbreviated listing of the contents of a directory across the screen. dir | sort pipes or sends the output from the dir command to the sort command, instead of the screen. The sort commands sorts the file names into ascending order before they are displayed. dir > EraseMe.txt redirects the output of dir to a file named EraseMe.txt, instead of sending it to the screen. This is similar to piping, except that the output goes to a file instead of another program. erase file1 removes file1 from the disk. find "abc" file1 searches for the three characters abc in file1. It is case sensitive unless instructed otherwise. The command find "abc" file1 > outfile 3 redirects the output of the find command from the screen and stores it in the file outfile, if that is desired. help provides a list of help topics. Click on the desired topic; and when through, click on the File menu at the top of the screen and then select Exit to leave the program. If the name of the command for help is wanted is known, then input help followed by the command name, for example help dir. md NewDir creates (or makes) the new directory named NewDir in the current directory. move file1 \Dir2 moves file1 from the current directory into directory Dir2. move file1 file100 renames file1 to file100. rd NewDir removes the directory NewDir, provided that it is in the current directory and has no files in it. more file1 displays the contents of file1 one screen at a time. Usually only ASCII files can be read this way. type file1 | more displays the contents of file1 one screen at a time. The next screen is displayed when the space bar is pressed. The vertical bar pipes or sends the output from the type command to the more command, instead of the screen. Then the more command displays it a screen at a time. Last updated 9/29/00. 4 .
Recommended publications
  • MANNING Greenwich (74° W
    Object Oriented Perl Object Oriented Perl DAMIAN CONWAY MANNING Greenwich (74° w. long.) For electronic browsing and ordering of this and other Manning books, visit http://www.manning.com. The publisher offers discounts on this book when ordered in quantity. For more information, please contact: Special Sales Department Manning Publications Co. 32 Lafayette Place Fax: (203) 661-9018 Greenwich, CT 06830 email: [email protected] ©2000 by Manning Publications Co. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps. Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end. Library of Congress Cataloging-in-Publication Data Conway, Damian, 1964- Object oriented Perl / Damian Conway. p. cm. includes bibliographical references. ISBN 1-884777-79-1 (alk. paper) 1. Object-oriented programming (Computer science) 2. Perl (Computer program language) I. Title. QA76.64.C639 1999 005.13'3--dc21 99-27793 CIP Manning Publications Co. Copyeditor: Adrianne Harun 32 Lafayette
    [Show full text]
  • Java/Java Packages.Htm Copyright © Tutorialspoint.Com
    JJAAVVAA -- PPAACCKKAAGGEESS http://www.tutorialspoint.com/java/java_packages.htm Copyright © tutorialspoint.com Packages are used in Java in order to prevent naming conflicts, to control access, to make searching/locating and usage of classes, interfaces, enumerations and annotations easier, etc. A Package can be defined as a grouping of related types classes, interfaces, enumerationsandannotations providing access protection and name space management. Some of the existing packages in Java are:: java.lang - bundles the fundamental classes java.io - classes for input , output functions are bundled in this package Programmers can define their own packages to bundle group of classes/interfaces, etc. It is a good practice to group related classes implemented by you so that a programmer can easily determine that the classes, interfaces, enumerations, annotations are related. Since the package creates a new namespace there won't be any name conflicts with names in other packages. Using packages, it is easier to provide access control and it is also easier to locate the related classes. Creating a package: While creating a package, you should choose a name for the package and include a package statement along with that name at the top of every source file that contains the classes, interfaces, enumerations, and annotation types that you want to include in the package. The package statement should be the first line in the source file. There can be only one package statement in each source file, and it applies to all types in the file. If a package statement is not used then the class, interfaces, enumerations, and annotation types will be placed in the current default package.
    [Show full text]
  • Openvms: an Introduction
    The Operating System Handbook or, Fake Your Way Through Minis and Mainframes by Bob DuCharme VMS Table of Contents Chapter 7 OpenVMS: An Introduction.............................................................................. 7.1 History..........................................................................................................................2 7.1.1 Today........................................................................................................................3 7.1.1.1 Popular VMS Software..........................................................................................4 7.1.2 VMS, DCL................................................................................................................4 Chapter 8 Getting Started with OpenVMS........................................................................ 8.1 Starting Up...................................................................................................................7 8.1.1 Finishing Your VMS Session...................................................................................7 8.1.1.1 Reconnecting..........................................................................................................7 8.1.2 Entering Commands..................................................................................................8 8.1.2.1 Retrieving Previous Commands............................................................................9 8.1.2.2 Aborting Screen Output.........................................................................................9
    [Show full text]
  • Quick Start Guide for Java Version 5.0
    Quick Start Guide for Java Version 5.0 Copyright © 2020 Twin Oaks Computing, Inc. Castle Rock, CO 80104 All Rights Reserved Welcome CoreDX DDS Quick Start Guide for Java Version 5.0 Nov 2020 Welcome to CoreDX DDS, a high-performance implementation of the OMG Data Distribution Service (DDS) standard. The CoreDX DDS Publish-Subscribe messaging infrastructure provides high-throughput, low-latency data communications. This Quick Start will guide you through the basic installation of CoreDX DDS, including installation and compiling and running an example Java application. You will learn how easy it is to integrate CoreDX DDS into an application. This Quick Start Guide is tailored for Java applications, and the examples differ slightly for other languages. Installation First things first: get CoreDX DDS onto your development system! Here’s what you need to do: 1. Once you have obtained CoreDX DDS from Twin Oaks Computing (or from the Eval CD), unpack the appropriate distribution for your machine somewhere on your system. We’ll refer to this directory throughout this guide as COREDX_HOME. For example, on a UNIX system this command will extract the distribution into the current directory: gunzip –c coredx-5.0.0-Linux_2.6_x86_64_gcc5-Release.tgz | tar xf – CoreDX DDS is available for multiple platform architectures, and multiple platform architectures of CoreDX DDS can be installed in the same top level (COREDX_TOP) directory. The directory structure under COREDX_TOP will look like: 2. If you are using an evaluation copy of CoreDX DDS, follow the instructions you received when you downloaded the software to obtain an evaluation license.
    [Show full text]
  • Importance of DNS Suffixes and Netbios
    Importance of DNS Suffixes and NetBIOS Priasoft DNS Suffixes? What are DNS Suffixes, and why are they important? DNS Suffixes are text that are appended to a host name in order to query DNS for an IP address. DNS works by use of “Domains”, equitable to namespaces and usually are a textual value that may or may not be “dotted” with other domains. “Support.microsoft.com” could be considers a domain or namespace for which there are likely many web servers that can respond to requests to that domain. There could be a server named SUPREDWA.support.microsoft.com, for example. The DNS suffix in this case is the domain “support.microsoft.com”. When an IP address is needed for a host name, DNS can only respond based on hosts that it knows about based on domains. DNS does not currently employ a “null” domain that can contain just server names. As such, if the IP address of a server named “Server1” is needed, more detail must be added to that name before querying DNS. A suffix can be appended to that name so that the DNS sever can look at the records of the domain, looking for “Server1”. A client host can be configured with multiple DNS suffixes so that there is a “best chance” of discovery for a host name. NetBIOS? NetBIOS is an older Microsoft technology from a time before popularity of DNS. WINS, for those who remember, was the Microsoft service that kept a table of names (NetBIOS names) for which IP address info could be returned.
    [Show full text]
  • Bigraphical Domain-Specific Language (BDSL): User Manual BDSL Version: V1.0-SNAPSHOT
    >_ Interpreter CLI BDSL BDSL User Manual BDSL v1.0-SNAPSHOT 1 Bigraphical Domain-specific Language (BDSL): User Manual BDSL Version: v1.0-SNAPSHOT Dominik Grzelak∗ Software Technology Group Technische Universit¨at Dresden, Germany Abstract This report describes Bigraphical DSL (BDSL), a domain-specific language for reactive systems, rooted in the mathematical spirit of the bigraph theory devised by Robin Milner. BDSL is not only a platform-agnostic programming language but also a development framework for reactive applications, written in the Java program- ming language, with a focus on stability and interoperability. The report serves as a user manual mainly elaborating on how to write and execute BDSL programs, further covering several features such as how to incorporate program verification. Moreover, the manual procures some best practices on design patterns in form of code listings. The BDSL development framework comes with a ready- to-use interpreter and may be a helpful research tool to experiment with the underlying bigraph theory. The framework is further in- tended for building reactive applications and systems based on the theory of bigraphical reactive systems. This report is ought to be a supplement to the explanation on the website www.bigraphs.org. The focus in this report lies in the basic usage of the command-line interpreter and mainly refers to the features available for the end-user, thus, providing a guidance for taking the first steps. It does not cover programmatic implementation details in great detail of the whole BDSL Interpreter Framework that is more suited to developers. Acknowledgment This research project is funded by the German Research Foundation (DFG, Deutsche Forschungsgemeinschaft) as part of Germany's Excel- lence Strategy { EXC 2050/1 { Project ID 390696704 { Cluster of Ex- cellence "Centre for Tactile Internet with Human-in-the-Loop" (CeTI) of Technische Universit¨at Dresden.
    [Show full text]
  • MS-DOS Basics.Pdf
    MS-DOS Basics The Command Prompt When you first turn on your computer, you will see some cryptic information flash by. MS-DOS displays this information to let you know how it is configuring your computer. You can ignore it for now. When the information stops scrolling past, you'll see the following: C:\> This is called the command prompt or DOS prompt. The flashing underscore next to the command prompt is called the cursor. The cursor shows where the command you type will appear. Type the following command at the command prompt: ver The following message appears on your screen: MS-DOS version 6.22 Viewing the Contents of a Directory To view the contents of a directory 1. Type the following at the command prompt: dir A list similar to the following appears: Changing Directories To change from the root directory to the WINDOWS directory To change directories, you will use the cd command. The cd command stands for "change directory." 1. Type the following at the command prompt: cd windows The command prompt changes. It should now look like the following: C:\WINDOWS> Next, you will use the dir command to view a list of the files in the DOS directory. Viewing the Contents of WINDOWS Directory To view a list of the files in the WINDOWS directory 1. Type the following at the command prompt: dir Changing Back to the Root Directory To change to the root directory 1. Type the following at the command prompt: cd \ Note that the slash you type in this command is a backslash (\), not a forward slash (/).
    [Show full text]
  • Java: Odds and Ends
    Computer Science 225 Advanced Programming Siena College Spring 2020 Topic Notes: More Java: Odds and Ends This final set of topic notes gathers together various odds and ends about Java that we did not get to earlier. Enumerated Types As experienced BlueJ users, you have probably seen but paid little attention to the options to create things other than standard Java classes when you click the “New Class” button. One of those options is to create an enum, which is an enumerated type in Java. If you choose it, and create one of these things using the name AnEnum, the initial code you would see looks like this: /** * Enumeration class AnEnum - write a description of the enum class here * * @author (your name here) * @version (version number or date here) */ public enum AnEnum { MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY } So we see here there’s something else besides a class, abstract class, or interface that we can put into a Java file: an enum. Its contents are very simple: just a list of identifiers, written in all caps like named constants. In this case, they represent the days of the week. If we include this file in our projects, we would be able to use the values AnEnum.MONDAY, AnEnum.TUESDAY, ... in our programs as values of type AnEnum. Maybe a better name would have been DayOfWeek.. Why do this? Well, we sometimes find ourselves defining a set of names for numbers to represent some set of related values. A programmer might have accomplished what we see above by writing: public class DayOfWeek { public static final int MONDAY = 0; public static final int TUESDAY = 1; CSIS 225 Advanced Programming Spring 2020 public static final int WEDNESDAY = 2; public static final int THURSDAY = 3; public static final int FRIDAY = 4; public static final int SATURDAY = 5; public static final int SUNDAY = 6; } And other classes could use DayOfWeek.MONDAY, DayOfWeek.TUESDAY, etc., but would have to store them in int variables.
    [Show full text]
  • MS-DOS Lecture
    MS-DOS 2017 University of Babylon College of Engineering Electrical Department Learning Basics of MS-DOS Assis. Lec. Abeer Abd Alhameed | 1 MS-DOS 2017 Outcomes: By the end of this lecture, students are able to: Define the MS-DOS system Log in MS-DOS commands system Display MS-DOS information on your computer Type basic commands of MS-DOS system (view directory contents, change directory, make directory) Assis. Lec. Abeer Abd Alhameed | 2 MS-DOS 2017 Learning of MS-DOS Basics: Definition - What does Microsoft Disk Operating System (MS- DOS) mean? The Microsoft Disk Operating System (MS-DOS) is an operating system developed for PCs (personal computers) with x86 microprocessors. It was the first widely-installed operating system in personal computers. It is a command-line-based system, where all commands are entered in text form and there is no graphical user interface. The Command Prompt: When you first turn on your computer, you will see some information flash by. MS-DOS displays this information to let you know how it is configuring your computer. You can ignore it for now. When the information stops scrolling past, you'll see the following: C:\> This is called the command prompt or DOS prompt. The flashing underscore next to the command prompt is called the cursor. The cursor shows where the command you type will appear. Typing a Command: This section explains how to type a command at the command prompt and demonstrates the "Bad command or file name" message. • To type a command at the command prompt 1. Type the following at the command prompt (you can type the command in either uppercase or lowercase letters): nul If you make a typing mistake, press the BACKSPACE key to erase the mistake, and then try again.
    [Show full text]
  • CS 103 Lab 1 - Linux and Virtual Machines
    CS 103 Lab 1 - Linux and Virtual Machines 1 Introduction In this lab you will login to your Linux VM and write your first C/C++ program, compile it, and then execute it. 2 What you will learn In this lab you will learn the basic commands and navigation of Linux/Unix, its file system, the GNU C/C++ compiler and a few basic applications such as Gedit. Important: The Linux operating system and environment shares a vast majority of commands and methods with Unix. 3 Background Information and Notes 3.1 Software to Install on your PC Start by following the course virtual machine installation instructions found at the link below. http://cs103.usc.edu/tools-and-links/installing-course-vm/ Below is a list of recommended software you should install that will be helpful over multiple courses in CS and EE. These tools allow you to access remote servers, run GUI apps on those servers, and transfer files between your PC and those servers. For Windows: FileZilla FTP – Available from : https://software.usc.edu/index.aspx XWin-32 – Available from : https://software.usc.edu/index.aspx PuTTY – Available from : https://software.usc.edu/index.aspx For Mac: X Server: http://developer.apple.com/opensource/tools/runningx11.html Fetch FTP – Available from : https://software.usc.edu/index.aspx Reference: http://www.usc.edu/its/unix/ Last Revised: 8/29/2014 1 CS 103 Lab 1 - Linux and Virtual Machines 3.2 Getting Started with Unix1 and Accessing your Account Solaris vs. Unix vs. Linux UNIX was developed by AT&T Bell Labs in 1969.
    [Show full text]
  • How to Load Vista Or Windows 7 Onto a Bootable Thumb Drive
    STAR Watch Statewide Technology Assistance Resources Project A publication of the Western New York Law Center,Inc. Volume 15 Issue 5 Sept-Oct 2011 How to Load Vista or Windows 7 onto a Bootable Thumb Drive Ever since the capacity of USB thumb more robust. What happens when a drives rose into the multi-gigabyte range, DVD gets scratched? computer geeks have been trying to use them to create bootable devices that • Some of the latest computers don’t could be used in an emergency to boot have DVD drives, but they do have a up a failed computer. It was a wonderful USB port. idea, except for one detail: The driver • It takes less time to re-install needed to read the Windows install files Windows from a thumb drive could not be accessed. With the release of Vista and Windows 7 operating Find yourself a suitable thumb drive. It systems, the drivers needed to read the might be possible to shoehorn the files have been made more accessible. It Windows software onto a 4GB thumb is now possible to create a bootable drive, but that would leave no room for thumb drive that can be used to boot up anything else (It might be nice to have a computer and install Windows. copies of the install programs for things like printer drivers or other software that So, what is the big deal? Isn’t a DVD good enough? For many people, a DVD is quite adequate. Just store it in a safe In this issue… place and pull it out when it is needed.
    [Show full text]
  • Linux File System and Linux Commands
    Hands-on Keyboard: Cyber Experiments for Strategists and Policy Makers Review of the Linux File System and Linux Commands 1. Introduction Becoming adept at using the Linux OS requires gaining familiarity with the Linux file system, file permissions, and a base set of Linux commands. In this activity, you will study how the Linux file system is organized and practice utilizing common Linux commands. Objectives • Describe the purpose of the /bin, /sbin, /etc, /var/log, /home, /proc, /root, /dev, /tmp, and /lib directories. • Describe the purpose of the /etc/shadow and /etc/passwd files. • Utilize a common set of Linux commands including ls, cat, and find. • Understand and manipulate file permissions, including rwx, binary and octal formats. • Change the group and owner of a file. Materials • Windows computer with access to an account with administrative rights The Air Force Cyber College thanks the Advanced Cyber Engineering program at the Air Force Research Laboratory in Rome, NY, for providing the information to assist in educating the general Air Force on the technical aspects of cyberspace. • VirtualBox • Ubuntu OS .iso File Assumptions • The provided instructions were tested on an Ubuntu 15.10 image running on a Windows 8 physical machine. Instructions may vary for other OS. • The student has administrative access to their system and possesses the right to install programs. • The student’s computer has Internet access. 2. Directories / The / directory or root directory is the mother of all Linux directories, containing all of the other directories and files. From a terminal users can type cd/ to move to the root directory.
    [Show full text]