Free Essay

Vi Commands for Unix

In:

Submitted By brysfb
Words 1301
Pages 6
vi commands
The following tables contain all the basic vi commands.
Starting vi
|Command |Description |
|vi file |start at line 1 of file |
|vi +n file |start at line n of file |
|vi +$ file |start at last line of file |
|vi +/pattern file |start at pattern in file (do not insert a space between the ``+'' and ``/'' characters. |
|vi -r file |recover file after a system crash |

Saving files and quitting vi
|Command |Description |
|:e file |edit file (save current file with :w first) |
|:w |save (write out) the file being edited |
|:w file |save as file |
|:w! file |save as an existing file |
|:q |quit vi |
|:wq |save the file and quit vi |
|:x |save the file if it has changed and quit vi |
|:q! |quit vi without saving changes |

Moving the cursor
|Keys pressed |Effect |
|h |left one character |
|l or |right one character |
|k |up one line |
|j or |down one line |
|b |left one word |
|w |right one word |
|( |start of sentence |
|) |end of sentence |
|{ |start of paragraph |
|} |end of paragraph |
|1G |top of file |
|nG |line n |
|G |end of file |
|W |first character of insertion |
|U |up ½ screen |
|D |down ½ screen |
|B |up one screen |
|F |down one screen |

Inserting text
|Keys pressed |Text inserted |
|a |after the cursor |
|A |after last character on the line |
|i |before the cursor |
|I |before first character on the line |
|o |open line below current line |
|O |open line above current line |

Changing and replacing text
|Keys pressed |Text changed or replaced |
|cw |word |
|3cw |three words |
|cc |current line |
|5cc |five lines |
|r |current character only |
|R |current character and those to its right |
|s |current character |
|S |current line |
|[pic] |switch between lowercase and uppercase |

Deleting text
|Keys pressed |Text deleted |
|x |character under cursor |
|12x |12 characters |
|X |character to left of cursor |
|dw |word |
|3dw |three words |
|d0 |to beginning of line |
|d$ |to end of line |
|dd |current line |
|5dd |five lines |
|d{ |to beginning of paragraph |
|d} |to end of paragraph |
|:1,. d |to beginning of file |
|:.,$ d |to end of file |
|:1,$ d |whole file |

Using markers and buffers
|Command |Description |
|mf |set marker named ``f'' |
|`f |go to marker ``f'' |
|´f |go to start of line containing marker ``f'' |
|"s12yy |copy 12 lines into buffer ``s'' |
|"ty} |copy text from cursor to end of paragraph into buffer ``t'' |
|"ly1G |copy text from cursor to top of file into buffer ``l'' |
|"kd`f |cut text from cursor up to marker ``f'' into buffer ``k'' |
|"kp |paste buffer ``k'' into text |

Searching for text
|Search |Finds |
|/and |next occurrence of ``and'', for example, ``and'', ``stand'', ``grand'' |
|?and |previous occurrence of ``and'' |
|/^The |next line that starts with ``The'', for example, ``The'', ``Then'', ``There'' |
|/^The\> |next line that starts with the word ``The'' |
|/end$ |next line that ends with ``end'' |
|/[bB]ox |next occurrence of ``box'' or ``Box'' |
|n |repeat the most recent search, in the same direction |
|N |repeat the most recent search, in the opposite direction |

Searching for and replacing text
|Command |Description |
|:s/pear/peach/g |replace all occurrences of ``pear'' with ``peach'' on current line |
|:/orange/s//lemon/g |change all occurrences of ``orange'' into ``lemon'' on next line containing ``orange'' |
|:.,$/\ |end of a word |
|\ |quote a special character |
|\[pic] |the character ``[pic]'' |
|^ |beginning of a line |
|$ |end of a line |
|[set] |one character from a set of characters |
|[XYZ] |one of the characters ``X'', ``Y'', or ``Z'' |
|[[:upper:]][[:lower:]]* |one uppercase character followed by any number of lowercase characters |
|[^set] |one character not from a set of characters |
|[^XYZ[:digit:]] |any character except ``X'', ``Y'', ``Z'', or a numeric digit |

Options to the :set command
|Option |Effect |
|all |List settings of all options. |
|noautoindent |Prevent the preparation of structured program text. |
|autoprint |Display the current line after each ex copy, move, or substitute command. |
|noautowrite |Do not automatically write the contents of the modified buffer to the current file when you give a |
| |next, rewind, tag, or ``!'' command, or a ^ (switch files) or ] (goto tag) command. |
|nobeautify |Do not discard all control characters except , newline and formfeed from the input. |
|directory=/var/preserve |Set the default directory for the vi editing buffer. noedcompatible the absence of g and c suffixes|
| |on substitute commands is not remembered. |
|noerrorbells |Do not precede error messages with a bell. |
|hardtabs=8 |Set the boundaries on which terminal hardware tabs are set or on which tabs the system expands. |
|noignorecase |Do not map all uppercase characters to thier lowercase equivalent. |
|nolisp |Do not autoindent to indent appropriately for LISP code. |
|nolist |Do not display the tabs and end of line characters. |
|magic |With nomagic set, the number of regular expression metacharacters is greatly reduced, with only |
| |caret ``^'' and dollar sign ``$'' having special effects. In addition, the metacharacters tilde |
| |``~'' and ampersand ``&'' in replacement patterns are treated as normal characters. |
|mesg |Prevent other users writing to your screen with the UNIX write command and scrambling your screen |
| |as you edit. |
|nomodelines |Disable the first five and last five lines of a file being read in to be interpreted as vi or ex |
| |commands. |
|nonumber |Do not display output lines with their line numbers. |
|nooptimize |Allow the terminal perform automatic carriage returns when displaying more than one line of output.|
|paragraphs=IPLPPPQPP LIpplpipnpb |Set the paragraph delimiters for the { and } operations. |
|prompt |Force ex input to be prompted for with a colon ``:''. |

|redraw |Simulate (using great amounts of output) an intelligent terminal on a dumb terminal. |
|remap |Mapped characters are repeatedly tried until they are unchanged. For example, if o is mapped to O and O |
| |is mapped to I, o will map to I if remap is set, and to O if noremap is set. |
|report=5 |Set the threshold for feedback from commands. |
|scroll=11 |The number of logical lines scrolled when -D is received from a terminal input. |
|sections=NHSHH HUuhsh+c |Set the section macros for the [[ and ]] operations. |
|shell=/usr/bin/ksh |Set the pathname of the shell forked for the shell escape ``!'' command, and by the shell command. |
|shiftwidth=8 |Set the width of a software tab stop, used in reverse tabbing with -D when using autoindent to |
| |append text, and by the shift commands. |
|noshowmatch |When a ``)'' or ``}'' is typed, move the cursor to the matching ``('' or ``{'' for one second if this |
| |matching character is on the screen. |
|noshowmode |Prevent the message ``INPUT MODE'' from being displayed on the lower right corner of the screen when |
| |insert mode is activated. |
|noslowopen |Enable the display of updates during inserts. |
|tabstop=8 |Expand tabs in the input file to be on n boundaries for the purposes of display. |
|taglength=0 |Accept the first n characters in a tag name to be significant, but all others to be ignored. |
|tags=tags /usr/lib/tags |Set a path of files to be used as tag files for the tag command. |
|term=value of shell TERM variable |Set the terminal type of the output device. |
|timeout |Set the milliseconds to wait for subsequent input characters. |
|warn |Display ``[No write since last change]'' before a shell escape command (!) if file has not been saved. |
|window=23 |Set the number of lines in a text window. |
|wrapscan |Search using the regular expressions in addressing wrap around past the end of the file. |
|wrapmargin=0 |Define the margin for automatic insertion of newlines during text input. |
|nowriteany |Perform all checks normally made before write commands. |

[pic]

Bonus for Script Writing: 1. We get line numbers in vi using :set nu great for shell scripting 2. Use vim instead of vi to show the syntax color. You must add #!/bin/bash to the first line of the script.

Taken from: http://uw713doc.sco.com/en/FD_create/vi_commands.html

Similar Documents

Premium Essay

Unix/Linux Comparison Matrix

...Unix® and Linux® Comparison Matrix - 5 Marks 1. Name three versions of Unix 1. BSD/OS 2. AIX 3. Solaris 2. Name three versions of Linux 1. Canonical's Ubuntu 2. Novell's openSUSE 3. Red Hat's Fedora 3. Describe 3 major differences between Unix and Linux 1. Cost- Linux is free and Different flavors of UNIX have different cost structures according to vendors. 2. Linux is an example of Open Source software and UNIX is a closed source OS. 3. Text mode interface: Linux- BASH (Bourne Again SHell) is the Linux default shell. It can support multiple command interpreters. UNIX- Originally the Bourne Shell; now it's compatible with many others including BASH, Korn & C. 4. Which of the following is not a UNIX or Linux variant a. SunOS b. RedHat c. DOS d. HP-UX e. Debian 5. Use the command to change directory locations. a. cd b. rm c. mkdir d. cut 6. Use the command to delete a directory. a. delete_dir b. mkdir c. rmdir d. cat 7. Which of the following are text editors? (Choose all that apply.) a. vi b. emacs c. ls d. cat 8. The command creates a directory named winchester in the root directory. a. mkdir /winchester b. mkdir ../Winchester c. mkdir \winchester d. md /Winchester 9. The command allows you...

Words: 378 - Pages: 2

Free Essay

Sociology

...http://jozefg.ecs.fullerton.edu/public/CS906/Assignment/ |Ass # |Text Chapter |ASSIGNMENT CPSC 906 FALL 2004 |Due |Max Points | | | |Section 1 | | | | | |Note: Please provide the program assignment documentation according to | | | | | |SyllabusCS901.doc and Project Submittals.doc. | | | |1 |Ch1 |Problems: 26 p.69. Unit conversion. |09-09 |2 | | |Ch2 |Problems: 4 p.153. Stacks separated | | | |2 |Ch2 - 3 |See the exercise assignment description below |09-21 |3 | | | | |Tue | | |3 |Ch2 |Problem: 39 p.156 - provide a Gantt chart for each case and calculate AWT,| 09-30 |3 | | | |ATT and ART. Problems 44. |Thu | | | | |Provide the solution in the PowerPoint slides...

Words: 5471 - Pages: 22

Free Essay

Linux

...CSCI 1483 Intro to UNIX/Linux Ch 1-5 Slide Objectives for Midterm exam prep Ch 1 Objectives * Define OSs, including PC and server OSs * Describe the UNIX and Linux operating systems * Explain the purpose of UNIX/Linux shells * Discuss how to select user names and passwords * Connect to UNIX/Linux using Telnet or SSH * Use basic *nix commands & editing features * Explain the role of a system administrator * Change your password for security * Use multiple commands to view the contents of files * Redirect output to a file Ch 2 Objectives * Discuss UNIX/Linux FSs and list several examples * State the standard tree structure * Define partition and list 3 recommended ones for *nix * What are inodes, and what is stored in them? * Describe contents of: /boot, /bin, /dev, /home, /lib, /mnt, /media, /proc, /root, /sbin, /tmp, /usr, and /var * State purpose of the mount and umount commands * State the path (pathnames) to any file, and prompts * List commands to do the following: * Navigate the FS, create and remove directories, copy and delete files, configure file permissions Ch 3 Objectives * Compare ASCII, binary, and executable files * Understand the types of editors * Tell how to enter the 3 modes of the vi editor * Be able to create and edit files using the vi editor * Be able to create and edit files using the Emacs editor * Nothing to submit for these last 2 objectives ...

Words: 397 - Pages: 2

Free Essay

Homework Chp 1

...using vi and have the following content in the file -- Please pay attention to put space character between the first and last name for each person below. (hint for the upcoming questions: the default delimeter for the paste and cut commands is TAB character not space character). john smith alice wonderland sam blue 2. Write a unix command to print first name of each person in the fullNames.txt file to the screen. cut –f1 fullNames.txt 3. Write a unix command to create a file called firstNames.txt from the fullNames.txt file. This file should have the first name of each person per line. Cut –f1 fullNames.txt > firstNames.txt 4. Write a unix command to print last name of each person in the fullNames.txt file to the screen Cut –f2 fullNames.txt > lastNames.txt 5. Write a unix command to create a file called lastNames.txt from the fullNames.txt file. This file should have the last name of each person per line. Cut –f2 fullNames.txt > lastNames.txt 6. Use a unix command to print the combined firstNames.txt and lastNames.txt files to the screen in a way that each line has the first and las name of one person delimited using : symbol. For instance, the first line to appear on the screen should be john:smith join firstNames.txt lastNames.txt 7. Modify your unix command in step 6 so that the lines are written to another file called newFullNames.txt rather than on the screen. Join firstNames.txt lastNames.txt > newFullnames.txt 8. Write a unix command...

Words: 297 - Pages: 2

Premium Essay

Programming in Unix

...Programming in Unix Introduction to Sociology In today’s society, computers have played a major part of how corporations and individuals conduct business. In a sense, they have made some of the hardest tasks fairly easy by the click of a button or by typing a certain command. Computer programs perform both simple and complex calculations with user seeing the end result. However, computer programs have to be written by computer programmers. To understand how programs work, you must consider how the computer interprets the information entered by the programmer. “A program is a set of instructions that guide the computer in performing its basic and logical arithmetic operations (Afzal, 2008, p. 349).” These programs have to be written in a certain language for the computer to interpret. There are several types of languages used to write programs. Although the programmer types words and numbers to perform these mathematical and logical calculations, the computer sees only 1’s and 0’s. This is called machine language. There is also assembler language. “Instead of a series of zeros and ones, assembler language uses some recognized symbols, called mnemonics (memory aids), to represent instructions (Afzal, 2008, p. 349).” High level language is the language in which the programmer desires to write in such as Pascal, C++, C, and Java to name a few. To translate a high level language to machine language, a compiler or an interpreter must be used. The first step...

Words: 1049 - Pages: 5

Premium Essay

Cis 155 Midterm

...* | | | Match the following VI commands to the corresponding descriptions.Answer | | | | | Question | Correct Match | Selected Match | Searches backward through a file | l. ? | l. ? | Deletes a line | m. dd | m. dd | Opens a line above the current line | f. O | f. O | Repeats the last text changes | k. . (dot) | k. . (dot) | Opens a line below the current line | b. o | b. o | Exits the vi editor and saves the file | d. wq | d. wq | Exits the vi editor without saving the file | e. q! | e. q! | Deletes a character indicated by the cursor position | i. x | i. x | Undoes the recent changes on the current line | n. u | n. u | Replaces character(s) and places vi in the text input mode | h. R | h. R | Places the cursor at the end of the current line | a. $ | a. $ | Places the cursor at the beginning of the current line | g. 0 (zero) | g. 0 (zero) | Moves the cursor one word forward | j. w | j. w | Places the vi editor in the command mode | c. Esc | c. Esc | Undoes all changes on the current line | o. U | o. U | | | | | | * Question 2 5 out of 5 points | | | Gb is about one billion bytes.Answer | | | | | Selected Answer: | True | Correct Answer: | True | | | | | * Question 3 5 out of 5 points | | | In the operating system model the service layer translates the service requests from users/programs and passes them to the kernel layer.Answer | | | | | Selected Answer: | True | Correct Answer: | True | | | | |...

Words: 784 - Pages: 4

Free Essay

Unix/Linux Versus Mac Versus Windows

...Learning Team Outline POS 355, Outline of the UNIX/Linux Versus Mac versus Windows Paper I. Memory management a. UNIX®/Linux® i. Memory ii. Memory Management iii. Aging iv. Life Cycle b. Mac® v. Organization of memory vi. System Heap vii. System Global Variables viii. Temporary Memory ix. Pointers x. Invalid Handlers xi. Low-Memory Conditions xii. Virtual Memory c. Microsoft® Windows® Operating systems xiii. Paging in x86 processor xiv. Page Management xv. Memory Protection xvi. Logical Memory Layout II. Process management d. UNIX®/Linux® xvii. Process management within the UNIX OS is based of command prompts via Linux Terminal. xviii. Top ten commands that are helpful in process management * Top * Htop * Ps * Pstree * Kill * Pgrep * Pkill & killall * Renice * Xkill e. Mac® xix. Activity Monitor: process manager within the Mac OS. xx. User interaction and efficiency how does Activity Manager help. f. Microsoft® Windows® Operating systems xxi. Task Manager xxii. User interaction and efficiency how does Task Manager help and or is less effective than Activity Manager. III. File management xxiii. Compare and contrast how file management operates respectively...

Words: 307 - Pages: 2

Free Essay

Linux Cli Paper

...1) bash- is a Unix shell written by Brian Fox for the GNU Project as a free software replacement for the Bourne shell. Released in 1989, it has been distributed widely as the shell for the GNU operating system and as the default shell on Linux, Mac OS X and Darwin. 2) bsh- (Bourne shell) was the default Unix shell of Unix Version 7. Developed by Stephen Bourne at AT&T Bell Laboratories, it was a replacement for the Thompson shell. It was released in 1977 in the Version 7 Unix release distributed to colleges and universities. 3) tcsh- is a Unix shell based on and compatible with the C shell (csh). It is essentially the C shell with programmable command line completion, command-line editing, and a few other features. 4) csh- is a Unix shell that was created by Bill Joy while a graduate student at University of California, Berkeley in the 1970s. Other early contributors to the ideas or the code were Michael Ubell, Eric Allman, Mike O'Brien and Jim Kulp. The C shell is a command processor typically run in a text window, allowing the user to type commands. The C shell can also read commands from a file, called a script. 5) ksh- is a Unix shell which was developed by David Korn at Bell Labs in the early. Other early contributors were Bell Labs developers Mike Veach and Pat Sullivan, who wrote the Emacs- and vi-style line editing modes′ code, respectively. KornShell is backward-compatible with the Bourne shell and includes many features of the C shell, inspired...

Words: 1015 - Pages: 5

Free Essay

Linux

...Syllabus College of Information Systems & Technology POS/420 Version 9 Introduction to UNIX® | |Copyright © 2010, 2009, 2008, 2006, 2005, 2004, 2001, 2000 by University of Phoenix. All rights reserved. Course Description This course is a survey of the UNIX® operations. The student will gain an understanding of the internal operations of the UNIX® system, which enables the user to make efficient use of files, file systems, and processes. Commands for efficient management of UNIX® system files, file systems and process, systems administration and security are also examined. Policies Faculty and students/learners will be held responsible for understanding and adhering to all policies contained within the following two documents: • University policies: You must be logged into the student website to view this document. • Instructor policies: This document is posted in the Course Materials forum. University policies are subject to change. Be sure to read the policies at the beginning of each class. Policies may be slightly different depending on the modality in which you attend class. If you have recently changed modalities, read the policies governing your current class modality. Course Materials Blum, R. (2008). Linux® command line and shell scripting bible. Indianapolis, IN: Wiley. Love, P., Merlino, J., Zimmerman, C., Reed, J. C., & Weinstein, P. (2005). Beginning Unix®. Indianapolis, IN: Wiley. Software RedHat Linux 5 (Virtual Desktop) Article...

Words: 1560 - Pages: 7

Free Essay

Realization

...| | | | | Selected Answer: |  d.  all of the above | Correct Answer: |  d.  all of the above | | | | |  Question 4 10 out of 10 points | | | About 95 percent of the UNIX operating system is written in C language.Answer | | | | | Selected Answer: |  True | Correct Answer: |  True | | | | |  Question 5 10 out of 10 points | | | The two major versions of the UNIX operating system are AT&T's UNIX version V and Berkeley UNIX.Answer | | | | | Selected Answer: |  True | Correct Answer: |  True | | | | |  Question 6 10 out of 10 points | | | You must login to use the system. It means that, in response to prompts you type your user Id and password.Answer | | | | | Selected Answer: |  True | Correct Answer: |  True | | | | |  Question 7 10 out of 10 points | | | You can change your password as many times as you wish.Answer | | | | | Selected Answer: |  True | Correct Answer: |  True | | | | |  Question 8 10 out of 10 points | | | The option part in the command line who -H am i isAnswer | | | | | Selected Answer: |  c.  -H | Correct Answer: |  c.  -H | | | | |  Question 9 0 out of 10 points | | | The vi editor Answer | | | | | Selected Answer:...

Words: 285 - Pages: 2

Premium Essay

Computer Book

...The Linux Command Line Second Internet Edition William E. Shotts, Jr. A LinuxCommand.org Book Copyright ©2008-2013, William E. Shotts, Jr. This work is licensed under the Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License. To view a copy of this license, visit the link above or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA. Linux® is the registered trademark of Linus Torvalds. All other trademarks belong to their respective owners. This book is part of the LinuxCommand.org project, a site for Linux education and advocacy devoted to helping users of legacy operating systems migrate into the future. You may contact the LinuxCommand.org project at http://linuxcommand.org. This book is also available in printed form, published by No Starch Press and may be purchased wherever fine books are sold. No Starch Press also offers this book in electronic formats for most popular e-readers: http://nostarch.com/tlcl.htm Release History Version 13.07 09.12 09.11 09.10 Date July 6, 2013 December 14, 2009 November 19, 2009 October 3, 2009 Description Second Internet Edition. First Internet Edition. Fourth draft with almost all reviewer feedback incorporated and edited through chapter 37. Third draft with revised table formatting, partial application of reviewers feedback and edited through chapter 18. Second draft incorporating the first editing pass. Completed first draft. 09.08 09...

Words: 100185 - Pages: 401

Free Essay

Case Project

...Running head: Case Project Case Project Student College Case Project Linux as an operating system is a powerful tool used in businesses for its secure kernel and command line interface. From a small business to a large enterprise, Linux is used to run servers, store vital information and documents. In Outdoor Adventures, this store needs a more efficient computing system. The system will need to keep information available and secure enough to ensure that the information can only be seen by the right people. To help keep things organized, a file structure will also be required to keep all the files with special permissions together for easy access. To better illustrate the security capabilities of Linux Ed Sawicki of Biznix.org said, “The Linux firewall has functionality that rivals expensive commercial firewalls. Its rules allow fine grained control over stateless and stateful packet filtering. The Linux firewall is extensible, allowing new filtering capabilities as the need arises.” This comparison is powerful when considering what would be the most cost effective direction for a business, but also the safest. Another advantage of linux is that it is generally free to try before applying it to a commercial setting. The product can in effect speak for its self by allowing itself to be made publicly available so there is no need to consider it a “business risk” when a technician can experiment with it first before applying it on a much grander scale. “Linux…is...

Words: 1333 - Pages: 6

Free Essay

Stuff

...configuration and management of a Linux operating system will be explored. Focus will be on functions that resemble the UNIX environment. Directory and file management, user account management and certain device management (such as drives, printers, interface cards, etc.) will be discussed. Prerequisite(s) and/or Corequisite(s): Prerequisite: IT103 Operating Systems Credit hours: 4 Contact hours: 50 (30 Theory Hours, 20 Lab Hours) Syllabus: Linux Operating System Instructor | Jerry Black | Office Hours | Thursday, 4PM-6PM | Class Hours | Monday, 6:00PM – 10:20PM | Contact | Ms. Travis, 937-264-7707 | | jblack@itt-tech.edu | Major Instructional Areas 1. Introduction to Linux 2. Linux installation 3. Graphical user interface (GUI) desktops 4. Command-line interface (CLI) essentials 5. Hardware configuration: display, network, and printer 6. Networking: Resource sharing and remote access 7. Backup and restore utilities 8. Installing software in Linux 9. Scripting: Bourne Again Shell (bash) and Perl 10. Apache Web Server installation and configuration Course Objectives 1. Discuss the history and unique characteristics of the Linux operating system. 2. Perform an installation of Linux. 3. Use the components and features of the GNOME desktop environment. 4. Perform basic tasks by using the command-line interface (CLI). 5. Use the various Linux process management features. 6. Create and execute basic...

Words: 2032 - Pages: 9

Free Essay

Test

...NT1430 Linux Networking: Study Guide Wed 21-November-2012 Linux Commands: Know these commands and what they do: • Directory and list commands o ls, ls –l o pwd o cd / o cd and cd~ (hint: both take you to your home directory) o cd .. (takes you up one directory • Know what cp and mv do and how to use them • File viewing commands: o cat o less and more (one page at atime) o vi and view o tail (shows the last 10 lines of a file) o head (shows the top 10 lines) • chmod for changing permissions on files and directories • know the differences in read write and execute for owner group and all • > to redirect output to a file (overwrites if file exists) • >> appends to a file • & puts a process in the background while fg brings it to the foreground. • ps –ef | grep programname locates a running process for you • grep is a program that searches for a string within a directory or command output • The pipe symbol ( | ) sends output from one command to the input of another. • Know what a Linux shell script is. Direcories and file systems • / is the root of the entire file system • /usr stores program files • /home stores user home directories • /etc stores Linux configuration files • /var stores various miscellaneous files • /proc is a virtual directory that stores system performance metrics...

Words: 1137 - Pages: 5

Free Essay

Comp1600

...COMP1600 - Software Development Workshop I Workshop 1.3: Editors and File Utilities Learning Objectives In this workshop, you will learn how to use some common editors and file utilities in Linux. Editor You use an editor to edit text files (e.g., input source programs, change the configuration files in /etc). You should be familiar with at least one editor in Linux. Some common editors include emacs, vi and pico. On X-windows, some common editors are xedit, gedit and kedit. Basics of vi vi is one of the common editor in Linux/Unix. It has two modes: insert mode and command mode. To get into insert mode: A, a, I, i, O, o To get out of insert mode: To move around in command mode: h, l, j, k, Ctrl-U, Ctrl-D, Ctrl-F, Ctrl-B Editing in command mode: x : delete 1 character 3x : delete 3 characters X : backspace to delete the last character dd : delete 1 line 3dd : delete 3 lines d^ : delete from the beginning of line D : delete up to the end of line u : undo last command . : redo last command yy : yank 1 line (copy into buffer) 10yy : yank 10 lines p : paste the buffer below the current line P : paste the buffer above the current line J : joint two lines : : go into ex mode /something/ : find something forward ?something? : find something backward Text File Format in Linux/DOS For text files in DOS, appears at end of each line, where the control 1 COMP1600 - Software Development Workshop I characters and stand for "carriage return" and "line fit". ...

Words: 971 - Pages: 4