Background
I was listening in on Linux Bash training and the instructor was using the ll command.
I am so one sided with life and not at all familiar with the ll command.
ll command
Issue ll command
Let us invoke the ll command
Syntax
--ll alias ll
Sample
--ll alias ll
Output
Output – Image
Output – Text
>ll ll: command not found >
Explanation
The error is that the ll command was not found.
Troubleshooting
Outline
- Aliases
- Read
- Review
- ll
- which ll
Aliases
Read
Did a google search
Found out that ll is not a command.
But, an alias.
Review
Syntax
alias
Sample
alias
Output
Output – Image
Output – Text
alias
Explanation
The alias command returns an empty list.
command
ll
which
Syntax
Syntax
which [command]
Sample
which ll
Output
Output – Image
Output – Text
which ll
Explanation
The which command came back empty.
Login Scripts
Chris Reddington
Tale of the Tapes
Chris made a play on me on this one.
Here is what he has to say:-
Chris Reddington – Cloud With Chris
Fix for .bashrc not executing on startup in Ubuntu on Windows Subsystem for Linux
Link
When bash is invoked as an interactive login shell, or as a non-interactive shell with the –login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. The –noprofile option may be used when the shell is started to inhibit this behavior.
- /etc/profile
- ~/.bash_profile
- ~/.bash_login
- ~/.profile
- ~/.bashrc
In closing, Chris says go read Bash Manuals ( Link ).
Files
File:- ~/.bashrc
Image
Text
# some more ls aliases alias ll='ls -alF' alias la='ls -A' alias l='ls -CF' # Alias definitions. # You may want to put all your additions into a separate file like # ~/.bash_aliases, instead of adding them here directly. # See /usr/share/doc/bash-doc/examples in the bash-doc package. if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi
Explanation
- Aliases
- ll => ls -alF
- List all files including hidden ones in long form
- -a
- Hidden Files
- l
- Long form ( as opposed to default wide form )
- F
- -F, –classify[=WHEN]
append indicator (one of */=>@|) to entries WHEN
- -F, –classify[=WHEN]
- -a
- List all files including hidden ones in long form
- la => ls -A
- List all files including hidden ones
- l => ls -CF
- ll => ls -alF
- If file ~/.bash_aliases exists
- Source it
- .~/.bash_aliases
- Source it
File:- ~/.profile
Image
Text
# if running bash if [ -n "$BASH_VERSION" ]; then # include .bashrc if it exists if [ -f "$HOME/.bashrc" ]; then . "$HOME/.bashrc" fi fi
Explanation
- $BASH_VERSION
- $BASH_VERSION is an internal variable
- The script checks if it is defined ( -n $BASH_VERSION )
- $HOME/.bashrc
- The system checks whether a file name $HOME/.bashrc exists
- In case the file ( $HOME/.bashrc exists ) it is sourced
File:- ~/.bash_profile
From an earlier customization effort, I had created .bash_profile.
I quickly cleanedup.
I renamed the file.
mv ~/.bash_profile ~/.bash_profile.bak
Making pretend nice.
Image
References
- Chris Eddington
- CloudWithChris
- Blogs
- Fix for .bashrc not executing on startup in Ubuntu on Windows Subsystem for Linux
Link
- Fix for .bashrc not executing on startup in Ubuntu on Windows Subsystem for Linux
- Blogs
- CloudWithChris
- LinuxConfig.org
- How to remove alias on Linux
Linux
- How to remove alias on Linux
- Quora
- What is the difference between ‘ls -l’ and the ‘ll’ command on Linux?
Link
- What is the difference between ‘ls -l’ and the ‘ll’ command on Linux?
- Stack Exchange
- Unix & Linux
- Difference between ls -l and ll?
Link
- Difference between ls -l and ll?
- Unix & Linux