Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
saving with vi
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Rain Designs
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jul 2002
Posts: 130
Location: Los Angeles, CA

PostPosted: Sun Dec 22, 2002 4:26 am    Post subject: saving with vi Reply with quote

n00b here...

how do I save with the text editor vi.

And there is a reason why I'm not using nano!

Thanks

Rain
_________________
^M = Death by notepad

http://www.raindesigns.com
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Sun Dec 22, 2002 4:58 am    Post subject: Reply with quote

ESC will get you out of editing modes
: will give you the vi prompt
w will write the file
wq will write & quit

Google probably has some more information on vi.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Sun Dec 22, 2002 5:42 am    Post subject: Reply with quote

ZZ will also save and quit, and it's easier to type than ":wq<CR>".
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
mooman
Apprentice
Apprentice


Joined: 06 Nov 2002
Posts: 175
Location: Vancouver, WA

PostPosted: Sun Dec 22, 2002 6:30 am    Post subject: Reply with quote

and :q! will quit without saving any changes. Useful when you accidently clobber something. My usual sequence... :q! followed by cursor-up (to get the last vi command again), followed by Enter..

I use this a lot when I fatfinger vi files... (There is a 'U' command that is supposed to undo the last action, but sometimes I've done more than one line of changes...)
_________________
Linux user off and on since circa 1995
Back to top
View user's profile Send private message
Rain Designs
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jul 2002
Posts: 130
Location: Los Angeles, CA

PostPosted: Sun Dec 22, 2002 6:31 am    Post subject: Reply with quote

thanks :)

one last thing...

lets say I want ALL the files and folders in the folder "temp" to have privledge 775, how do I do this?

I tried to go through ssh and right click on "temp" and setting the privledge to 775 there but, only "temp" had value 775.

Thanks

Rain
_________________
^M = Death by notepad

http://www.raindesigns.com
Back to top
View user's profile Send private message
mooman
Apprentice
Apprentice


Joined: 06 Nov 2002
Posts: 175
Location: Vancouver, WA

PostPosted: Sun Dec 22, 2002 6:40 am    Post subject: Reply with quote

You say "right click" so I take it you're using a graphical file manager of some sort?

The classical way is just to change to that directory in a shell and do a recursive chmod there, specifically:

Code:
/ # cd temp
/temp # chmod -R 755 *
/temp #


Is this what you're asking for?
_________________
Linux user off and on since circa 1995
Back to top
View user's profile Send private message
hook
Veteran
Veteran


Joined: 23 Oct 2002
Posts: 1398
Location: Ljubljana, Slovenia

PostPosted: Sun Dec 22, 2002 6:44 am    Post subject: Reply with quote

chmod -R 775 temp
or
cd temp; chmod -R 775 *

in vi, use <ESC> ZZ ,it is said to be safer (don't know why or how...but it is said so)
_________________
tea+free software+law=hook

(deep inside i'm still a tux's little helper)
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Sun Dec 22, 2002 7:09 am    Post subject: Reply with quote

Won't "chmod *" miss files and directories whose name begins with a '.' under default globbing rules?
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
hook
Veteran
Veteran


Joined: 23 Oct 2002
Posts: 1398
Location: Ljubljana, Slovenia

PostPosted: Sun Dec 22, 2002 7:15 am    Post subject: Reply with quote

nope, tried it and
Code:
chmod -R 775 some_dir
works just fine, even with . dirs :)
_________________
tea+free software+law=hook

(deep inside i'm still a tux's little helper)
Back to top
View user's profile Send private message
Rain Designs
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jul 2002
Posts: 130
Location: Los Angeles, CA

PostPosted: Wed Dec 25, 2002 4:29 am    Post subject: Reply with quote

awesome

Thanks for all the help :D

Rain
_________________
^M = Death by notepad

http://www.raindesigns.com
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Wed Dec 25, 2002 5:16 am    Post subject: Reply with quote

hook wrote:
nope, tried it and
Code:
chmod -R 775 some_dir
works just fine, even with . dirs :)
I said that "chmod *" would miss things with names starting with '.', not chmod -R on the parent.
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
hook
Veteran
Veteran


Joined: 23 Oct 2002
Posts: 1398
Location: Ljubljana, Slovenia

PostPosted: Wed Dec 25, 2002 8:39 am    Post subject: Reply with quote

rac wrote:
I said that "chmod *" would miss things with names starting with '.', not chmod -R on the parent.

oh ...sorry :( ...my mistake ...was a bit sleepy at that moment :]
_________________
tea+free software+law=hook

(deep inside i'm still a tux's little helper)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum