Prashanth R
Prashanth R

Reputation: 95

How do I use spaces in my command to cd to a directory and its sub directories using aliases?

Suppose I am interested in this directory :

/home/username/dummy1/

And dummy1 has these subfolders :

sub_dummy1

sub_dummy2 .. which in turn can consist of various directories and so on.

Is there anyway I can write an alias in .cshrc to navigate to dummy1 and various subfolders ?

For e.g :

username@unix-system: dummy1 sub_dummy1
username@unix-system: dummy1 sub_dummy1/sub_sub_dummy1/sub_sub_sub_dummy2

(Takes me to sub_dummy1 if I hit Enter, shows me contents of sub_dummy1 if I hit Tab)

Upvotes: 0

Views: 32

Answers (1)

Digvijay S
Digvijay S

Reputation: 2715

try alias

alias mycmd="cd ${HOME}/dummy1/sub_dummy1 && ls -1"

Upvotes: 1

Related Questions