Using bash shell scripting:
When you "cd" into a directory, very often you will run "ls" immediately after it. So we can put a function called "cl" like this at the end of .bashrc file in your home directory. By doing that, "cl" function will be loaded every time you log in or open a new bash shell. This way, you can use "cl directory_name"to cd and ls the contents in a directory. Please write your function called "cl" and test it on your VM. Copy your function "cl" code implementation here.
function cl()
{
cd -P "$1" && ls -l
}
if you have any doubt then please ask me without any hesitation in the comment section below , if you like my answer then please thumbs up for the answer , before giving thumbs down please discuss the question it may possible that we may understand the question different way and i can edit and change the answers if you argue, thanks :)
Get Answers For Free
Most questions answered within 1 hours.