|
[Sponsors] |
[Other] Create a user defined folder to access like $FOAM_RUN |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 28, 2024, 11:48 |
Create a user defined folder to access like $FOAM_RUN
|
#1 |
Member
Michael Sukham
Join Date: Mar 2020
Location: India
Posts: 85
Rep Power: 6 |
I want to create different folders with alias like that of $FOAM_RUN which we can access by typing run. Example folders PHD, WORK etc which we can access using alias. Can someone help me with this? With ~/.bashrc I am not sure how to achieve this and I don't want to break my OpenFOAM installation.
Any help is appreciated. |
|
February 29, 2024, 15:12 |
|
#2 |
Member
Shravan
Join Date: Mar 2017
Posts: 75
Rep Power: 9 |
Hello,
If you want to change directory in terminal using alias, open your bashrc and add the following lines at the end Case 1: You want to change directory to a folder not in the /home/ path Lets say you want to change directory to a folder openfoam8 located in /opt/, then use alias OF8_DIR='cd /opt/openfoam8/' Case 2: You want to change directory to a folder that is in the /home/ path Lets say you want to change directory to a folder called PHD_folder that is located in /home/Michael/, then use alias PHD='cd ~/PHD_folder ' Case 3: You want to open a folder in the file manager and view it (for a GNOME desktop environment) Lets say you want to a folder openfoam8 located in /opt/, then use alias openfoam='nautilus /opt/openfoam8/' Once you paste it in the end of bashrc, then open a new terminal and do this source .bashrc Now you should be able change directories Note In order to avoid making mistakes take a backup of your current bashrc, it will be useful and restore it just in case you mess up something You can also check this thread for restoring the default bashrc: https://unix.stackexchange.com/quest...hrc-file-again Thanks |
|
March 1, 2024, 04:09 |
|
#3 | |
Member
Michael Sukham
Join Date: Mar 2020
Location: India
Posts: 85
Rep Power: 6 |
Quote:
Now I get how the alias work. I can even alias paraFoam installed in windows using the same procedure since I am using wsl2 . I consider the thread solved and closed !! Thank you Shravan! |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Create connectors with user defined distribution | Nguyen Le Hai | Pointwise & Gridgen | 0 | February 20, 2021 09:02 |
"decomposePar" not decomposing volumeVectorField located inside user defined folder | kavatar | OpenFOAM Running, Solving & CFD | 0 | December 11, 2020 02:32 |
[waves2Foam] Add user defined gauges in waveFoam | Lewis Liang | OpenFOAM Community Contributions | 3 | October 18, 2020 11:32 |
User defined time step - Possible to put variable time stepping in it? | maccheese | Fluent UDF and Scheme Programming | 19 | June 4, 2018 10:49 |
CFX 5.5 | Roued | CFX | 1 | October 2, 2001 17:49 |