Linux Command 'Ll' Is Not Working

Linux command 'll' is not working

Try sudo ls -l.

As ll is a shorthand for ls -l.

ls command is not working in bash.Error messages are getting displayed whenever I open bash

I have followed what David C Rankin has mentioned in comments.

These are following the below steps:

  1. opened terminal using cntrl+Alt+F2

  2. Later added path step by step using export command

as
export PATH ="/opt/ros/kinetic/bin:/home/neelesh/bin:/home/neelesh /.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin: /bin:/usr/local/games:/snap/bin"


  1. Later using ctrl + alt + F7, I have exited the terminal.

  2. restarted the system.

Now everything works fine.

Command 'ls' not working in command prompt

Use the command dir to list all the directories and files in Windows; ls is a unix command.

ls' is not recognized as an internal or external command, operable program or batch file

I'm fairly certain that the ls command is for Linux, not Windows (I'm assuming you're using Windows as you referred to cmd, which is the command line for the Windows OS).

You should use dir instead, which is the Windows equivalent of ls.

Edit (since this post seems to be getting so many views :) ):

You can't use ls on cmd as it's not shipped with Windows, but you can use it on other terminal programs (such as GitBash). Note, ls might work on some FTP servers if the servers are linux based and the FTP is being used from cmd.

dir on Windows is similar to ls. To find out the various options available, just do dir/?.

If you really want to use ls, you could install 3rd party tools to allow you to run unix commands on Windows. Such a program is Microsoft Windows Subsystem for Linux (link to docs).

ls - Not working in certain directories

The problem is in how * works in the shell.

Some people think that when you write ls * the shell will run ls passing the wildcard and that command will list all the files. But actually it is the shell that expands the * into a list of all the files and passes them to ls.

TL;DR; you have a directory name that starts with -! (I think that it is named just -). So when you run ls -d */ it is expanded to something like ls -d -/ bar/ muz/ .... You can see the actual expansion with echo ls -d */

Solution: write ls -d -- */. The -- will tell the command not to interpret any further command starting with - as an option, but as a file name.



Related Topics



Leave a reply



Submit