How to move directory via SSH? - ssh

I want to move a the whole 'includes' folder (whole folder with all its files and subfolders) that is located on /site/«HERE»
to one folder up (..) via SSH. Can anybody please tell me how to do that?
Thanks

ssh user#server mv /site/includes /

If you are logged in already, try this
mv original_file new_name

Related

How to show root folders in file tree in cloud9 local ssh install

I've installed cloud9 locally on my remote sever following instructions from Cloud9's "sdkcore" repository on github.
I was able to activate it correctly.
However, once started, the files tree only shows Cloud9 folders, but if you want to edit a file contained in a /var/www/examplefolder directory, I cannot.
I could only modify through the ssh terminal, but I would like to be able to edit the files using the most convenient sublime editor.
How can i fix it?
Thanks.
update:
I resolved creating a link with the command :
sudo ln -s /path/from/folder/you/need /path/to/c9/workspace
in that way you will see your files in c9 workspace folder in the file tree bar;
or
sudo ln -s /path/from/folder/you/need /home/yourusername/
in that way you will see your files in favourites folder in the file tree bar.
If you want to do this, you'll need to create the SSH workspace with the workspace root as / . Alternately, you can open files in the IDE by using the c9 {filename} command.

Kompozer Can't "Publish" web page to my Raspberry Pi Server

I'm not sure how to set the publication settings...
... My RPi is at 192.168.2.126, and is running Apache and ftp.
... The site is to be located in the folder /var/www/GarageDoor on the RPi
... The site is accessed as http://192.168.2.126/GarageDoor/GarageDoors.html
I'm also concerned because my ftp client can't move the file(s) associated with this site directly to /var/www/GarageDoor either. I end up transferring them to my /usr folder, then copying the files manually to the /var/www... folder.
Seems like you need "sudo" permission to copy a file to this folder. I can't figure out how to give either Kompozer or my ftp client such permission. (I'm using bitvise sftp client)
Any ideas would be appreciated.
This sounds a lot like a permissions error. Enter the following into the raspberry pi command line:
sudo chmod 777 /var/www/GarageDoor/GarageDoors.html
Because that would make the file readable by anyone. If that doesn't work, try the +x option to make the file executable.
sudo chmod +x -R /var/www/GarageDoor
Note on the second command: This will make all files in /GarageDoor have executable permissions. (-R is for recursive)

SCP is creating subdirectory... but I just want it to copy directly

I'm trying to use scp to copy recursively from a local directory to a remote directory.... I have created the folders on the remote side:
Remote Location (already created):
/usr/local/www/foosite
I am running scp from the local machine in directory:
/usr/local/web/www/foosite
But it's copying the "foosite" directory as a subdirectory... I just want the contents of the folder, not the folder itself...
Here is the command I'm using:
scp -r /usr/local/web/www/foosite scpuser#216.99.999.99:/usr/local/www/foosite
The problem is that if you don't use the asterisk (*) in the local part of the call, scp will create a new top level directory in the remote server. It should look like this:
scp -r /usr/local/web/www/foosite/* scpuser#216.99.999.99:/usr/local/www/foosite
This says "Copy the CONTENTS" (but not the directory itself) to the remote location.
Hope this helps... Took me an hour or so to figure this out!!!
Old question, but I think there is a better answer. The trick is to leave the foosite directory off of the destination:
scp -r /usr/local/web/www/foosite scpuser#216.99.999.99:/usr/local/www
This will create the foosite directory on the destination if it does not exist, but will just copy files into foosite if the directory already exists. Basically the -r option will copy the last directory in the path and anything under it. If that last directory already exists on the destination, it just doesn't do the mkdir.

How to view files stored under root?

I have been able to successfully create a root folder and store documents there. How can i be able to view whats there using SSH? What commands do i have to use? Thanks!
ls is the command, / refers to the system root. So go with ls /
ls lists files if the remote is a Unix host. man ls explains how it works (in a rather terse way).
Go with ls.
from any folder: ls /path/to/folder
from within folder: ls

Joomla - Warning! Failed to move file error

I have found some solutions to this error and tried implementing them but none of which has worked and hope that some here at SO might have a different answer.
I get this error, "Warning! Failed to move file" when I try install modules into my new installation of Joomla here:
http://sun-eng.sixfoot.co.za
Here's some solutions I have tried to no avail:
http://forum.joomla.org/viewtopic.php?f=199&t=223206
http://www.saibharadwaj.com/blog/2008/03/warning-failed-to-move-file-joomla-10x-joomla-15x/
Anyone know of another solution to this please?
Thanks!
Go to Help -> System Info in your administrator backend and check your Directory Permissions tab to make sure everything is writable.
Also make sure your Path to Temp Folder is correct in Site -> Global Configuration.
Finally, check to make sure that the module isn't already installed. It's possible that some files already got copied or something and now your system is having problems overwriting them.
If none of this works, let us know if the error message specifies which file can't be moved. That would help figure out a solution.
In the configuration folder change the temporal folder location to /tmp (public $tmp_path = '/tmp';) or create your own temperate folder and set it to /myowntemp and change the file permission to 777. you are good to go .
This is typically a file permissions issue. If the system cannot write to the tmp directory within Joomla it will give you the "Warning Failed To Move File" error.
The typical solution is to make the directory wide-open, in general a bad practice but a quick fix. You log in to the Linux command line via a terminal (telnet or ssh) session and set the permissions of the directory.
# chmod -R 777 ./tmp
The better option is to find out what user/group the Apache server is running as and assign the permissions accordingly. For example, if Apache is running your site as the myuser:nobody user:group then you can open up write permissions for the group by changing ownership of the tmp folder and making it writable by anyone in the group:
# chgrp -R nobody ./tmp
# chmod -R 775 ./tmp
Security can be a pain to get set correctly if you don't know *nix commands and security settings, so most people just blast a huge hole in the security with chmod 777.
The next thing you'll probably run into is another error message about not being able to update a specific directory. Again, this is a permissions issue and is typically a piece of the file being unzipped into the administrator subdirectory. Depending on whether your installing a component, a module, or a complex plugin with multiple pieces you may need to open up one or more of these directories using the same approach as above. Here is the "blow a big open hole in security" method:
# chmod -R 777 ./administrator/
Or more selectively:
# chmod -R 777 ./administrator/components/
# chmod -R 777 ./administrator/modules/
If you are a linux user then it is very simple to solve. Just type the following command and try again to install plugin/entension.
sudo chmod -R 777 /var/www/html/my_joomla_folder
You can also refer this link for brief information regarding permission of each folder and file.
Cheers!!
In Joomla 3.x you should go to System->System Information to see directory permissions
If one or more directories that are listed are not "writable" then you should change the permission of those directories:
If you are using one of Linux distributions you can use this command
to give the directories read/write/execute permission:
sudo chmod 777 -R address_of_lampp_directory/lampp/htdocs/joomla_directory
I have had a similar issue today and found is was the permissions set on the 'temp folder'. To resolve I changed them to 777 and my plugin installs worked fine!!
Another thing to check is whether you actually have space on the disk. I had this error and discovered that the drive was 100% full. Removing some unused files fixed the problem.
One other thing to try if everything else is not working is to add the following to your .htaccess file:
php_value upload_max_filesize 10M
Make sure 10M covers the size of the file you are uploading - increase it if your file is 12Mb, for instance.
[Source]
This issue was solved like this.
On the configuration.php file change the tmp_path variable according to:
if you site is mysite.azurewebsites.net, the path should looks like
'C:\DWASFiles\Sites\mysite\VirtualDirectory0\site\wwwroot\tmp'
instead of
'C:\DWASFiles\Sites\mysite.azurewebsites.net\VirtualDirectory0\site\wwwroot\tmp'
Refer to the link: http://social.msdn.microsoft.com/Forums/en-US/windowsazurewebsitespreview/thread/2701eadc-9977-46ab-9c56-81a2234bdce4
I did it and every is working for every error problem with OSX, I use OSX version 10.9.2 and get many problems. The way to fix every error is
# cd /Applications
# chmod -R 777 ./XAMPP
some files might not change permission but the problem is gone.
you can create folder and upload fine and picture, including install plugin.