Basic Ms-Dos

Total Page:16

File Type:pdf, Size:1020Kb

Basic Ms-Dos 8/23/2017 History ■ MS-DOS 1.0 was released in August 1981, and was updated until April 1994 when it BASIC MS-DOS was replaced by Windows 95 ■ All versions of windows still contain some type of DOS, in windows 95 and 98 you can go to run and type command to get to DOS prompt, in NT, 2000, and XP you can type ~ Dharma Raj Poudel CMD and get DOS. Introduction File Manipulation The role of DOS is to interpret commands that the user enters via the keyboard. DIR - Lists files and subdirectories • Wildcard Characters ? * EDIT - creates a new file or modifies an existing file These commands allow the following tasks to be COPY - copies a file or a group of files executed: XCOPY - copies all files in a directory (and its subdirectories) file and folder management DEL or ERASE - deletes a file or a group of files UNDELETE - undeletes files disk upgrades COPY (or XCOPY) plus DEL - moves files hardware configuration DOSKEY - recalls commands memory optimization RENAME or REN - renames files TYPE - displays text files program execution PRINT - prints a text file COPY - used to create a file ATTRIB - sets file properties FC - compares two files 1 8/23/2017 Directory Manipulation Basic Structure MD or MKDIR - creates a directory ■ Most DOS commands use the same CD or CHDIR - changes directory structure PROMPT - changes the command prompt ■ Command Source Destination /Switch TREE - displays the directory structure ■ The switch will give options to the command RD or RMDIR - removes a directory ■ Example COPY A:\file.txt c:\ /v ■ /v will verify if the file copied correctly REN - Renaming directories PATH - creates a search path The Help Switch /? MS-DOS Prompt ■ You can use the help switch with any command. It will give ■ The prompt in MS-DOS displays your current directory you the command structure, and the availible switches. ■ C:\dos\commands> means you are in that directory, and any command you use will apply to the current directory unless you specify a different one. 2 8/23/2017 Relative and Absolute path DOS Naming Alternatively referred to as the file path and full path , ■ Characters like * + = | \ [ ] : ; “ < the absolute path contains the root directory and all > , ? / cannot be used in DOS other subdirectories that contain a file or folder. names. absolute path C:\Windows\calc.exe Windows non absolute path (relative path) calc.exe Wildcard characters Basic Commands CD ■ Wildcard character will replace a single letter, ■ CD- Change directory or word with a wild character ■ You use this command when you want to change the directory. ■ * will replace any amput of characters, and ? Will replace one. ■ Example: CD C:\DOS will bring you to the dos folder ■ Example: copy a:/*.txt c:/ will copy all text files to drive c:/ ■ Example 2: copy a:/?????.txt c:/ will copy any 5 letter text file to c:/ 3 8/23/2017 Basic Commands CD.. And Basic Commands CLS CD\ ■ CD.. - brings you to the previous directory. ■ CLS Will clear the contents of the screen ■ Example: if you are in C:\DOS\FOLDER CD.. Will bring you to C:\DOS Basic Commands DIR Basic Commands COPY ■ DIR will display the contents of the folder ■ COPY will copy the file from one location to another ■ Example COPY A:\file.txt c:\ will copy the file from a:\ to c:\ 4 8/23/2017 Basic Command XCOPY Basic Commands MOVE ■ XCOPY can move files, directories, and whole drives from one ■ MOVE will move the file or directory from one location to location to another, It is more powerful then the copy another command, and has a lot of switches. ■ Example: MOVE a:\file.txt c:\file.txt will move the file to the c:\ drive Basic Command DEL Basic Command EDIT ■ DEL will delete a file or an empty directory from the drive ■ EDIT will open a text file 5 8/23/2017 Basic Commands REN Basic Commands MD/RD ■ REN will rename the file ■ MD is used to make a directory (folder) in MS-DOS. ■ Example : REN file.txt myfile.txt will rename the file.txt to ■ Example: MD myfolder will make a folder called myfolder in myfile.txt current directory ■ RD is used for remove directory Deleting folders and sub folders Basic Command TREE ■ TREE shows you all of the folders and files in current directory like explorer in windows. 6 8/23/2017 Attributes The MORE Command ■ Attributes are the properties of a file such as hidden, read- only, archive or system file. ■ In MS-DOS you can view/change attributes with the attrib command. ■ Example: attrib +r file.txt will make the file read-only. The PRINT Command The PROMPT Command ■ The PRINTPRINTPRINT Command in MS DOS is used to print the text files ■ The PROMPT is used to configure a DOS prompt into our linking ■ Syntax : – PRINTPRINTPRINT Filename ■ Syntax : ■ E.g. – C:\ PROMPT Promptname – PRINTPRINTPRINT File1.txt ■ E.g. – PROMPT NCIT Now, the Prompt will be as NCIT 7 8/23/2017 Removing unwanted Files Checking the Date/Time command line. Go to Run –> cmd. This should open the command ■ For checking the date from the system in MS prompt. DOS, we use the DATEDATEDATE command. It returns the current system date. Type g:\ where g is the USB drive letter. ■ Similarly, the TIMETIMETIME command returns the Now run the following command: attrib -h -r -s -a *.*. current time from the system. This will remove the attributes hidden, archive, system from all the files. ■ Syntax : Type del autorun.inf. This will delete the autorun.inf – C:\>DATEDATEDATE file. ■ E.g. C:\>DATEDATEDATE F:\>edit test.txt F:\>edit test.txt F:\>copy con 123.docx my name is indika rathninda^Z 1 file(s) copied. F:\>edit 123.docx F:\>dir>1234.txt 8 8/23/2017 Batch file DOS, OS/2, and Windows, a batch file is a type of script file , a text file containing a series of commands to be executed by the command line interpreter. A batch file may contain any command the interpreter accepts interactively at the command prompt. 9 8/23/2017 The Old New Thing Concatenating Files Together in MS-DOS Say you have two files (or twenty) named textfile1.txt and The command processor CMD.EXE comes with a mini- textfile2.txt. calculator that can perform simple arithmetic on 32-bit You want to create a new text file that combines the two. signed integers: While you could open each file up in your favorite editor C:\>set /a 2+2 4 and copy and paste the text, this is time consuming and C:\>set /a 2*(9/2) 8 error prone. A much easier way to accomplish this task is C:\>set /a (2*9)/2 9 to use the copy command: C:\>set /a "31>>2" 7 Note that we had to quote the shift operator since it >copy *.txt result.txt would otherwise be misinterpreted as a "redirect stdout and append" operator. This will take all the files with the extension .txt and create a new text file called result.txt out of all of them. For more information, type set /? at the command prompt. Finding Text Inside Files in MS-DOS Lets assume I have a group of text files and I need to find out quickly which one contains the string "Test" inside it. You can quickly accomplish this using the 'find' command like so: >find "Test" *.txt This will search the contents of all the text files in the current directory and return a list of all of them that contain the string "Test". This command is extremely useful for searching text files. 10 8/23/2017 Removing All Short Cuts Navigate to you pen drive/ flash drive by typing drive letter. Type “del *.lnk “and hit Enter on your keyboard. Now type “attrib -s -r -h *.* /s /d /l” and hit enter. 11.
Recommended publications
  • 7843 Directory Management
    7843 Directory Management Tired of using existing badly written operating systems, Hieu decided to write his new one. Of course, his new operating system will be awesome, bug-free, fast and easy to use. He has finished most of the work, and now he is asking you to do one lasttask: Implement a directory manager. Initially, Hieu’s computer directory is empty. The current directory is the root directory. The directory manager keeps the directory in a rooted-tree structure. In each directory, the children are sorted in lexicographical order. He can do one of the following actions: • MKDIR s: create a child directory named s inside the current directory where s is a string. – If the current directory already contains a child directory named s, print “ERR” and do nothing. – Otherwise, print “OK” • RM s: remove a child directory named s inside the current directory where s is a string. Figure 1 – If there is no child directory named s, print “ERR”. Otherwise, print “OK”. • CD s: change the current directory to a child directory named s where s is a string. – If s is equal to the string “..” and the current directory is the root directory, print “ERR” and do nothing. – If s is equal to the string “..” and the current directory is not the root direc- tory, then you need to change the current directory to the parent directory Figure 2 and print “OK”. – If there is no child directory named s, print “ERR” and do nothing. – If there is a child directory named s then you need to change the current directory to s and print “OK”.
    [Show full text]
  • Print Wizard 3 Manual
    Print Wizard User Guide and Technical Manual Version 3.0 and later Rasmussen Software, Inc. 10240 SW Nimbus Ave., Suite L9, Portland, Oregon 97223 (503) 624-0360 www.anzio.com [email protected] Copyright © 2004-2005 by Rasmussen Software, Inc., All Rights Reserved Rasmussen Software, Inc. Page 1 Print Wizard Manual Table of Contents Table of Contents PRINT WIZARD USER GUIDE.......................................................................................................................................... 7 1 PRINT WIZARD INTRODUCTION ......................................................................................................................................... 7 1.1 What is Print Wizard?............................................................................................................................................... 7 1.2 Concept..................................................................................................................................................................... 7 1.3 Profiles and Services .............................................................................................................................................. 10 1.3.1 Introduction to print profiles................................................................................................................................................11 1.3.2 Introduction to services .......................................................................................................................................................12
    [Show full text]
  • Copy — Copy file from Disk Or URL
    Title stata.com copy — Copy file from disk or URL Syntax Description Options Remarks and examples Also see Syntax copy filename1 filename2 , options filename1 may be a filename or a URL. filename2 may be the name of a file or a directory. If filename2 is a directory name, filename1 will be copied to that directory. filename2 may not be a URL. Note: Double quotes may be used to enclose the filenames, and the quotes must be used if the filename contains embedded blanks. options Description public make filename2 readable by all text interpret filename1 as text file and translate to native text format replace may overwrite filename2 replace does not appear in the dialog box. Description copy copies filename1 to filename2. Options public specifies that filename2 be readable by everyone; otherwise, the file will be created according to the default permissions of your operating system. text specifies that filename1 be interpreted as a text file and be translated to the native form of text files on your computer. Computers differ on how end-of-line is recorded: Unix systems record one line-feed character, Windows computers record a carriage-return/line-feed combination, and Mac computers record just a carriage return. text specifies that filename1 be examined to determine how it has end-of-line recorded and that the line-end characters be switched to whatever is appropriate for your computer when the copy is made. There is no reason to specify text when copying a file already on your computer to a different location because the file would already be in your computer’s format.
    [Show full text]
  • Windows Command Prompt Cheatsheet
    Windows Command Prompt Cheatsheet - Command line interface (as opposed to a GUI - graphical user interface) - Used to execute programs - Commands are small programs that do something useful - There are many commands already included with Windows, but we will use a few. - A filepath is where you are in the filesystem • C: is the C drive • C:\user\Documents is the Documents folder • C:\user\Documents\hello.c is a file in the Documents folder Command What it Does Usage dir Displays a list of a folder’s files dir (shows current folder) and subfolders dir myfolder cd Displays the name of the current cd filepath chdir directory or changes the current chdir filepath folder. cd .. (goes one directory up) md Creates a folder (directory) md folder-name mkdir mkdir folder-name rm Deletes a folder (directory) rm folder-name rmdir rmdir folder-name rm /s folder-name rmdir /s folder-name Note: if the folder isn’t empty, you must add the /s. copy Copies a file from one location to copy filepath-from filepath-to another move Moves file from one folder to move folder1\file.txt folder2\ another ren Changes the name of a file ren file1 file2 rename del Deletes one or more files del filename exit Exits batch script or current exit command control echo Used to display a message or to echo message turn off/on messages in batch scripts type Displays contents of a text file type myfile.txt fc Compares two files and displays fc file1 file2 the difference between them cls Clears the screen cls help Provides more details about help (lists all commands) DOS/Command Prompt help command commands Source: https://technet.microsoft.com/en-us/library/cc754340.aspx.
    [Show full text]
  • Expression Definition FS.COMMAND Qualifier. Operates on a File System Command
    Expression Definition FS.COMMAND Qualifier. Operates on a file system command. The user can issue multiple commands on a file transfer portal. (For example, ls to list files or mkdir to create a directory). This expression returns the current action that the user is taking. Possible values: Neighbor, login, ls, get, put, rename, mkdir, rmdir, del, logout, any. Following is an example: Add authorization policy pol1 “fs.command eq login && (fs.user eq administrator || fs.serverip eq 10.102.88.221 –netmask 255.255.255.252)” allow FS.USER Returns the user who is logged on to the file system. FS.SERVER Returns the host name of the target server. In the following example, the string win2k3-88-22 is the server name: fs.server eq win2k3-88-221 FS.SERVERIP Returns the IP address of the target server. FS.SERVICE Returns a shared root directory on the file server. If a particular folder is exposed as shared, a user can directly log on to the specified first level folder. This first level folder is called a service. For example, in the path \\hostname\SERVICEX\ETC, SERVICEX is the service. As another example, if a user accesses the file \\hostname\service1\dir1\file1.doc, FS.SERVICE will return service1. Following is an example: fs.service notcontains New FS.DOMAIN Returns the domain name of the target server. FS.PATH Returns the complete path of the file being accessed. For example, if a user accesses the file \\hostname\service1\dir1\file1.doc, FS.PATHwill return \service\dir1\file1.doc. Following is an example: fs.path notcontains SSL Expression Definition FS.FILE Returns the name of the file being accessed.
    [Show full text]
  • Disk Clone Industrial
    Disk Clone Industrial USER MANUAL Ver. 1.0.0 Updated: 9 June 2020 | Contents | ii Contents Legal Statement............................................................................... 4 Introduction......................................................................................4 Cloning Data.................................................................................................................................... 4 Erasing Confidential Data..................................................................................................................5 Disk Clone Overview.......................................................................6 System Requirements....................................................................................................................... 7 Software Licensing........................................................................................................................... 7 Software Updates............................................................................................................................. 8 Getting Started.................................................................................9 Disk Clone Installation and Distribution.......................................................................................... 12 Launching and initial Configuration..................................................................................................12 Navigating Disk Clone.....................................................................................................................14
    [Show full text]
  • File Formats
    man pages section 4: File Formats Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054 U.S.A. Part No: 817–3945–10 September 2004 Copyright 2004 Sun Microsystems, Inc. 4150 Network Circle, Santa Clara, CA 95054 U.S.A. All rights reserved. This product or document is protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation. No part of this product or document may be reproduced in any form by any means without prior written authorization of Sun and its licensors, if any. Third-party software, including font technology, is copyrighted and licensed from Sun suppliers. Parts of the product may be derived from Berkeley BSD systems, licensed from the University of California. UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open Company, Ltd. Sun, Sun Microsystems, the Sun logo, docs.sun.com, AnswerBook, AnswerBook2, and Solaris are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the U.S. and other countries. Products bearing SPARC trademarks are based upon an architecture developed by Sun Microsystems, Inc. The OPEN LOOK and Sun™ Graphical User Interface was developed by Sun Microsystems, Inc. for its users and licensees. Sun acknowledges the pioneering efforts of Xerox in researching and developing the concept of visual or graphical user interfaces for the computer industry. Sun holds a non-exclusive license from Xerox to the Xerox Graphical User Interface, which license also covers Sun’s licensees who implement OPEN LOOK GUIs and otherwise comply with Sun’s written license agreements.
    [Show full text]
  • Mac Keyboard Shortcuts Cut, Copy, Paste, and Other Common Shortcuts
    Mac keyboard shortcuts By pressing a combination of keys, you can do things that normally need a mouse, trackpad, or other input device. To use a keyboard shortcut, hold down one or more modifier keys while pressing the last key of the shortcut. For example, to use the shortcut Command-C (copy), hold down Command, press C, then release both keys. Mac menus and keyboards often use symbols for certain keys, including the modifier keys: Command ⌘ Option ⌥ Caps Lock ⇪ Shift ⇧ Control ⌃ Fn If you're using a keyboard made for Windows PCs, use the Alt key instead of Option, and the Windows logo key instead of Command. Some Mac keyboards and shortcuts use special keys in the top row, which include icons for volume, display brightness, and other functions. Press the icon key to perform that function, or combine it with the Fn key to use it as an F1, F2, F3, or other standard function key. To learn more shortcuts, check the menus of the app you're using. Every app can have its own shortcuts, and shortcuts that work in one app may not work in another. Cut, copy, paste, and other common shortcuts Shortcut Description Command-X Cut: Remove the selected item and copy it to the Clipboard. Command-C Copy the selected item to the Clipboard. This also works for files in the Finder. Command-V Paste the contents of the Clipboard into the current document or app. This also works for files in the Finder. Command-Z Undo the previous command. You can then press Command-Shift-Z to Redo, reversing the undo command.
    [Show full text]
  • This Document Explains How to Copy Ondemand5 Data to Your Hard Drive
    Copying Your Repair DVD Data To Your Hard Drive Introduction This document explains how to copy OnDemand5 Repair data to your hard drive, and how to configure your OnDemand software appropriately. The document is intended for your network professional as a practical guide for implementing Mitchell1’s quarterly updates. The document provides two methods; one using the Xcopy command in a DOS window, and the other using standard Windows Copy and Paste functionality. Preparing your System You will need 8 Gigabytes of free space per DVD to be copied onto a hard drive. Be sure you have the necessary space before beginning this procedure. Turn off screen savers, power down options or any other program that may interfere with this process. IMPORTANT NOTICE – USE AT YOUR OWN RISK: This information is provided as a courtesy to assist those who desire to copy their DVD disks to their hard drive. Minimal technical assistance is available for this procedure. It is not recommended due to the high probability of failure due to DVD drive/disk read problems, over heating, hard drive write errors and memory overrun issues. This procedure is very detailed and should only be performed by users who are very familiar with Windows and/or DOS commands. Novice computers users should not attempt this procedure. Copying Repair data from a DVD is a time-consuming process. Depending on the speed of your processor and/or network, could easily require two or more hours per disk. For this reason, we recommend that you perform the actual copying of data during non-business evening or weekend hours.
    [Show full text]
  • “Log” File in Stata
    Updated July 2018 Creating a “Log” File in Stata This set of notes describes how to create a log file within the computer program Stata. It assumes that you have set Stata up on your computer (see the “Getting Started with Stata” handout), and that you have read in the set of data that you want to analyze (see the “Reading in Stata Format (.dta) Data Files” handout). A log file records all your Stata commands and output in a given session, with the exception of graphs. It is usually wise to retain a copy of the work that you’ve done on a given project, to refer to while you are writing up your findings, or later on when you are revising a paper. A log file is a separate file that has either a “.log” or “.smcl” extension. Saving the log as a .smcl file (“Stata Markup and Control Language file”) keeps the formatting from the Results window. It is recommended to save the log as a .log file. Although saving it as a .log file removes the formatting and saves the output in plain text format, it can be opened in most text editing programs. A .smcl file can only be opened in Stata. To create a log file: You may create a log file by typing log using ”filepath & filename” in the Stata Command box. On a PC: If one wanted to save a log file (.log) for a set of analyses on hard disk C:, in the folder “LOGS”, one would type log using "C:\LOGS\analysis_log.log" On a Mac: If one wanted to save a log file (.log) for a set of analyses in user1’s folder on the hard drive, in the folder “logs”, one would type log using "/Users/user1/logs/analysis_log.log" If you would like to replace an existing log file with a newer version add “replace” after the file name (Note: PC file path) log using "C:\LOGS\analysis_log.log", replace Alternately, you can use the menu: click on File, then on Log, then on Begin.
    [Show full text]
  • Basic STATA Commands
    Summer School on Capability and Multidimensional Poverty OPHI-HDCA, 2011 Oxford Poverty and Human Development Initiative (OPHI) http://ophi.qeh.ox.ac.uk Oxford Dept of International Development, Queen Elizabeth House, University of Oxford Basic STATA commands Typical STATA window Review Results Variables Commands Exploring your data Create a do file doedit Change your directory cd “c:\your directory” Open your database use database, clear Import from Excel (csv file) insheet using "filename.csv" Condition (after the following commands) if var1==3 or if var1==”male” Equivalence symbols: == equal; ~= not equal; != not equal; > greater than; >= greater than or equal; < less than; <= less than or equal; & and; | or. Weight [iw=weight] or [aw=weight] Browse your database browse Look for a variables lookfor “any word/topic” Summarize a variable (mean, standard su variable1 variable2 variable3 deviation, min. and max.) Tabulate a variable (per category) tab variable1 (add a second variables for cross tabs) Statistics for variables by subgroups tabstat variable1 variable2, s(n mean) by(group) Information of a variable (coding) codebook variable1, tab(99) Keep certain variables (use drop for the keep var1 var2 var3 opposite) Save a dataset save filename, [replace] Summer School on Capability and Multidimensional Poverty OPHI-HDCA, 2011 Creating Variables Generate a new variable (a number or a gen new_variable = 1 combinations of other variables) gen new_variable = variable1+ variable2 Generate a new variable conditional gen new_variable
    [Show full text]
  • Powerview Command Reference
    PowerView Command Reference TRACE32 Online Help TRACE32 Directory TRACE32 Index TRACE32 Documents ...................................................................................................................... PowerView User Interface ............................................................................................................ PowerView Command Reference .............................................................................................1 History ...................................................................................................................................... 12 ABORT ...................................................................................................................................... 13 ABORT Abort driver program 13 AREA ........................................................................................................................................ 14 AREA Message windows 14 AREA.CLEAR Clear area 15 AREA.CLOSE Close output file 15 AREA.Create Create or modify message area 16 AREA.Delete Delete message area 17 AREA.List Display a detailed list off all message areas 18 AREA.OPEN Open output file 20 AREA.PIPE Redirect area to stdout 21 AREA.RESet Reset areas 21 AREA.SAVE Save AREA window contents to file 21 AREA.Select Select area 22 AREA.STDERR Redirect area to stderr 23 AREA.STDOUT Redirect area to stdout 23 AREA.view Display message area in AREA window 24 AutoSTOre ..............................................................................................................................
    [Show full text]