How to create an folder path alias on ubuntu EC2 instance? The Next CEO of Stack Overflowaccess to usr/local/binApache Alias Folder: 403 Access ForbiddenCommand not found for aliasRun program from anywhere without changing directoryWriting an alias that puts a folder and its subfolders/files into an encrypted archive titled with the dateHow to resolve ERROR: virtualenvwrapper could not find virtualenv in your pathHow to remove a directory path from PATH permanently?Editing bashrc to run a program from the terminalCannot source .nanorc correctly: command “include” not foundalias not working inside bash shell script
Loop in macOS not working
What is a typical Mizrachi Seder like?
Upgrading From a 9 Speed Sora Derailleur?
What is the difference between 서고 and 도서관?
Would a grinding machine be a simple and workable propulsion system for an interplanetary spacecraft?
What steps are necessary to read a Modern SSD in Medieval Europe?
Mathematica command that allows it to read my intentions
Prodigo = pro + ago?
How did scripture get the name bible?
Is it possible to create a QR code using text?
Why was Sir Cadogan fired?
How does a dynamic QR code work?
Shortening a title without changing its meaning
Calculate the Mean mean of two numbers
Compensation for working overtime on Saturdays
Can I hook these wires up to find the connection to a dead outlet?
Gauss' Posthumous Publications?
Creating a script with console commands
How badly should I try to prevent a user from XSSing themselves?
Read/write a pipe-delimited file line by line with some simple text manipulation
Finitely generated matrix groups whose eigenvalues are all algebraic
How to coordinate airplane tickets?
Car headlights in a world without electricity
Scale won't save
How to create an folder path alias on ubuntu EC2 instance?
The Next CEO of Stack Overflowaccess to usr/local/binApache Alias Folder: 403 Access ForbiddenCommand not found for aliasRun program from anywhere without changing directoryWriting an alias that puts a folder and its subfolders/files into an encrypted archive titled with the dateHow to resolve ERROR: virtualenvwrapper could not find virtualenv in your pathHow to remove a directory path from PATH permanently?Editing bashrc to run a program from the terminalCannot source .nanorc correctly: command “include” not foundalias not working inside bash shell script
ubuntu 18.04 on AWS
I followed an answer on stackoverflow to create a path alias:
nano ~/.bashrc
alias myfolder='/home/xxx/pms'
When I try to cd
cd myfolder
I get:
No such file or Directory
But if I use the path it works.
I am not sure what the issue here is.
TIA
command-line bash amazon-ec2 alias
add a comment |
ubuntu 18.04 on AWS
I followed an answer on stackoverflow to create a path alias:
nano ~/.bashrc
alias myfolder='/home/xxx/pms'
When I try to cd
cd myfolder
I get:
No such file or Directory
But if I use the path it works.
I am not sure what the issue here is.
TIA
command-line bash amazon-ec2 alias
If you usealias "myfolder"="cd /home/xxx/pms"
andsource ~/.bashrc
you'll be able to access your folder typing onlymyfolder
on the terminal...
– Rafael Muynarsk
Mar 25 at 14:00
add a comment |
ubuntu 18.04 on AWS
I followed an answer on stackoverflow to create a path alias:
nano ~/.bashrc
alias myfolder='/home/xxx/pms'
When I try to cd
cd myfolder
I get:
No such file or Directory
But if I use the path it works.
I am not sure what the issue here is.
TIA
command-line bash amazon-ec2 alias
ubuntu 18.04 on AWS
I followed an answer on stackoverflow to create a path alias:
nano ~/.bashrc
alias myfolder='/home/xxx/pms'
When I try to cd
cd myfolder
I get:
No such file or Directory
But if I use the path it works.
I am not sure what the issue here is.
TIA
command-line bash amazon-ec2 alias
command-line bash amazon-ec2 alias
asked Mar 25 at 10:58
SidSid
1135
1135
If you usealias "myfolder"="cd /home/xxx/pms"
andsource ~/.bashrc
you'll be able to access your folder typing onlymyfolder
on the terminal...
– Rafael Muynarsk
Mar 25 at 14:00
add a comment |
If you usealias "myfolder"="cd /home/xxx/pms"
andsource ~/.bashrc
you'll be able to access your folder typing onlymyfolder
on the terminal...
– Rafael Muynarsk
Mar 25 at 14:00
If you use
alias "myfolder"="cd /home/xxx/pms"
and source ~/.bashrc
you'll be able to access your folder typing only myfolder
on the terminal...– Rafael Muynarsk
Mar 25 at 14:00
If you use
alias "myfolder"="cd /home/xxx/pms"
and source ~/.bashrc
you'll be able to access your folder typing only myfolder
on the terminal...– Rafael Muynarsk
Mar 25 at 14:00
add a comment |
1 Answer
1
active
oldest
votes
What you're trying
You may be thinking of the term alias as defined and used in Mac OS.
For ubuntu the command alias does something totally different. The command you have used is for creating new commands so you don't have to remember a longer command, or a longer command you type so much it is quicker to type the alias. For example, if I don't want to keep typing this command to launch a program:
java -jar /usr/local/bin/bfg-1.13.0.jar
You could create an alias called bfg
in my Unix profile (or ~/.bashrc
as you have) like this:
alias bfg='java -jar /usr/local/bin/bfg-1.13.0.jar'
From now on I can use bfg
every time I want to run the java program.
What you really need
In Ubuntu what you're looking for is a symbolic link. A symbolic link is created with the ln
command on Ubuntu (and all other Unix varieties). See the following example.
In the below example you can see a folder that already exists called pms
in my home folder.
Thus its absolute path is /home/ubuntu/pms
.
ubuntu@server:~$ ls -l
total 4
drwxrwxr-x 2 ubuntu ubuntu 4096 Mar 25 11:05 pms
Now I change to a mother directory where I want the link, what you are thinking of as an alias, and create the symbolic link with ln -s
ubuntu@server:~$ cd /tmp/
ubuntu@server:/tmp$ ln -s /home/ubuntu/pms myfolder
Now I'm able to change directory to this alias as you understand it.
ubuntu@server:/tmp$ cd myfolder/
ubuntu@server:/tmp/myfolder$ pwd
/tmp/myfolder
To be clear, an alias is a completely different thing in Unix & Linux land. The symbolic link I have made can be seen by listing the /tmp
directory where I created it.
ubuntu@server:/tmp/myfolder$ cd /tmp
ubuntu@server:/tmp$ ls -l
total 16
lrwxrwxrwx 1 ubuntu ubuntu 16 Mar 25 11:06 myfolder -> /home/ubuntu/pms
The contents of the /tmp/myfolder
are one and the same as /home/ubuntu/pms
.
Thanks for the detailed explanation. Now when I make changes to certain files using the above link, the changes will carry through?
– Sid
Mar 25 at 11:44
Yes. Files and folders seen and created in the symlinked folder (from the example)/tmp/myfolder
and in the original/home/ubuntu/pms
are actually the same files on the disk.
– lantrix
Mar 26 at 10:42
add a comment |
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1128497%2fhow-to-create-an-folder-path-alias-on-ubuntu-ec2-instance%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
What you're trying
You may be thinking of the term alias as defined and used in Mac OS.
For ubuntu the command alias does something totally different. The command you have used is for creating new commands so you don't have to remember a longer command, or a longer command you type so much it is quicker to type the alias. For example, if I don't want to keep typing this command to launch a program:
java -jar /usr/local/bin/bfg-1.13.0.jar
You could create an alias called bfg
in my Unix profile (or ~/.bashrc
as you have) like this:
alias bfg='java -jar /usr/local/bin/bfg-1.13.0.jar'
From now on I can use bfg
every time I want to run the java program.
What you really need
In Ubuntu what you're looking for is a symbolic link. A symbolic link is created with the ln
command on Ubuntu (and all other Unix varieties). See the following example.
In the below example you can see a folder that already exists called pms
in my home folder.
Thus its absolute path is /home/ubuntu/pms
.
ubuntu@server:~$ ls -l
total 4
drwxrwxr-x 2 ubuntu ubuntu 4096 Mar 25 11:05 pms
Now I change to a mother directory where I want the link, what you are thinking of as an alias, and create the symbolic link with ln -s
ubuntu@server:~$ cd /tmp/
ubuntu@server:/tmp$ ln -s /home/ubuntu/pms myfolder
Now I'm able to change directory to this alias as you understand it.
ubuntu@server:/tmp$ cd myfolder/
ubuntu@server:/tmp/myfolder$ pwd
/tmp/myfolder
To be clear, an alias is a completely different thing in Unix & Linux land. The symbolic link I have made can be seen by listing the /tmp
directory where I created it.
ubuntu@server:/tmp/myfolder$ cd /tmp
ubuntu@server:/tmp$ ls -l
total 16
lrwxrwxrwx 1 ubuntu ubuntu 16 Mar 25 11:06 myfolder -> /home/ubuntu/pms
The contents of the /tmp/myfolder
are one and the same as /home/ubuntu/pms
.
Thanks for the detailed explanation. Now when I make changes to certain files using the above link, the changes will carry through?
– Sid
Mar 25 at 11:44
Yes. Files and folders seen and created in the symlinked folder (from the example)/tmp/myfolder
and in the original/home/ubuntu/pms
are actually the same files on the disk.
– lantrix
Mar 26 at 10:42
add a comment |
What you're trying
You may be thinking of the term alias as defined and used in Mac OS.
For ubuntu the command alias does something totally different. The command you have used is for creating new commands so you don't have to remember a longer command, or a longer command you type so much it is quicker to type the alias. For example, if I don't want to keep typing this command to launch a program:
java -jar /usr/local/bin/bfg-1.13.0.jar
You could create an alias called bfg
in my Unix profile (or ~/.bashrc
as you have) like this:
alias bfg='java -jar /usr/local/bin/bfg-1.13.0.jar'
From now on I can use bfg
every time I want to run the java program.
What you really need
In Ubuntu what you're looking for is a symbolic link. A symbolic link is created with the ln
command on Ubuntu (and all other Unix varieties). See the following example.
In the below example you can see a folder that already exists called pms
in my home folder.
Thus its absolute path is /home/ubuntu/pms
.
ubuntu@server:~$ ls -l
total 4
drwxrwxr-x 2 ubuntu ubuntu 4096 Mar 25 11:05 pms
Now I change to a mother directory where I want the link, what you are thinking of as an alias, and create the symbolic link with ln -s
ubuntu@server:~$ cd /tmp/
ubuntu@server:/tmp$ ln -s /home/ubuntu/pms myfolder
Now I'm able to change directory to this alias as you understand it.
ubuntu@server:/tmp$ cd myfolder/
ubuntu@server:/tmp/myfolder$ pwd
/tmp/myfolder
To be clear, an alias is a completely different thing in Unix & Linux land. The symbolic link I have made can be seen by listing the /tmp
directory where I created it.
ubuntu@server:/tmp/myfolder$ cd /tmp
ubuntu@server:/tmp$ ls -l
total 16
lrwxrwxrwx 1 ubuntu ubuntu 16 Mar 25 11:06 myfolder -> /home/ubuntu/pms
The contents of the /tmp/myfolder
are one and the same as /home/ubuntu/pms
.
Thanks for the detailed explanation. Now when I make changes to certain files using the above link, the changes will carry through?
– Sid
Mar 25 at 11:44
Yes. Files and folders seen and created in the symlinked folder (from the example)/tmp/myfolder
and in the original/home/ubuntu/pms
are actually the same files on the disk.
– lantrix
Mar 26 at 10:42
add a comment |
What you're trying
You may be thinking of the term alias as defined and used in Mac OS.
For ubuntu the command alias does something totally different. The command you have used is for creating new commands so you don't have to remember a longer command, or a longer command you type so much it is quicker to type the alias. For example, if I don't want to keep typing this command to launch a program:
java -jar /usr/local/bin/bfg-1.13.0.jar
You could create an alias called bfg
in my Unix profile (or ~/.bashrc
as you have) like this:
alias bfg='java -jar /usr/local/bin/bfg-1.13.0.jar'
From now on I can use bfg
every time I want to run the java program.
What you really need
In Ubuntu what you're looking for is a symbolic link. A symbolic link is created with the ln
command on Ubuntu (and all other Unix varieties). See the following example.
In the below example you can see a folder that already exists called pms
in my home folder.
Thus its absolute path is /home/ubuntu/pms
.
ubuntu@server:~$ ls -l
total 4
drwxrwxr-x 2 ubuntu ubuntu 4096 Mar 25 11:05 pms
Now I change to a mother directory where I want the link, what you are thinking of as an alias, and create the symbolic link with ln -s
ubuntu@server:~$ cd /tmp/
ubuntu@server:/tmp$ ln -s /home/ubuntu/pms myfolder
Now I'm able to change directory to this alias as you understand it.
ubuntu@server:/tmp$ cd myfolder/
ubuntu@server:/tmp/myfolder$ pwd
/tmp/myfolder
To be clear, an alias is a completely different thing in Unix & Linux land. The symbolic link I have made can be seen by listing the /tmp
directory where I created it.
ubuntu@server:/tmp/myfolder$ cd /tmp
ubuntu@server:/tmp$ ls -l
total 16
lrwxrwxrwx 1 ubuntu ubuntu 16 Mar 25 11:06 myfolder -> /home/ubuntu/pms
The contents of the /tmp/myfolder
are one and the same as /home/ubuntu/pms
.
What you're trying
You may be thinking of the term alias as defined and used in Mac OS.
For ubuntu the command alias does something totally different. The command you have used is for creating new commands so you don't have to remember a longer command, or a longer command you type so much it is quicker to type the alias. For example, if I don't want to keep typing this command to launch a program:
java -jar /usr/local/bin/bfg-1.13.0.jar
You could create an alias called bfg
in my Unix profile (or ~/.bashrc
as you have) like this:
alias bfg='java -jar /usr/local/bin/bfg-1.13.0.jar'
From now on I can use bfg
every time I want to run the java program.
What you really need
In Ubuntu what you're looking for is a symbolic link. A symbolic link is created with the ln
command on Ubuntu (and all other Unix varieties). See the following example.
In the below example you can see a folder that already exists called pms
in my home folder.
Thus its absolute path is /home/ubuntu/pms
.
ubuntu@server:~$ ls -l
total 4
drwxrwxr-x 2 ubuntu ubuntu 4096 Mar 25 11:05 pms
Now I change to a mother directory where I want the link, what you are thinking of as an alias, and create the symbolic link with ln -s
ubuntu@server:~$ cd /tmp/
ubuntu@server:/tmp$ ln -s /home/ubuntu/pms myfolder
Now I'm able to change directory to this alias as you understand it.
ubuntu@server:/tmp$ cd myfolder/
ubuntu@server:/tmp/myfolder$ pwd
/tmp/myfolder
To be clear, an alias is a completely different thing in Unix & Linux land. The symbolic link I have made can be seen by listing the /tmp
directory where I created it.
ubuntu@server:/tmp/myfolder$ cd /tmp
ubuntu@server:/tmp$ ls -l
total 16
lrwxrwxrwx 1 ubuntu ubuntu 16 Mar 25 11:06 myfolder -> /home/ubuntu/pms
The contents of the /tmp/myfolder
are one and the same as /home/ubuntu/pms
.
edited Mar 26 at 10:43
answered Mar 25 at 11:13
lantrixlantrix
1565
1565
Thanks for the detailed explanation. Now when I make changes to certain files using the above link, the changes will carry through?
– Sid
Mar 25 at 11:44
Yes. Files and folders seen and created in the symlinked folder (from the example)/tmp/myfolder
and in the original/home/ubuntu/pms
are actually the same files on the disk.
– lantrix
Mar 26 at 10:42
add a comment |
Thanks for the detailed explanation. Now when I make changes to certain files using the above link, the changes will carry through?
– Sid
Mar 25 at 11:44
Yes. Files and folders seen and created in the symlinked folder (from the example)/tmp/myfolder
and in the original/home/ubuntu/pms
are actually the same files on the disk.
– lantrix
Mar 26 at 10:42
Thanks for the detailed explanation. Now when I make changes to certain files using the above link, the changes will carry through?
– Sid
Mar 25 at 11:44
Thanks for the detailed explanation. Now when I make changes to certain files using the above link, the changes will carry through?
– Sid
Mar 25 at 11:44
Yes. Files and folders seen and created in the symlinked folder (from the example)
/tmp/myfolder
and in the original /home/ubuntu/pms
are actually the same files on the disk.– lantrix
Mar 26 at 10:42
Yes. Files and folders seen and created in the symlinked folder (from the example)
/tmp/myfolder
and in the original /home/ubuntu/pms
are actually the same files on the disk.– lantrix
Mar 26 at 10:42
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1128497%2fhow-to-create-an-folder-path-alias-on-ubuntu-ec2-instance%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
If you use
alias "myfolder"="cd /home/xxx/pms"
andsource ~/.bashrc
you'll be able to access your folder typing onlymyfolder
on the terminal...– Rafael Muynarsk
Mar 25 at 14:00