Command Window – Basic Commands

Total Page:16

File Type:pdf, Size:1020Kb

Command Window – Basic Commands Command Window – Simple Commands help lists all commands p: switch to your P-drive c: switch to the computer’s C-drive dir list all files in a directory (aka “folder”); e.g. dir (list all files in current directory) dir myfolder (list all files in subdirectory myfolder) cd change directory; e.g. cd myfolder (move to subdirectory myfolder) cd .. (move up one directory level) md make (create) a directory; e.g. md myfolder (make a subdirectory called myfolder) copy copy files; e.g. copy oldfile newfile copy source.f90 myfolder\source.f90 ren rename files; e.g. ren oldfile newfile erase erase (delete) a file; e.g. (or del) erase unwanted.txt fc file compare; e.g. fc file1 file2 type list the contents of a file type somefile.txt type somefile.txt ¦ more (list contents, one page at a time) Wildcards (* and ?) Can be used to match length-unspecified strings (*) or individual letters (?); e.g. copy *.f90 *.bak dir solve.f?? Command Syntax and Options Most commands have various options; e.g. dir /p – list files, one page at a time To find the syntax and options available for any particular command use the /? option; e.g. dir /? History Use the and arrows on keyboard to recover previous commands. Use F7 to get a list of previous commands and arrow up and down to choose one to reissue. Editors An editor called notepad comes with the operating system: notepad myfile.f90 Running Programs You can run any program simply by typing its name; e.g. to run windows explorer: explorer Batch Files To avoid having to type a long sequence of commands it is convenient to put them all in a batch file – identified by the .bat extension. This sequence is then run, one after the other, by typing the name of the batch file. Fortran Command Window Basics David Apsley .
Recommended publications
  • 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]
  • TRSDOS 6.2 to LS-DOS 6.3.0 Manual Update
    LS-DOSÔ 6.3 UPDATE FOR TRSDOSâ 6.2.X The LS-DOS 6.3 release is an upgrade for the TRSDOS 6.2 operating system. Several important changes have been made to extend and enhance the operating system and its utilities. The date ranging has been expanded to accept dates through the year 1999. Files will now carry a modification time as well as a date. The DATECONV/CMD program is provided to translate version 6.2 or earlier disks to the 6.3 style dating. The user password has been eliminated from the system. The owner password still remains. The library command ID was added to display a customer service number. Several enhancements have been made to BASIC. The new DISKCOPY/CMD program will duplicate 5" double density floppy disks. Because the LS-DOS 6.3 update is a series of enhancements to TRSDOS 6.2, the primary documentation remains the 6.2 manual and Technical Reference manual. If you have a version of TRSDOS earlier than 6.2, you can obtain the manuals from Radio Shack under the catalog numbers 26-0316 (TRSDOS Version 6 [6.2 DOS manual and disk]), 26-2110 (Model 4/4D [6.2] Technical Reference Manual), or 26-1117 (6.2 DOS manual only). This documentation should be treated as an addendum to the TRSDOS 6.2 information. LS-DOS 6.3 installation instructions Before performing the upgrade, it is recommended that you make several backup copies of the 6.3 master disk. The simplest way to do this is to boot your system using the 6.3 diskette, insert a blank diskette to receive the copy in drive 1, and type the command: DISKCOPY :0 :1 When the copy finishes, you can insert another destination diskette and make another copy.
    [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]
  • Session 1171-2017
    Paper 1171-2017 Let SAS® Do Your DIRty Work Richann Watson, Experis ABSTRACT Making sure that you have saved all the necessary information to replicate a deliverable can be a cumbersome task. You want to make sure that all the raw data sets and all the derived data sets, whether they are Study Data Tabulation Model (SDTM) data sets or Analysis Data Model (ADaM) data sets, are saved. You prefer that the date/time stamps are preserved. Not only do you need the data sets, you also need to keep a copy of all programs that were used to produce the deliverable, as well as the corresponding logs from when the programs were executed. Any other information that was needed to produce the necessary outputs also needs to be saved. You must do all of this for each deliverable, and it can be easy to overlook a step or some key information. Most people do this process manually. It can be a time-consuming process, so why not let SAS® do the work for you? INTRODUCTION Making a copy of all information needed to produce a deliverable is time-consuming and is normally done using • Windows® Explorer: copy and paste to a new folder for archiving • Command interpreter (CMD shell)*: copy or move commands Both of these methods require you to create an archive directory and either copy or move the files manually. Most people go the route of using Windows Explorer due to familiarity. This can tie up your computer while the files are being archived. CMD is faster and commands can be set to run in the background if you know how to access CMD and know the necessary commands.
    [Show full text]
  • Pingdirectory Administration Guide Version
    Release 7.3.0.3 Server Administration Guide PingDirectory | Contents | ii Contents PingDirectory™ Product Documentation................................................ 20 Overview of the Server............................................................................. 20 Server Features.................................................................................................................................20 Administration Framework.................................................................................................................21 Server Tools Location....................................................................................................................... 22 Preparing Your Environment....................................................................22 Before You Begin.............................................................................................................................. 22 System requirements..............................................................................................................22 Installing Java......................................................................................................................... 23 Preparing the Operating System (Linux).......................................................................................... 24 Configuring the File Descriptor Limits.................................................................................... 24 File System Tuning.................................................................................................................25
    [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]
  • UNIX and the Shells
    UNIX and the Shells Ole Peter Smith, IME, UFG, [email protected] 24/04/2010 Life sure is a Mystery to be Lived Not a Problem to be Solved... Ole Peter Smith, IME, UFG, [email protected] () UNIX and the Shells 24/04/2010 1 / 13 Beautiful Scientific Documents Classical Free Software Markup Language Thesis, automatic: · Bibliography · Contents · List of Tables, Figures · Index, References Slideshows: Beamer SL! MikTex, LyX, TexMaker, Kyle ^ Ole Peter Smith, IME, UFG, [email protected] () UNIX and the Shells 24/04/2010 2 / 13 Introdu¸c~ao UNIX vs. Linux Shell: Concha Bash: Bourne-Again Shell Csh: C Shell Ssh: Secure Shell · Remote Administration · File Transfer O mais importante n~ao´esaber de tudo O mais importante ´esaber onde pesquisar! Ole Peter Smith, IME, UFG, [email protected] () UNIX and the Shells 24/04/2010 3 / 13 File Commands List: ls - ls -l - ls -a - ls -tlF Usage: man command Criate: touch Move or rename: mv Copy: cp - cp -p - cp -r Remove: rm - rm -f (take care!!!!) - rm -r Content: cat Edit: vi or vim Symbolic Link: ln -s Ole Peter Smith, IME, UFG, [email protected] () UNIX and the Shells 24/04/2010 4 / 13 Notable Files & Directories System Configuration dir: /etc User Configuration dir, Home: '~/' (or '/home/$user') Users: /etc/passwd -: user - uid - gid - shell - home - Gecho Groups: /etc/group -: gname - gid - members Known hosts /etc/hosts -: ip - hostname - hostname... File systems /etc/fstab -: dev mount-point - fs-type - options Network services /etc/services -: service-name - port/protocol /usr, /var, /home,..
    [Show full text]
  • Mkdir / MD Command :- This Command Is Used to Create the Directory in the Dos
    Department Of Computer Application (BBA) Dr. Rakesh Ranjan BCA Sem - 2 Operating system Mkdir / MD Command :- this command is used to create the directory in the dos . we can also create subdirectory within the directory by this command . we have to give path of the proposed directory to create. Syntax : c:\> mkdir abc This command create the directory abc on the c: drive C:\> md abc\cde It create subdirectory cde under abc directory C:\> md abc\pqr C:\md abc\cde\a C:\ md abc\cde\b C:\md abc\pqr\a C:\ md abc\pqr\b C:\md abc\pqr\a\c C:\ md abc\pqr\a\d The structure of the above created directory may be shown as ABC CDE PQR A B A B C D Tree command :- this command in dos is used to display the structure of the directory and subdirectory in DOS. C:\> tree This command display the structure of c: Drive C:\> tree abc It display the structure of abc directory on the c: drive Means that tree command display the directory structure of the given directory of given path. RD Command :- RD stands for Remove directory command . this command is used to remove the directory from the disk . it should be noted that directory which to be removed must be empty otherwise , can not be removed . Syntax :- c:\ rd abc It display error because , abc is not empty C:\ rd abc\cde It also display error because cde is not empty C:\ rd abc\cde\a It works and a directory will remove from the disk C:\ rd abc\cde\b It will remove the b directory C:\rd abc\cde It will remove the cde directory because cde is now empty.
    [Show full text]
  • Great Lakes Cheat Sheet Less File Prints Content of File Page by Page Guide to General L Inux (Bash) a Nd S Lurm C Ommands Head File Print First 10 Lines of File
    Viewing and editing text files cat file Print entire content of file Great Lakes Cheat Sheet less file Prints content of file page by page Guide to general L inux (Bash) and S lurm c ommands head file Print first 10 lines of file tail file Print last 10 lines of file Accessing Great Lakes nano Simple, easy to use text editor Logging in from a terminal (Duo required) vim Minimalist yet powerful text editor ssh uniqname @greatlakes.arc-ts.umich.edu emacs Extensible and customizable text editor Transferring files between Great Lakes and your system scp input uniqname@ greatlakes-xfer.arc-ts.umich.edu: output Advanced file management scp -r i nput uniqname@ greatlakes-xfer.arc-ts.umich.edu:o utput scp uniqname@ greatlakes-xfer.arc-ts.umich.edu:i nput output chmod Change read/write/execute permissions which cmd List the full file path of a command GUI Clients PuTTY SSH client for Windows whereis cmd List all related file paths (binary, source, manual, etc.) of a command WinSCP SCP client for Windows du dir List size of directory and its subdirectories FileZilla FTP client for Windows, Mac, and Linux find Find file in a directory Basic Linux file management Aliases and system variables man command Display the manual page for command alias Create shortcut to command pwd Print out the present working directory env Lists all environment variables ls List the files in the current directory export var = val Create environment variable $ var with value ls -lh Show long, human-readable listing val ls dir List files inside directory dir echo $var Print the value of variable $var rm file Delete file .bashrc File that defines user aliases and variables mkdir dir Create empty directory called dir Input and output redirection rmdir dir Remove empty directory dir $( command) Runs command first, then inserts output to the rm -r dir Remove directory dir and all contents rest of the overall command cd dir Change working directory to dir < Standard input redirection cd .
    [Show full text]
  • Freebsd Command Reference
    FreeBSD command reference Command structure Each line you type at the Unix shell consists of a command optionally followed by some arguments , e.g. ls -l /etc/passwd | | | cmd arg1 arg2 Almost all commands are just programs in the filesystem, e.g. "ls" is actually /bin/ls. A few are built- in to the shell. All commands and filenames are case-sensitive. Unless told otherwise, the command will run in the "foreground" - that is, you won't be returned to the shell prompt until it has finished. You can press Ctrl + C to terminate it. Colour code command [args...] Command which shows information command [args...] Command which modifies your current session or system settings, but changes will be lost when you exit your shell or reboot command [args...] Command which permanently affects the state of your system Getting out of trouble ^C (Ctrl-C) Terminate the current command ^U (Ctrl-U) Clear to start of line reset Reset terminal settings. If in xterm, try Ctrl+Middle mouse button stty sane and select "Do Full Reset" exit Exit from the shell logout ESC :q! ENTER Quit from vi without saving Finding documentation man cmd Show manual page for command "cmd". If a page with the same man 5 cmd name exists in multiple sections, you can give the section number, man -a cmd or -a to show pages from all sections. man -k str Search for string"str" in the manual index man hier Description of directory structure cd /usr/share/doc; ls Browse system documentation and examples. Note especially cd /usr/share/examples; ls /usr/share/doc/en/books/handbook/index.html cd /usr/local/share/doc; ls Browse package documentation and examples cd /usr/local/share/examples On the web: www.freebsd.org Includes handbook, searchable mailing list archives System status Alt-F1 ..
    [Show full text]
  • Windows Command Line?
    Table of contents 1. Why an ebook on the Windows Command Line? 2. Make an example directory 3. A little exercise: open the Windows Command Prompt window and go to the example directory 3.1 The prompt 3.2 Moving into a (sub)directory 4. Pattern-matching 5. Command ‘DIR’ and Glob patterns 6. The ‘COPY’ command and Glob patterns 6.1 Copy files from the current directory into a subdirectory 6.2 Copy files from the current directory into a subdirectory in binary mode 6.3 Combine ASCII-files and put the result into a subdirectory 6.4 Combine binary files and put the result into a subdirectory 6.5 Are the files copied correctly? 6.6 Copy a selection of files with the ‘FOR’ loop 7. The ‘DEL’ command and Glob patterns 7.1 Delete files from the current directory 7.2 Delete files from the subdirectory ‘my Doc’ -1 7.3 Delete files from the subdirectory ‘my Doc’ -2 7.3.1 An alternative 7.3.2 ROBOCOPY 8. Passing multiple commands 9. The ‘REN’ or ‘RENAME’ command 9.1 Change subdirectory name 9.2 Change file extensions 9.3 Modify filenames from the current directory: basic examples 9.4 Truncate a filename by using ‘?’ 9.5 Modify filenames in the subdirectory ‘my Doc’: basic example 10. More complex replacements 10.1 Add a prefix to filenames with the same characters at the beginning 10.2 Add a prefix to filenames with the same extensions 10.3 Add a suffix at the end of filenames with the same extensions 10.4 Substitute a character in a specific position 11.
    [Show full text]
  • Ch 7 Using ATTRIB, SUBST, XCOPY, DOSKEY, and the Text Editor
    Using ATTRIB, SUBST, XCOPY, DOSKEY, and the Text Editor Ch 7 1 Overview The purpose and function of file attributes will be explained. Ch 7 2 Overview Utility commands and programs will be used to manipulate files and subdirectories to make tasks at the command line easier to do. Ch 7 3 Overview This chapter will focus on the following commands and programs: ATTRIB XCOPY DOSKEY EDIT Ch 7 4 File Attributes and the ATTRIB Command Root directory keeps track of information about every file on a disk. Ch 7 5 File Attributes and the ATTRIB Command Each file in the directory has attributes. Ch 7 6 File Attributes and the ATTRIB Command Attributes represented by single letter: S - System attribute H - Hidden attribute R - Read-only attribute A - Archive attribute Ch 7 7 File Attributes and the ATTRIB Command NTFS file system: Has other attributes At command line only attributes can change with ATTRIB command are S, H, R, and A Ch 7 8 File Attributes and the ATTRIB Command ATTRIB command: Used to manipulate file attributes Ch 7 9 File Attributes and the ATTRIB Command ATTRIB command syntax: ATTRIB [+R | -R] [+A | -A] [+S | -S] [+H | -H] [[drive:] [path] filename] [/S [/D]] Ch 7 10 File Attributes and the ATTRIB Command Attributes most useful to set and unset: R - Read-only H - Hidden Ch 7 11 File Attributes and the ATTRIB Command The A attribute (archive bit) signals file has not been backed up. Ch 7 12 File Attributes and the ATTRIB Command XCOPY command can read the archive bit.
    [Show full text]