background preloader

Basic vi Commands

Basic vi Commands
What is vi? The default editor that comes with the UNIX operating system is called vi (visual editor). [Alternate editors for UNIX environments include pico and emacs, a product of GNU.] The UNIX vi editor is a full screen editor and has two modes of operation: Command mode commands which cause action to be taken on the file, and Insert mode in which entered text is inserted into the file. In the command mode, every character typed is a command that does something to the text file being edited; a character typed in the command mode may even cause the vi editor to enter the insert mode. While there are a number of vi commands, just a handful of these is usually sufficient for beginning vi users. NOTE: Both UNIX and vi are case-sensitive. To Get Into and Out Of vi To Start vi To use vi on a file, type in vi filename. To Exit vi Usually the new or modified file is saved when you leave vi. Note: The cursor moves to bottom of screen whenever a colon (:) is typed. Moving the Cursor

A Beginner's Guide to CDOSYS Download source files - 1 Kb Introduction Use this example to allow users of your website to submit feedback and send emails using IIS and its SMTP service. Background CDOSYS is the successor of CDONTS, an easy way to send emails from webpages. Requirements Windows 2000/XP SMTP Service for IIS installed Run this sample on your own computer with IIS installed. Using the code The first step is to call the components into action... Dim iMsg Set iMsg = CreateObject("CDO.Message") Dim iConf Set iConf = CreateObject("CDO.Configuration") Step 2 involves verifying the correct configuration settings... Dim Flds Set Flds = iConf.Fields Flds(" = 1 Flds( _ " _ = "c:\inetpub\mailroot\pickup" Flds.Update Be especially mindful of the path in the code above. The Request.Form.Item grabs the data posted to it from the form on the sample1.htm page. Points of Interest History

Basic Pico Commands What is Pico? The UNIX Pico editor is a full screen editor which is very easy to use. Beginners often find it nicer and easier to use initially than either vi or Emacs. To use Pico on a file, enter pico filename If the file named filename exists, then the first page (or screen) of the file is displayed; if the file does not exist, then an empty file and screen is created into which you may enter text. The following is a near facsimile of how your screen (or window) would appear if you had typed pico junkfile.C at a UNIX command prompt and then invoked the help menu for Pico. For further information on Pico, check out these links: Pico tutorial from NC State Pico tutorial from Canada Pico tutorial from UC Santa Barbara Pico tutorial from Cal State Pomona Pico tutorial from University of Michigan Another Pico tutorial from Colorado State (ACNS) Comments:

Linux Directory Structure (File System Structure) Explained with Examples by Ramesh Natarajan on September 8, 2010 Have you wondered why certain programs are located under /bin, or /sbin, or /usr/bin, or /usr/sbin? For example, less command is located under /usr/bin directory. In this article, let us review the Linux filesystem structures and understand the meaning of individual high-level directories. 1. / – Root Every single file and directory starts from the root directory.Only root user has write privilege under this directory.Please note that /root is root user’s home directory, which is not same as /. 2. Contains binary executables.Common linux commands you need to use in single-user modes are located under this directory.Commands used by all the users of the system are located here.For example: ps, ls, ping, grep, cp. 3. Just like /bin, /sbin also contains binary executables.But, the linux commands located under this directory are used typically by system aministrator, for system maintenance purpose.For example: iptables, reboot, fdisk, ifconfig, swapon 4.

vi: Petit guide de survie Quoi qu'on puisse en penser à notre époque d'interfaces graphiques, vi est un petit éditeur très pratique pour modifier des fichiers ASCII et il offre 2 gros avantages: on est sûr de le trouver partout et il fonctionne même dans une fenêtre telnet sous MS-Windows. Par contre, il est vrai que s'il était révolutionnaire à l'époque des téléscripteurs, on sent bien que beaucoup d'eau a coulé sous les ponts depuis... d'où la nécessité de ce petit guide! Première surprise: vi fonctionne dans 3 modes différents, le mode commande, le mode insertion et le mode sélection. Comme son nom l'indique, le mode insertion correspond au mode dans lequel on tape le texte à saisir. Le mode commande permet de se déplacer, de faire des recherches et eventuellement remplacements, de supprimer du texte et de passer dans les autres modes. Le mode sélection permet de sélectionner du texte librement, ligne par ligne ou sous forme de zone rectangulaire, et de le placer dans le presse-papiers ("couper" et "copier").

Setting Your System's Hostname Every GNU/Linux system has a hostname, whether you like it or not. A system's hostname usually has a corresponding entry in the domain name system (DNS), but it doesn't necessarily have to. The hostname is the name that programs such as mail and web servers use to identify the system that they are running on. Many of these programs will issue warnings, or in some cases completely fail to run if the hostname is not set correctly. If you have a system, it has a hostname. If you haven't set its hostname yourself, then one has likely been set for you. Choosing A Name Experienced system administrators use a lot of different schemes and conventions for choosing a hostname. It cannot be longer than 64 characters It can only contain letters, numbers, and dashes The only recommendations that I will make are that the hostname you choose should be unique among the systems that you're in charge of naming, and it should be easy to type, because you will type it a lot over the lifetime of the system

15 Essential Checks Before Launching Your Website - Smashing Magazine Advertisement Your website is designed, the CMS works, content has been added and the client is happy. It’s time to take the website live. Or is it? When launching a website, you can often forget a number of things in your eagerness to make it live, so it’s useful to have a checklist to look through as you make your final touches and before you announce your website to the world. This article reviews some important and necessary checks that web-sites should be checked against before the official launch — little details are often forgotten or ignored, but – if done in time – may sum up to an overall greater user experience and avoid unnecessary costs after the official site release. Favicon A favicon brands the tab or window in which your website is open in the user’s browser. And if you have an iPhone favicon: Titles And Meta Data Your page title is the most important element for SEO and is also important so that users know what’s on the page. Cross-Browser Checks Proofread Read everything.

UNIX Shell Script Tutorials &amp; Reference Now, as promised, a closer look at the pipe, list, and redirection characters and their functionality. Pipe Dreams: Pipes are a UNIX feature which allows you to connect several commands together in one line and pass data from one to the next much like a chain of firemen sending buckets of water down a line. The data in the bucket is processed by each command and then passed on to the next command without ever coming up for air. This happens because of two things: Most UNIX commands get input from stdin and pass output to stdoutThe pipe symbol (|) directs UNIX to connect stdout from the first command to the stdin of the second command. So that sounds simple. Example pipes line_count=`wc -l $filename | cut -c1-8` process_id=`ps -ef \ | grep $process \ | grep -v grep \ | cut -f1 -d\ ` upper_case=`echo $lower_case | tr '[a-z]' '[A-Z]'` In all cases the pipeline has been used to set a variable to the value returned by the last command in the pipe. Lists: Current Shell: Sub-Shell: Redirects: <&digit

Learning the shell. Why do you need to learn the command line anyway? Well, let me tell you a story. Many years ago we had a problem where I worked. There was a shared drive on one of our file servers that kept getting full. du -s * | sort -nr > $HOME/user_space_report.txt Graphical user interfaces (GUIs) are helpful for many tasks, but they are not good for all tasks. I once heard an author say that when you are a child you use a computer by looking at the pictures.

VI and VIM editor: Tutorial and advanced features Vim Intro: This "vi" tutorial is intended for those who wish to master and advance their skills beyond the basic features of the basic editor. It covers buffers, "vi" command line instructions, interfacing with UNIX commands, and ctags. The advantage of learning vi and learning it well is that one will find vi on all Unix based systems and it does not consume an inordinate amount of system resources. NOTE: Microsoft PC Notepad users who do not wish to use "vi" should use "gedit" (GNOME edit) or "gnp" (GNOME Note Pad) on Linux. See our list of Linux GUI editors Vim Installation: Red Hat / CentOS / Fedora: rpm -ivh vim-common-...rpm vim-minimal-...rpm vim-enhanced-...rpm vim-X11-...rpm yum install vim-common vim-minimal vim-enhanced vim-X11 Ubuntu / Debian: apt-get install vim vim-common vim-gnome vim-gui-common vim-runtime Compiling Vim from source: Download vim source from tar xzf vim-7.0.tar.gz cd vim70 . Vi/Vim Command Line Arguments: Basic "vi" features: Editing Commands:

A brief introduction to Autoconf [ Home : Programs | libCVD | Hardware hacks | Publications | Teaching | TooN | Research ] Introduction Autoconf is a system for generating a script which will automatically determine the presence of things which your project either depends upon, or can make use of. If you already have a project and are currently writing tests using your own ad-hoc system, I strongly recommend you to switch to Autoconf. There are several tools in the suite, including automake (for automatically generating makefiles) and autoscan (for scanning source trees to make configure scripts). In order to read this tutorial, a knowledge of shell scripting is assumed, but not essential for the basic examples. Finally, this is not a reference work (use the Autoconf documentation for that), it is a tutorial, and is designed to be read through in order. Hello, World. Save the following script to configure.ac: AC_INIT(myconfig, version-0.1) AC_MSG_NOTICE([Hello, world.]) Now do: and you get: configure: Hello, world. . .

10 lightweight apps to make older PCs fly Your desktop PC might have been slim and speedy five years ago, but keeping up with application upgrades and filling your hard drive with feature-bloated commercial tools can soon make your machine sluggish. If your computer feels underpowered, there's no need to ditch it and reach for the credit card to buy a new model. Instead, try our pick of free, lightweight tools and it'll soon be back to its sprightly self. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. Now read 10 cheap and easy upgrades for your old PC Sign up for the free weekly TechRadar newsletterGet tech news delivered straight to your inbox.

Notes: Unix Scripting Introduction A shell script, in its simplest form, is a series of shell commands put together in a text file, which can then be executed in order. The commands used in the scripting language are the same ones the user types in when they are using Unix through a command line. To those of you who are used to writing code in languages like C and Java, shell scripting can seem strange because it doesn't need to be compiled before it is run and because of it's relative lack of structure, but it can prove to be a surprisingly powerful tool. Shell scripting is useful in situations where you want to get a program up and running without wasting too much time. In this tutorial, any code will be written in a box, and comments will be coloured green, as shown below: Hello World In keeping with Computer Science tradition, the first Unix script we will look at is the "Hello World" example. When you look at the program, you will see three distinct parts to it. #! Using Unix Commands Using Variables

Related: