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

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.

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.

Is it possible to map a path in OSX? [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 7 years ago.
Improve this question
I am using VMware share folder fonction:
so i have the path /Volume/VMware Shared Folder/DevFolder/
Is it possible to map this path to be able to access the same folder using
cd /DevFolder
I try :
sudo ln -f -s /Volume/VMware Shared Folder/DevFolder/ /dev_folder
then
cd /dev_folder
-> No such file or directory
And
sudo ln -f -s /Volume/VMware Shared Folder/DevFolder/ /Users/nassimus/Desktop/dev
it create an icon on the desktop, but when i click on it shows : The original item 'Dev' cant be found
Two problems - you have typos in the path (/Volume should be /Volumes and Folder should be Folders), and you also need to escape the spaces:
sudo ln -fs /Volumes/VMware\ Shared\ Folders/DevFolder/ /dev_folder
^ ^ ^ ^

CP command prompt Windows 7 not recognized [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 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/

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

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