What does the l command do?
There is a command l available on my machine which appears to do nothing. which l also produces no output. Is this a real command, and does it actually do anything?
ls print output in column form. When stdout is a terminal (rather than being redirected to a file or non-terminal device, or piped to another command),
-C is implied. So running
ls -C is the same as running
ls. But they are not equivalent when
ls is redirected or piped. For example:
ek@Kip:~/firefox$ ls application.ini libfreebl3.chk libxpcom.so blocklist.xml libfreebl3.so libxul.so chrome libmozalloc.so mozilla-xremote-client chrome.manifest libmozsqlite3.so omni.ja components libnspr4.so platform.ini crashreporter libnss3.so plugin-container ... ek@Kip:~/firefox$ ls | less application.ini blocklist.xml chrome chrome.manifest components crashreporter ...
ls -C (or
-l) outputs in column form regardless of what kind of device
ls -C | less looks like the top output (but paged by
less, of course).
The main visible difference between
l is due to the
-F flag, which causes
ls to append symbolic suffixes (called indicators) to the entries it displays. These indicators identify what kind of file or directory they are.
Compare this to the output of the first
ls command above:
ek@Kip:~/firefox$ ls -F application.ini libfreebl3.chk libxpcom.so* blocklist.xml libfreebl3.so* libxul.so* chrome/ libmozalloc.so* mozilla-xremote-client* chrome.manifest libmozsqlite3.so* omni.ja components/ libnspr4.so* platform.ini crashreporter* libnss3.so* plugin-container* ...
/means the entry is a directory.
*means the entry is a normal file and is executable (i.e., has executable permissions).
- The absence of any indicator means the entry is a normal file that is not executable.
There are several other indicators:
@means the entry is a symbolic link (see also
|means the entry is a FIFO device (remember, many resources in Unix-like OSes are represented by filesystem entries).
=means the entry is a socket.
>means the entry is a door.
--classify flag and
--indicator-style=classify are equivalent to
l are equal
raja@badfox:~/Pictures$ l des.png Screenshot from 2012-09-22 19:37:03.png Screenshot from 2012-09-22 19:37:11.png Screenshot from 2012-09-22 19:37:12.png Untitled.png raja@badfox:~/Pictures$ ls des.png Screenshot from 2012-09-22 19:37:03.png Screenshot from 2012-09-22 19:37:11.png Screenshot from 2012-09-22 19:37:12.png Untitled.png
why means there is a in-built system alias causing for this . if you want to see , open your terminal and type
alias then you will get output like this
raja@badfox:~/Pictures$ alias alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' alias egrep='egrep --color=auto' alias fgrep='fgrep --color=auto' alias grep='grep --color=auto' alias l='ls -CF' alias la='ls -A' alias ll='ls -alF' alias lock='gnome-screensaver-command -l' alias ls='ls --color=auto' alias sms='php .sms.php' raja@badfox:~/Pictures$
When in doubt,
l is aliased to `ls -alF'
(see also What does the la command do)
Our Awesome Free Tools
- Check your IP Address precisely
- Online JSON Formatter with Syntax Highlight
- Online CSS Minifier Compressor
- Online MD5 Hash Generator
- Online SHA-1, SHA-256, SHA-512 Generator
- Online Base64 Encoder/Decoder
- Online CRC-32 Calculator
- Online Triple DES Encryptor/Decryptor
- Best World Clocks
- Database Administration Tutorials
- Programming Tutorials & IT News
- Linux & DevOps World
- Entertainment & General News
- All the Free, Online Tools you need