list directory using powershell command 1

list directory using powershell command

use dir command to list directory in cmd which is the equivalent for ls in linux

Here is what the above code is Doing:
1. We are using the os module to get the current working directory.
2. We are using the os module to list all the files and directories in the current working directory.
3. We are using the os module to change the current working directory to the directory we want to list.
4. We are using the os module to list all the files and directories in the current working directory.
5. We are using the os module to change the current working directory back to the original directory.

Similar Posts