Download complete directory command line psftp [closed] - download

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
The community reviewed whether to reopen this question last year and left it closed:
Original close reason(s) were not resolved
Improve this question
I have to move a complete folder from one source to another destination.
I have tried mget * and xcopy, but neither works. Please suggest some snippets.
I'm using psftp to connect the SFTP server.
My code is:
cd Remote path
lcd Local path
mget *
bye
I have also tried mget* and mget *.*.

Use mget -r folder
If your paths include spaces, do not forget to surround path to double quotes
I assume you connect using command line arguments, otherwise you are missing open command.

Related

How to change directory in Bash [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I am very new to scripting, can anybody tell how can I switch to directory in bash.
I have tried to do like this
-bash-4.2$ cd /c
and cd c but nothing works!
Check if you have any directories in your current path!
You can check that by ls -lrt which lists the files and directories in your current path.
If there are no directories, create one using mkdir c and then do cd c
Also you can navigate to your previous directory by using cd - and your home directory by doing a cd ~

How do I navigate using a symlink? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
How do I navigate using a symlink?
I created a symlink, let's say 'projects' to my '/Desktop/Work/Projects' folder. So if I type 'ls' in my root directory, I see a bunch of things, the symlink among them. 'cd projects' fails with the error:
-bash: cd: projects: No such file or directory
The symlink is broken. If by 'your' /Desktop/Work/Projects you mean /home/youruser/Desktop/Work/Projects, then that's the path you should symlink to:
ln -s "/home/youruser/Desktop/Work/Projects" "/home/youruser/projects"

7z zipping directory relatively [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I am trying to use 7z to zip a directory so I do
C:/7z a -tzip mydirectory/testing.zip mydirectory/testing -o* -r
The problem the outputted zip file has for the content the entire directory structure path
mydirectory/testing/....
But I want the files under testing to be zipped and not have any paths above reflected in it.
Change the directory to mydirectory/testing first and use * to get all the files.
cd mydirectory\testing
C:\7z.exe a -tzip ../testing.zip * -r

Easiest way to search for a directory or a file in UNIX? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
What's the easiest command to use to search for a directory or file containing "abc" in it?
You can use find command:
find . -name "*abc*"
The previous command will search for any file or directory containing "abc" within the current directory (and all its subdirectories).
The locate command
locate "*abc*"
also works in addition to the find command already mentioned.
Note, this works quickly by querying a database created/updated/maintained by the updatedb command which usually runs regularly as a cron job. This means however that if the file was just created you may not find it until updatedb runs again (or you run it yourself assuming you have sudo priviledges). In those circumstances find might be your best bet, while slower, as it searches the directories you specify right at that moment.
This should do it
find / -iname "*abc*"

Copy shell script and preserve permissions [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have a small shell script that starts a program when I double-click it. (I have set the permissions to allow executing the script).
I want to be able to copy that script to another computer so that the new user can double-click it without needing to know anything about chmod or permissions. But I can't find out how to preserve the execute permission when I copy the file.
I can usually find answers with Google but this has me defeated - I guess I am not expressing my question properly.
Thanks
Use rsync or tar.
rsync -p file user#host:destdir
plus other options you might need.
Or
tar cvzf file.tar file
then copy (or email, etc.) file.tar to the other machine and extract the file:
tar xpvzf file.tar

Resources