OK so I posted this to somebody asking for help, and now I'm posting it here, as it might help somebody.
This is for editing a php.ini file, but can be used for pretty much any file.
Various distributions might not contain some preinstalled stuff like vi/vim, so beware if it doesn't work, it might be because of that or you have a strange distro.
This is ALL CLI.
my-awesome-server is your server name, and the $ sign denotes a bash prompt.
your-local-pc is your desktop pc at home.
host-or-ip.com is either an ip like 57.34.75.13 or a domain like example.com
username is your ssh username, i advise you not to login as root for security reasons
Code:your-local-pc $ ssh [email protected] Please enter the password for [email protected]: #enter your password and hit enter - in *nix (linux etc), you never see characters like stars for passwords, it's just blank Thankyou for logging in ### MOTD### my-awesome-server-name $ cd /etc/ # change directory to /etc/ my-awesome-server-name $ vim php.ini # vim is an editor, some even use it as an ide, vi is vim's predecessor # in debian and other os' you can use a "fuzzy search" for instance if you type ph and then <tab> # it will type as much as it can before it comes to a tree, aka # it'll come to php.ini and php.d for me, so for me it stops at 'php.' # and then gives you a windows sounding runtime error, then you'll need to type the next letter and hit enter my-awesome-server $ <i> # typing <i> turns vi(m) into insert mode so you can edit, it's all cli so no mouse! :) #navigate using arrow buttons to an option in your php.ini navigate right and delete the current value #replace with a new value my-awesome-server $ <esc> # hitting escape puts vi(m) into action mode my-awesome-server $ <:> # the colon issues a save/exit among other commands i don't know.. im guessing anyway #the two I know are w and q, w is save, q is quit, wq is save and quit, adding ! is an override. my-awesome-server $ <wq> my-awesome-server $ <enter> # this will save and quit out of your current file # to restart apache (needed for some changes that are cached.. i think :P) my-awesome-server $ apachectl graceful # graceful notes apache to let all file transfers finish before it restarts # other subcommands such as stop, start, and restart may screw something up as it doesn't let some things finish # and apache might go wierd about process IDs





lol.
Reply With Quote





