LS Display sort __ Extension

Source: Internet
Author: User
Tags bz2 syslog

LS Displays the contents of the directory, the file is in alphabetical order of A to Z, the priority is as follows;
A-Z
A-Z

That is, if you do not add any sort of parameters, the first letter of the file name is a number, will be given precedence, followed by A-Z, then A-Z, the following are the parameters of the ordering, we will know the size of the file, we need to use the-s parameter;
If it is sorted in reverse order, we need to use the-R parameter;
Sort by the last visit, using the-t parameter;
Sorts according to the extension, using the parameter-X;

Example [root@localhost ~]# ls
123.txt           fonts.scale         kernel                             Myinstall.log  upgrade.log
anaconda-ks.cfg  install.log.syslog   mkuml-2004.07.17-ananas.tar.bz2  plinux.txt     Upgrade.log.syslog [root@localhost ~]# ls-ls/root
[root@localhost ~]# ls-ls
Total 180
-rw-r--r--1 root root 68012 04-04 20:28 mkuml-2004.07.17-a nanas.tar.bz2
-rw-r--r--1 root 53992 03-16 08:54 myinstall.log

Example: [Root@localhost ~]# LS-LR
Total 180
-rw-r--r--1 root 0 03-26 18:39 upgrade.log.syslog
-rw-r--r--1 root root 613 03-26 18:41 upgrade.log
-rw-r--r--1 root 0 04-19 14:10 plinux.txt

[Root@localhost ~]# Ls-lt
Total 180
Drwxr-xr-x 2 root root 4096 04-19 20:04 kernel
-rw-r--r--1 root 04-19 15:06 123.txt
-RW-------1 root root 1375 04-19 15:04 anaconda-ks.cfg
-rw-r--r--1 root 0 04-19 14:10 plinux.txt

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.