CP command prompt Windows 7 not recognized [closed] - windows

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 11 months ago.
The community reviewed whether to reopen this question 11 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
I am trying to run the command CP at the command prompt on Windows 7 but I'm getting:
'cp' is not recognized as an internal or external command, operable program or batch file.
Do I need to install any software to run "cp" command?
If so what?

By default, there's no cp in Windows Command Prompt (cmd.exe). The equivalent cmd.exe command is copy. cp is a Unix command.
If you can use PowerShell instead, which should come pre-installed in modern Windows systems, you can use cp and some other Unix commands directly in it.
If PowerShell isn't an alternative, you can use cp directly in Windows Command Prompt if you install Cygwin.
Moreover, Cygwin also includes the rsync command, which has many more features than cp, and might be preferable if you're not just copying a single file (e.g. for backup purposes).

it is a unix/linux command. Download the cygwin package from cygwin.com

There's a way to do run cp without cygwin and powershell and without admin rights.
Download the respective package (CoreUtils) from the Gnu-Win32 package repository.
You need the zipped binaries and the zipped dependencies.
Unpack, and copy bin from deps to bin from coreutils.
Now add the bin folder to the path environment variable (system or user, depending on if you're admin or not), and open a new console. Type cp, and you'll see standard cp command output.

use cp of git , is good !
download here : https://git-scm.com/

Related

How to delete "The file name is too long." in windows. [Command Prompt] [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
How to delete large file path/file name files in Windows. Which is slimier to Linux rm -rf . ?
To delete The file name is too long. errors files, we've to go for simple steps using default command of Windows robocopy and rmdir.
Create directory mkdir deleteLongFilesDir under C: or D: drive
Suppose D:\Development\Liferay\themes directory contains the files which are not able to delete simply.
run command in command prompt robocopy D:\deleteLongFilesDir D:\Development\Liferay\themes /purge , this command will print some logs and copy you all the files and sub directory of D:\Development\Liferay\themes into deleteLongFilesDir folder virtually, but when you open that directory... hurreeee...It's Empty ???
Now run the command of remove directory which we created for mapping rmdir deleteLongFilesDir from command line.
Now temporary directory has been deleted and same as for D:\Development\Liferay\themes files and folder.
There is a Powershell cmdlet named Remove-Item2, written by Boe Prox a well-known MVP, and which circumvents the basic limitation path of 260 characters.
https://gallery.technet.microsoft.com/scriptcenter/Remove-LongPathFile-7a4db495
Additionally, like Remove-Item2, there are other cmdlets suffixed by the number 2, like Get-ChildItem2, which are often included in popular third party modules, and also addresses the 260 characters limitation. If you have installed some of these modules, there is a chance that you have already those cmdlets on your computer.

Windows 10 WSL with Fedora [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I basically put down this question because I have an answer that does not (yet) have a question but I still want to share it (I don't have a blog space (yet))
So, the question is: How do I use Fedora with Windows 10 WSL (Anniversary update) in stead of Ubuntu?
This answer assumes a minimal understanding of Linux (Fedora) and a basic understanding of using the windows Run command dialog (opened via the WIN-R key combination)
My starting point was this article by Seth Jennings: https://www.variantweb.net/blog/running-fedora-on-windows-10-using-wsl/
However, I ran into some challenges that were related to symlinks and started playing around. Which resulted in the description you can find below.
I think it should not be very hard to adapt these steps to use other flavors of Linux but you will have to experiment with those. If you do have a successful installation, please let us know in the comments, including any deviations required.
I start with a clean Ubuntu installation. I anything goes wrong, you can always restart with reinstalling Ubuntu
Installing a fresh instance of Ubuntu
Press WIN-R and type cmd
lxrun /uninstall /full /y
lxrun /install /y
Select a username you want to use and replace USERNAME below with that name
lxrun /setdefaultuser USERNAME
Enter user password
Download the Fedora Docker image
open a browser to http://koji.fedoraproject.org/koji/tasks?owner=&state=closed&view=flat&method=createImage&order=-id
Select the docker image you want to use
download the file Fedora-Docker-Base-??? from the Output section
for ease sake, I will assume the file is downloaded to c:\temp and that you will be using Fedora 24
Prepare Fedora in the Ubuntu instance
Press WIN-R and type bash
sudo -i
passwd root
Enter root password twice
usermod -G wheel USERNAME # Replace USERNAME with the name you used in the lxrun command above
If you choose a different version than Fedora 24, you might want to change f24 below accordingly
mkdir /f24
cd /f24
tar Jxvf /mnt/c/temp/Fedora-Docker-Base???
a directory with a hash name will be created, I will call it $DIR
tar xvf $DIR/layer.tar
for f in bin etc lib lib64 sbin usr var; do mv $f ../$f.f24; done
cd /
cp /etc/{passwd,group,shadow,sudoers} /etc.f24
edit /etc.f24/sudoers
Disable the line that starts with %sudo
Add the following line:
%wheel ALL=(ALL:ALL) NOPASSWD: ALL # The NOPASSWD is absolutely needed or sudo will not work
exit
exit
Replace Ubuntu with Fedora
Open your favorite Windows file explorer to %LOCALAPPDATA%\lxss\rootfs
Add suffix .ubuntu to the directories: bin etc lib lib64 sbin usr var
Rename the files and directories that end in .f24 to remove the suffix .f24
If you ever want to move back to Ubuntu, simply revers these steps (rename the directories and symlinks to add the .f24 suffix and remove the .ubuntu suffix (IN THAT ORDER)) Or you can simply reinstall the Ubuntu instance
Run update and install sudo and openssh clients
Press WIN-R and type bash
su -
Enter root password you set above
dnf update -y
dnf install -y sudo openssh-clients
exit
exit
Cleanup
Either via a Windows file explorer (%LOCALAPPDATA%\lxss\rootfs) or through the bash instance (cd /), remove the directories f24 and *.ubuntu
Et voila Fedora 24 on your Windows 10 system
Many tools are not installed so you have to install them manually (openssh, tar, find, and many more)
If you want to run graphical stuff you will need an X server, Cygwin/X or VcXsrv (very small) are good tools to use
And a final after thought: You could replace %LOCALAPPDATA%\lxss\bash.ico with a nice Fedora logo to replace the Ubuntu logo, just keep the filename the same.

Why does ls ~/.ssh work but not cd ~/.ssh? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
If the ls command lists the contents of a directory, then some output to ls <directory would seem to indicate that a directory exists.
For example, this is what I get:
> ls ~/.ssh
id_rsa id_rsa.pub known_hosts
But why then, when I type cd ~/.ssh do I get
> cd ~/.ssh
The system cannot find the path specified.
?
Why can I list the contents of this directory but not navigate to it?
I am using Windows 8
This answer is under the assumption that you are using the command prompt to execute these commands.
The reason that you can ls the directory but not cd to it, is because the ls command comes from a library that you downloaded that makes ls work on windows.
In contrast, your cd command is being executed from Windows, not from the library you downloaded.
In short, ls knows how to parse the tilde (~) as home, but windows doesn't know how to parse ~. try it: cd ~. it won't work.

Copy a directory when logged in via ssh to my desktop via terminal [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
How can I copy a directory to my local desktop from a remote machine ? I accessing the remote machine via ssh in the terminal.
There are lots of ways...
Using scp
On your Mac, in Terminal, make a directory on your Desktop to store the remote files:
mkdir ~/Desktop/remote
Then use scp to copy some files from the remote host to your Mac:
scp remoteHost:path/to/directory/* ~/Desktop/remote
Using rsync
Make a directory on your Desktop into which to copy the remote files:
mkdir ~/Desktop/remote
Now use rsync to make a synchronised copy of a directory on the remote machine in that folder on your Mac:
rsync -av RemoteMachine:path/to/directory/* ~/Desktop/remote
Using tar and ssh
In the Terminal on your Mac, run this:
ssh remoteMachine "tar -cf - /path/to/SomeDirectory" > ~/Desktop/RemoteDir.tar
That will log into the remote machine and create a tar file of the specified directory and write it to stdout. That will be picked up on your Mac and redirected into tar file on your Mac's Desktop that you can inspect with the Archiver or similar.
There is a easier way, install a FTP CLient like FileZilla. https://filezilla-project.org/download.php.

How to copy files across computers using SSH and MAC OS X Terminal [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I'm trying to copy my .profile, .rvm and .ssh folders/files to a new computer and keep getting a "not a regular file" response. I know how to use the cp and ssh commands but I'm not sure how to use them in order to transfer files from one computer to another.
Any help would be great, thanks!
You can do this with the scp command, which uses the ssh protocol to copy files across machines. It extends the syntax of cp to allow references to other systems:
scp username1#hostname1:/path/to/file username2#hostname2:/path/to/other/file
Copy something from this machine to some other machine:
scp /path/to/local/file username#hostname:/path/to/remote/file
Copy something from another machine to this machine:
scp username#hostname:/path/to/remote/file /path/to/local/file
Copy with a port number specified:
scp -P 1234 username#hostname:/path/to/remote/file /path/to/local/file
First zip or gzip the folders:
Use the following command:
zip -r NameYouWantForZipFile.zip foldertozip/
or
tar -pvczf BackUpDirectory.tar.gz /path/to/directory
for gzip compression use SCP:
scp username#yourserver.com:~/serverpath/public_html ~/Desktop
You may also want to look at rsync if you're doing a lot of files.
If you're going to making a lot of changes and want to keep your directories and files in sync, you may want to use a version control system like Subversion or Git. See http://xoa.petdance.com/How_to:_Keep_your_home_directory_in_Subversion

Resources