I have created an alias gotochild2 in .bashrc file to change a particular path /parent/child1/child2. Now I want the user to enter his directory within child2 which will be dynamic. 
For example, gotodir files has to go /parent/child1/child2/files. How this can be specified in .bashrc? 
            Asked
            
        
        
            Active
            
        
            Viewed 133 times
        
    0
            
            
        1 Answers
2
            Instead of an alias use a function if you want to pass a parameter like gotodir files.
See Make a Bash alias that takes a parameter?
gotodir () {
    cd "/parent/child1/child2/$1"
}
 
    
    
        Bodo
        
- 9,287
- 1
- 13
- 29
