Linux/Unix – Intermediate VI useful tips:

Moving around the file

<shift>G  – Moves to the end of the file

gg – Moves to the beginning of the file

0 – Moves to the beginning of the current line

$ – Moves to the end of the line

:<number> – Moves to the

 

Entering text

A – Append to the end of the line

 

Copy Paste

yy – Yank(copy) one line of text

p – Paste the copied text to the next line

<shift>U – Undo

 

Setup:

To copy the contents of the password file to passwd.txt

ypcat passwd > passwd.txt

 

Task 1:

Add a new account to the end of the password file

username: testuser

password: anything

uid: 115

gid: 225

gecos: Test User, Folsom, 555-5555,

shell: /bin/tcsh

home directory: /home/testuser

 

Task 2:

What is on line 1045 of the password file?

 

Task 3:

Copy the fourth, fifth, and sixth lines to the end of the file

Advertisements

About msotela

This blog is for anyone who wants to access the power of a Linux system as a systems administrator or user. You may be a Linux enthusiast, a Linux professional, or possibly a computer professional who is increasingly finding the Windows systems in your data center supplanted by Linux boxes.

Posted on March 16, 2009, in Unix/Linux. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: