I am trying to send a file in cygwin commandline with rsync and openssh.
So the command I'm using is rsync -P -e "ssh -p 2222" deborahtrez#209.6.204.90:/home/dell/cygdrive/c/Users/dell/Videos/Movavi/installation_tutorial.mp4
Then it asks for my password, which I enter. I press ENTER and I always get returned No such file or directory
The file path to my video "installation_tutorial.mp4" is in C:\Users\dell\Videos\Movavi so the full path becomes C:\Users\dell\Videos\Movavi\installation_tutorial.mp4. So this is what I have tried so far.
Please, what am I doing wrong? Is it my file path? If so, what is the correct file path that i should be using? Help!
The path is wrong. The best way to convert from Windows to Posix is to use cygpath
$ cygpath -u 'C:\Users\dell\Videos\Movavi\installation_tutorial.mp4'
/cygdrive/c/Users/dell/Videos/Movavi/installation_tutorial.mp4
Related
I want to extract a tar file that I obtained at tar.gz file. However, when I try: tar -xzvf wekaUT.tar.gz
I get the following error:
tar: Error opening archive: Failed to open 'wekaUT.tar.gz'
I see the file in my directory as wekaUT.tar.gz.
Any help would be much appreciated.
Just commenting here as I ran into the same issue. In windows "tar xfv .tar.gz" should work if you open the command prompt as administrator.
In my case, I was building the file to untar dynamically using a variable like
tar -xzvf "$SOME_TEMP_DIR/a_cool_file.tar.gz"
And encountered this error because of the quotes. If I updated it to:
tar -xzvf $SOME_TEMP_DIR/a_cool_file.tar.gz
It worked :)
In windows compand promt use quotation marks ("") when specifying the path. It will work properly
Exaple : tar -xvzf "C:/PATH/TO/FILE/FILE-NAME.tar.gz" -C "C:/PATH/TO/FOLDER/EXTRACTION"
tar -xvzf "C:/PATH/TO/FILE/FILE-NAME.tar.gz"
I am using Cygwin to copy all the files in a local windows folder to an EC2 linux instance inside of powershell. When I attempt to copy all the files in a folder, it copies the pathname as a folder:
\cygwin64\bin\scp.exe -i "C:\cygwin64\home\Ken\ken-key-pair.pem" -vr \git\configs\configs_test\ ec2-user#ec2-22-75-189-18.compute-1.amazonaws.com:/var/www/html/temp4configs/
will copy the correct files, but incorrectly include the path in a Windows format a path like:
/var/www/html/temp4configs/\git\configs\configs_test/file.php
I have tried an asterisk after the folder without the -r, such as:
\cygwin64\bin\scp.exe -i "C:\cygwin64\home\Ken\ken-key-pair.pem" -v \git\configs\configs_test\* ec2-user#ec2-22-75-189-18.compute-1.amazonaws.com:/var/www/html/temp4configs/
but that will return an error such as
"gitconfigsconfigs_test*: No such file or directory"
What can I do to copy the files without copying the path?
Thanks
When using cygwin programs is safer to use POSIX Path, and most of the time is the only way. To covert from windows to posix PATH use cygpath
$ cygpath -u "C:\cygwin64\home\Ken\ken-key-pair.pem"
/home/Ken/ken-key-pair.pem
$ cygpath -u "C:\git\configs\configs_test\ "
/cygdrive/c/git/configs/configs_test/
Using the windows one, will cause the server to misunderstand the client request
I try to open annotation file from mimic2 db for patient a40017 that called a40017.alM.
I have this link for the data: http://www.physionet.org/pn5/mimic2db/a40017/
and I don't find the exact command in Cygwin that export the file to csv or text.
I try to use this command:
rdann -r mimic2db/a40017/a40017 -f 0 -t 216647.728 -a alM -v >annotations.txt
but I got an empty file
Is anyone know how can I do that?
Thanks,
Gal
Anwering myself. Rdann is a mingw32/64 program
https://physionet.org/physiotools/binaries/windows/
If you are in the same directory of the program and it is not in the PATH you need to run:
./rdann -r mimic2db/a40017/a40017 -f 0 -t 216647.728 -a alM -v
or
/<fullpath>/rdann ...
I have added the below line in /etc/ visudo in the bottom before (Defaults passprompt="Password:" this line).
ALL=(root) NOPASSWD:/usr/bin/wget
When ever i try to with wget command, it is asking passowrd. I can download files after i use sudo command only. Can anyone help to download files without sudo command as I need to use the command in shell_exec PHP file.
The following works to give all users the right to execure /usr/bin/wget
ALL ALL=/usr/bin/wget, NOPASSWD: ALL
you can then use
sudo wget google.com
Without being asked for a password
I am having trouble accessing Coda from command-line. I installed the "command-line coda" plug-in, verified that my installation is in the correct location, yet I still can seem to access Coda. Coda sits in my "Applications" folder which is the default location for the plug-in.
Anyone have have this problem? Any tips? On the their site it is recommended that you change the path.
export CODEPATH=/Applications/Coda.app
So I included the above line in my .bash_profile which did not help.
$ Coda -v
-bash: Coda: command not found
Thanks for any direction you can provide.
The default way to open an application on a Mac is to use open -a AppName so you should be able to change your bash profile to use that:
$ open -a Coda
I've created a bash script (as opposed to using the plugin) that Gregory Tomlinson originally posted about (it looks like he's since taken it down but it looks like the following).
Create a new file in /bin called coda:
$ cd /bin
$ sudo touch coda
$ vim coda
Hit an i to enter insert mode. Then include the following code:
#! /bin/bash
if [ "$1" = "" ]; then
echo "Please specify a file to open or create"
exit 0
else
for ARG in $*
do
touch -a $ARG && open -a Coda $ARG
done
exit 0
fi
Save and quit (hit the esc to exit insert mode then type :w !sudo tee % >/dev/null followed by the return key, press L for load when prompted, then type :q to quit). Then give that file execute permissions:
$ chmod u+x coda
Start a new Terminal window and you should be able to use:
$ coda filename.foo
Or just:
$ coda
For some strange reason, my paid registered Coda 2 app just wouldn't open for me this morning. I found this terminal command that worked for me:
open -a Coda\ 2
You can also put the following in your ~/.bash_profile file:
alias coda='open -a "Coda 2"'
I had a similar problem. After installing the plug-in, I still couldn't launch coda from the command line. I took a closer look at /user/local/bin and somehow the permissions had gotten reset so I didn't have execute permissions for /user/local/bin.
I updated my permissions with:
sudo chmod o=rx,g=rx /usr/local/bin
This solved my problem. However, Coda won't launch if the specified file does not exist, which makes it hard to create a file from the command line.