Posts

Showing posts from October, 2011

Vi - Linux Editor Commands

Common vi Commands Have a look at this list of common vi commands (there are many more, but these will at least allow you to get some basic work done). Then we'll do one more exercise before moving on. Note: As with all of Linux, vi commands are case sensitive. Positioning the Cursor � Move cursor one space right. � Move cursor one space left. � Move cursor up one line. � Move cursor down one line. ctrl-F Move forward one screen. ctrl-B Move backward one screen. $ Move cursor to end of line. ^ Move cursor to beginning of line. :1 Move to first line of file :$ Move to last line of file / Search for a character string. ? Reverse search for a character string. x Delete the character at the cursor position. dd Delete the current line. p Paste data that was cut with x or dd commands. u Undo.

Basic UNIX Commands

Directory :: Show current directory pwd Show content of directory ls -al Changing directory cd <newdir> Creating directory mkdir <dir> Deleting directory if empty rmdir <dir> Deleting directory if full rm -r <dir> Moving directory mv <olddir> <newdir> Copy directory cp -r <olddir> <newdir> Files :: Show file entry ls -al <file> Delete file rm -i <file> Move file mv <file> <path> Copy file cp <file> <newfile> Rename file mv <oldfile> <newfile> Show file content at once cat <file> Show file content page wise more <file> Show file with long lines cat <file> | fold Show first 20 lines of file head -20 <file> Show last 20 lines of file tail -20 <file> Edit file <editorname> <file> Edit file with vi vi <file> Give all file permissions to yourself chmod 700 <file> The above even into subdirectories chmod -R 700 <dir...