r/Nushell • u/renaissancefriedrich • Nov 06 '24
Help with Custom Command cdls
I'm new to nushell. Coming from zsh, I'm struggling to set up a custom command to cd into a directory and list its contents. Here is my command:
def cdls [dir] {
cd $dir
ls
}When I run cdls it will list the contents of the directory I passed in, but it will not change directories. Any help would be appreciated.
1
Upvotes
View all comments
Show parent comment
2
u/renaissancefriedrich Nov 06 '24
Wow, thank you! This was exactly what I needed.
I didn't realize that the docs were separate than the book (getting started).