How to use the option equivalent to the 'ls' command in Windows
Linux has a very powerful and valuable command line terminal that is used and loved by users. So, if you've used Linux's Command Line Interface (CLI) before and just recently started using Windows' Command Prompt, you'll feel overwhelmed by the lack of familiar features.
There are many commands supported on the Linux terminal that do not exist on Windows 10 and 11. Fortunately, the 'ls' command is a supported command on the Windows Command Prompt. Read on to discover how to use the "ls" command in Windows 10 and 11!
What is the 'ls' command?
The 'ls' command (note LS, not IS) is one of the first terminal commands that "veterans" teach newcomers to Linux. It allows users to list files and directories from CLI. You can think of it as a File Explorer, but without the user-friendly icons and navigation buttons. By using the 'ls' command, a Linux user can list the contents of the current working directory.
How to use the 'ls' command in Windows Command Prompt
Windows is a completely different ecosystem when compared to Linux. As a result, many Linux CLI commands are not supported by the Windows Command Prompt tool. If you try to use the 'ls' command in the Command Prompt, you will get the following error 'ls is not recognized as an internal or external command, operable program or batch file' . internal or external, operable program or batch file).
However, you can use the 'ls' command function in Windows with the equivalent dir command in the Command Prompt.
To list files and folders using Command Prompt in Windows 10 and 11:
1. Click the Start menu icon, search for Command Prompt, right click on Best Match and select Run as administrator .
2. Once the Command Prompt window is open, navigate to the folder you want to view and enter dir.
3. Command Prompt will now list all files in the current working directory, along with their size and last modified date.
How to use the "ls" command in Windows PowerShell
Although the "ls" command does not work on Windows Command Prompt, it does work in Windows PowerShell. Windows PowerShell is a very powerful utility and even allows you to perform complex file management tasks such as creating, deleting, copying files and folders straight through the terminal.
PowerShell's Get-ChildItem cmdlet allows users to easily list file directories using any alias, such as ls, dir, and even gci.
To view the file directory with the "ls" command in Windows PowerShell:
1. Launch Windows PowerShell using the Start menu and select Best match.
2. Navigate to your destination directory with the cd command.
3. Type ls command and press Enter to see all the files and folders listed in your target directory.
4. Similarly, you can even use the dir or gci command to view the contents of a directory.
You should read it
May be interested
- Sub-commands in nslookup Windows command (Part 3)nslookup set recurse, nslookup set retry, nslookup set root, nslookup set search, nslookup set srchlist, nslookup set timeout, nslookup set type, nslookup set vc, and nslookup view in windows
- Command at in Windowsthe at command schedules commands and programs to run on a computer at a specified time with a specific date. you can only use the command at when schedule service is running.
- Set command in Windowsthe set command helps show, set or remove cmd.exe environment variables.
- Del command in Windowsthe del command deletes one or more files. this command is the same as the eraser command.
- 10 useful commands in Windows you should knowcommand prompt is used to execute batch files, perform tasks quickly, help you troubleshoot and solve some windows problems when the system crashes. however, not all commands in windows are useful and must be done regularly. with the 10 command lines in the following article it is very useful even if you are not an administrator.
- The command reg add in Windowsthe reg add command adds new subkeys or entries to the registry.
- Rem command in Windowsthe rem command helps write comments (comments) in a batch file or config.sys.
- How to Fix Full Screen Command Promptin windows xp, you can quickly set the command prompt to full-screen mode with the press of a key. with windows vista, 7, and 8, the full-screen option has been removed. this is due to the changes microsoft made to the display drivers in...
- Fix Full Screen in Command Promptin windows xp, you can quickly set the command prompt to full-screen mode with the press of a key. with windows vista, 7, and 8, the full-screen option has been removed. this is due to the changes microsoft made to the display drivers in...
- Instructions for using Command Promptdeep in windows is a command-line world that is obscure. in this article, we will show you how to solve errors and make your computer more secure.