That's an excellent command to try, and it highlights how && works!
When you execute mkdir fail_dir && cd fail_dir:
mkdir fail_dirwill first attempt to create a directory namedfail_dir.- If
mkdir fail_dirsucceeds (meaningfail_dirwas created without issues), then the commandcd fail_dirwill be executed, and you will change your current directory intofail_dir. - If
mkdir fail_dirfails (for example, if a directory namedfail_diralready exists, or you don't have the necessary permissions), then thecd fail_dircommand will not be executed. This is the beauty of&&– it prevents you from trying tocdinto a directory that wasn't successfully created.
Go ahead and type mkdir fail_dir && cd fail_dir into your terminal.
What do you observe? If you run it a second time, what happens then? Let Labby know!