LS command not listing files in Amazon EC2 - linux

I'm using an Amazon ec2 instance and am SSHed into it. For some reason when I use the ls command, it doesn't list the files in the current directory. Is this command disabled by default? if so, is there a way to enable it?

The issue was that I was in the ~ folder. Once I cd into the html folder, i was able to list the files. Could also be a permissions thing because i have permissions in the html folder

Related

GCP Filestore error modifying shared folder contents with nodejs script under non-root user

I want to write a program that writes log files into the shared folder in a GCP compute engine. I used GCP filestore to mount the NFS folder in an ubuntu vm. After creating the folder, I noticed that I couldn't use cp to copy file to that folder unless I use sudo. When I ran the nodejs script, it also returned a permission denied error. However, I don't want to run the nodejs script with root. Is there a way to modify the set of permission so that I can write to the shared folder under the default, non-root user?
I modified the permission of the shared folder to 777 but it didn't work. I still cannot write to the folder.

why '~' tilde directory is created automatically in home directory on AWS EC2 instance

I have some python scripts running on AWS-ec2 instance on crontab. Every day I found "~" directory in my home directory. Don't know why this happening.
I have to manually remove the ~ (tilde) directory from home-dir.
When I run these script on local ubuntu machine. It's working fine.
There is a bug in the one of the scripts that you are running that is creating this.
Typical shells ~ is used to refer to the users home. And somewhere this is being used where is is not really replaced. Because these are python scripts you might need to manually handle those.
See - How to get the home directory in Python?

Blank SSHFS mount folder

I am attempting to mount a remote directory located on my web server to a directory in my xUbuntu installedation hosted in a VirtualBox.
I'm using the following command syntax:
sshfs root#*.*.*.*:/var/www Desktop/RemoteMount
Using the file manager, I navigate to the Desktop/RemoteMount directory but find it entirely blank. The SSHFS command above executed with no indication of an error.
Completely by chance, I use the terminal to long list the contents of the Desktop/RemoteMount directory and it shows all the data I was expecting to see in the file manager.
Can anyone tell me why the file manager does not show my remotely mounted data and how I might fix it?
Thanks.
you are missing local mountpoint.
sshfs -o idmap=user mika#192.168.1.2:/home/mika/remotepoint /home/mika/localmountpoint.
And You need to have localmount folder exist.
thanks Mika

create directory as an ssh link

I'd like to create a directory that links to external site via ssh.
So that when I cd to /var/remote/dev01 it will actually cd to a folder on a remote site.
So I'm staying on my current terminal and can copy files from any other dir to this /var/remote/dev01 dir and it will copy the files over to the remote host.
Is this even doable?
Yes, this is possible. Take a look at SSHFS. It lets you mount a remote filesystem over ssh, and treat it as a local mountpoint, for standard filesystem operations.
Here's a nice walkthrough to get you started.

Is there a system variable that stores the location of a user's Dropbox?

At least in the linux version of Dropbox, the user can choose which folder becomes their Dropbox. Is there a simple way to get this programmatically?
Maybe this will give you a clue. http://wiki.dropbox.com/TipsAndTricks/TextBasedLinuxInstall
The Dropbox configuration is stored in a sqlite database in your ~/.dropbox folder.
I found a small script which edits the Dropbox folder location:
http://dl.dropboxusercontent.com/u/119154/permalink/dropboxdir.py
http://cmdlinetips.com/2012/05/how-to-change-dropboxs-default-directory-location/
The most forward way to force Dropbox to use another folder location is a symbolic link.
Stop the dropbox daemon and simply replace the default folder with a symlink:
> mv ~/Dropbox /other/dropbox/folder
> ln -s /other/dropbox/folder ~/Dropbox

Resources