3

I added a new user to a fresh Raspbian Lite install (4.14 2019-04-08, Raspbian Stretch Lite). On a pi zero, I had direct access and had signed in as the pi user. Via Wifi I had authenticated as the new user.

As the pi user I did:

pi@rpizero:~ $ touch hello

As the newuser I did:

newuser@rpizero:~ $ ll ../pi/
.ansible/      .bash_history  .bash_logout   .bashrc        hello          .profile       
newuser@rpizero:~ $ rm ../pi/hello 
rm: remove write-protected regular empty file '../pi/hello'? 
newuser@rpizero:~ $ ll ../pi
-bash: ll: command not found

Restarting the device does not help as the ll command is still not found.

Why did the ll command "get destroyed" when trying to remove the hello file? Very confused.

6

There is no standard ll command. Often there is an alias that defines ll as ls -l.

The output in your question is not from ls -l.

It seems that you have typed ll ../pi/ at the shell prompt and then pressed the Tab Key. This resulted in the display of the available completions. This is a function of the shell and doesn't check whether a command ll is available.

After you removed ../pi/hello, you didn't use tab completion, you tried to execute the ll command/alias.

The most likely explanation is that you never had an alias ll defined, and the removal of the file ../pi/hello had no effect on that.

| improve this answer | |
  • I think I must have hit the tab key subconsciously. Thanks. I feel like I should delete my question due to serious * facepalm *... what do you think? – AJP May 31 '19 at 11:22
  • 2
    It is a valid question, and others may have the same problem. – RalfFriedl May 31 '19 at 11:49
1

Here's how to enable the ll command (as RaflFriedl correctly mentioned, it's an alias to the ls -l command)...

Open a terminal and make sure you're in your root dir:

cd ~

Open the .bashrc file. I like using nano. Use sudo apt-get install nano in case it's not installed, then...

nano .bashrc

Scroll half way down, where you'll see:

# some more ls aliases
alias ll='ls -l'
#alias la='ls -A'
#alias l='ls -CF'

Remove the # that was in front of the alias ll='ls -l' line.

To exit nano, Ctrl+X, then 'Y' to confirm the save, then Enter to confirm you're overwriting the file.

Open a new terminal, and you're set! ...Or type exec bash in the current terminal to reload the .bashrc file that you just updated.

More details here: https://www.raspberrypi.org/documentation/linux/usage/bashrc.md

| improve this answer | |
New contributor
Ryan Loggerythm is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • And edit /etc/skel/.bashrc to include the changes as well, then will new users also get the ll command automatically. – Mats Karlsson Oct 27 at 13:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.