New on LowEndTalk? Please Register and read our Community Rules.
How to navigate and edit files in Putty
I am new to Putty commands and I need some help. I have installed Wordpress app on Vultr server. Now I am trying to access my Wordpress files through Putty program.
I am trying to get and modify wp-config.php. How would I do that?
I typed "ls" in my Putty and I got this:
Could you tell me what commands should I do next to get to wp-config.php file?
I appreciate your help!
Run this command to find the wp-config.php file if you don't know where it is:
find /home/ | grep wp-config.php
Thx for fast reply. I got nothing after I pressed enter:
You need to learn about Linux and bash before managing your own server, not knowing what you are doing is very dangerous.
To answer your question, the wordpress install is probably in public_html folder, so "cd" (change directory) in to that and you can see the file (default there isn't one, it would be called wp-config-example.php or something similar). You can use nano/vi/vim to open the file, google on how to use those if you have no idea.
You can also run
vito edit the file once you know its location. For example, if the file is located at /home/user/public_html/wp-config.php:
Yes, I will definatelly start to learn, but I really need to find it.
I entered public_html but it is empty? Or I might be wrong because I see one dot and 2 dots which I don't know what they represent?
If I were you, I would rather take a look at WinSCP or any other analogue.
Looks like you may be running CPanel, if so you should just use their inbuilt GUI file editor.
If you're new, I'd maybe recommend you could use FileZilla and select the SFTP protocol and set something as Notepad++ as the main editor. After you edit the file and save it FileZilla automatically uploads it to the server.
Because if you even found the file through Putty you still have to learn how to use nano,vi or vim to edit it, So WinSCP or any other FTP client will be your best option for now
Try visiting your domain or IP and see what shows up. If nothing, run this command and see if there's any that comes up.
find / -name 'wp-config*'
It shows my wordpress site on that IP, so files should be somewhere, but where I don't know. I really want to find wp file from putty command. I tried your find command, but I am getting this:
CTRL+C to quit that, I typed it wrong. Updated the comment. Missed the ` at the end.
I did it, but it throws me on new line:
I spun up an instance, this is what I see.
There's this message in Vultr's control panel. Did you do these?
The files are usually stored in "public_html" so if you want to reach it easier:
If wordpress has not been installed in a subdirectory you'll find it here, then:
While if you want to find out the exact location:
I don't have that e-mail. I have server root and password. Wanted to access wp-config file through Putty, but if there is not possibility then I won't bother...
This can not find anything which is weird since I have installed Wordpress site and it is live.
It's not an email, login to vultr, click on your server.
Oh I see it. Now I got access to whm and cpanel. Thx! I resolved my problem.
@andreamada's answer is correct. I am glad if you have found the solution.
A bit correction:
The correct command is:
find / -type f -name "wp-config.php"
Or if without
find / -type f -name '*wp-config*'
Regular bash will get you where you need to go, there isn't a ton of PuTTY specific stuff to know.
Do keep in mind that right clicking the mouse in PuTTY will paste text into the terminal. I may or may not have pasted waaay too much info into IRC at one point.
cd public_html && yum -y install nano && nano wp_config.php
Do you even read the topic before giving your advice?
updatedband then locate the file you need. Maybe that works.
My apologizes, I forgot to add "*" Thank you for your notice.
Yes. It looks like a cPanel installation. And he just wants to modify the wp_config.php page. So, he will navigate to public_html dir, then install nano and open it.
If you read from the top, I told him to check the folder. There's not such file in there, so he never ran the WordPress installer, which generates the file. Told him to check Vultr panel, and it's there now after running the install.
Oh...he didn't run the installer...oh...I get it...
+1 for WinSCP