How do I navigate using a symlink? [closed] - macos

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"

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 ~

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
^ ^ ^ ^

symlink mac from outside folder [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
Imagine this is my folder structure
filepath\targetpath
filepath\folder1
I can create the symlink when I am inside the targetpath folder
ln -s ..\folder1 folder2
but when I try to create symlink from upper level with below command
ln -s filepath\folder1 filepath\targetpath\folder2
it create shortcut file rather than a symlink to filepath.
How can I create symlink when I am outside of the targetpath folder?
If a symbolic link is not an absolute pathname (begins with /) it is interpreted relative to the directory containing the link, not your cwd when you make the link. So if you do:
ln -s filepath/folder1 filepath/targetpath/folder2
the target of the link is filepath/targetpath/filepath/folder1. You should make the symlink the same way as you did the first time:
ln -s ../folder1 filepath/targetpath/folder2

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

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