linux ls -ltr sort by name - sorting

I see many questions on this site on ls sorting
But what I need is a sorted output ls -ltr (sorted by file name)
Because I need the file sizes and dates as well for comparison.
I tried | sort -k, | sort, ls-1ltr without success.
This is the unsorted list:
ser#xeroxsqa02:/app/java/jars> ls -ltr
total 41940
-rwxr-xr-x 1 xeroxadmin mqm 331471 May 10 2017 spring-aop-3.1.1.RELEASE.jar
-rwxr-xr-x 1 xeroxadmin mqm 153115 May 10 2017 jdom-1.1.jar
-rwxr-xr-x 1 xeroxadmin mqm 185140 May 10 2017 commons-io-2.4.jar
-rwxr-xr-x 1 xeroxadmin mqm 279193 May 10 2017 commons-lang-2.5.jar
-rwxr-xr-x 1 xeroxadmin mqm 489884 May 10 2017 log4j-1.2.17.jar
-rwxr-xr-x 1 xeroxadmin mqm 53081 May 10 2017 spring-asm-3.1.1.RELEASE.jar
-rwxr-xr-x 1 xeroxadmin mqm 2095932 May 10 2017 ojdbc5-11.2.0.3.0.jar
-rwxr-xr-x 1 xeroxadmin mqm 4467 May 10 2017 aopalliance-1.0.jar
-rwxr-xr-x 1 xeroxadmin mqm 38460 May 10 2017 joda-convert-1.2.jar
-rwxr-xr-x 1 xeroxadmin mqm 1891110 May 10 2017 guava-13.0.1.jar
-rwxr-xr-x 1 xeroxadmin mqm 589824 May 10 2017 spring-beans-3.1.1.RELEASE.jar
-rwxr-xr-x 1 xeroxadmin mqm 449324 May 10 2017 spring-core-3.1.1.RELEASE.jar
-rwxr-xr-x 1 xeroxadmin mqm 232019 May 10 2017 commons-beanutils-1.8.3.jar
-rwxr-xr-x 1 xeroxadmin mqm 831068 May 10 2017 spring-context-3.1.1.RELEASE.jar
-rwxr-xr-x 1 xeroxadmin mqm 569231 May 10 2017 joda-time-2.0.jar
-rwxr-xr-x 1 xeroxadmin mqm 52915 May 10 2017 commons-logging-1.1.jar
-rwxr-xr-x 1 xeroxadmin mqm 107225 May 10 2017 spring-context-support-3.1.1.RELEASE.jar
-rwxr-xr-x 1 xeroxadmin mqm 176311 May 10 2017 spring-expression-3.1.1.RELEASE.jar
drwxr-xr-x 2 xeroxadmin mqm 46 Jun 30 2017 bkp
-rwxr-xr-x 1 xeroxadmin mqm 1599570 Jan 17 19:12 axis-1.4.jar
-rwxr-xr-x 1 xeroxadmin mqm 79796 Jan 17 19:12 commons-discovery-0.5.jar
-rwxr-xr-x 1 xeroxadmin mqm 148429 Jan 17 19:12 wsdl4j-1.6.2.jar

Have you tried following:
ls -lru
Per man page:
-u with -lt: sort by, and show, access time; with -l: show access time and sort by name; otherwise: sort by access time, newest first

Set Environment variable $LC_COLLATE to appropriate value
eg.
LC_COLLATE=en_US ls -l1va
In shell scrip,set at startup
export LC_COLLATE=en_US

ls -ltr -a can help too. It is including hidden files starting with a .

Related

Restrict hadoop client to not to create hidden checksum files

CopyToLocal command is creating a hidden checksum file. Is there a way to avoid this being created?
Unless you're running a very old version, Apache Hadoop only creates the local checksum file if you opt in to creating it by passing the -crc option as showing in the Apache Hadoop documentation for the copyToLocal command.
> hdfs dfs -copyToLocal /LICENSE.txt
> ls -lrta
drwxr-xr-x+ 131 naurc001 SWNA\Domain Users 4.3K Jan 27 09:18 ../
-rw-r--r-- 1 naurc001 SWNA\Domain Users 140K Jan 27 10:11 LICENSE.txt
drwxr-xr-x 7 naurc001 SWNA\Domain Users 238B Jan 27 10:11 ./
> hdfs dfs -copyToLocal -crc /LICENSE.txt
> ls -lrta
drwxr-xr-x+ 131 naurc001 SWNA\Domain Users 4.3K Jan 27 09:18 ../
-rw-r--r-- 1 naurc001 SWNA\Domain Users 140K Jan 27 10:07 LICENSE.txt
-rw-r--r-- 1 naurc001 SWNA\Domain Users 1.1K Jan 27 10:07 .LICENSE.txt.crc
drwxr-xr-x 8 naurc001 SWNA\Domain Users 272B Jan 27 10:07 ./
If you have the option, then I recommend running a current version and testing to make sure the -crc option is not being passed anywhere.

Not able to create bashrc in OS X

I am not able to create .bashrc file in the home directory. When I try to use touch I get:
touch: .bashrc: No such file or directory
When I type vim .bashrc in the home directory, and try to save using :w, it says
E166: Can't open linked file for writing
Edit:
Output of ls -l .bash*
lrwxr-xr-x 1 ankitsultana staff 34 Oct 30 2014 .bash -> /Users/ankitsultana/.dotfiles/bash
-rw------- 1 ankitsultana staff 7069 Nov 26 01:04 .bash_history
-rw-r--r-- 1 ankitsultana staff 2633 Nov 26 13:51 .bash_profile
-rw-r--r-- 1 ankitsultana staff 167 Sep 21 2014 .bash_profile-anaconda.bak
-rw-r--r-- 1 ankitsultana staff 1791 Jun 30 2015 .bash_profile.pysave
lrwxr-xr-x 1 ankitsultana staff 36 Oct 30 2014 .bashrc -> /Users/ankitsultana/.dotfiles/bashrc

Installing/linking g95 on osx

I found these libraries: http://www.g95.org/downloads.shtml. I downloaded the x86 OSX binaries, unzipped the file, and did ln -s bin/i686-apple-darwin10.3.0-g95 /usr/local/bin/g95, and added chmod +rx permissions to all these files, but I still can't run the g95 executable.
g95-install$ ls -la *
-rwxr-xr-x# 1 kilojoules staff 138126 Jan 17 2013 G95Manual.pdf
-rwxr-xr-x# 1 kilojoules staff 523 Jul 15 22:43 INSTALL
bin:
total 352
drwxr-xr-x# 3 kilojoules staff 102 Jan 17 2013 .
drwxr-xr-x# 6 kilojoules staff 204 Jul 15 22:43 ..
-rwxr-xr-x# 1 kilojoules staff 176968 Jan 17 2013 i686-apple-darwin10.3.0-g95
lib:
total 0
drwxr-xr-x# 3 kilojoules staff 102 Jul 15 22:39 .
drwxr-xr-x# 6 kilojoules staff 204 Jul 15 22:43 ..
drwxr-xr-x# 3 kilojoules staff 102 Jul 15 22:39 gcc-lib
$ ln -s bin/i686-apple-darwin10.3.0-g95 /usr/local/bin/g95
$PATH
-bash: /usr/local/bin:/usr/local/sbin:/Users/kilojoules/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin: No such file or directory
$ g95
-bash: g95: command not found
Why isn't there a brew formula for this?

make error installing Qsynth

Mac OSX 10.7.5
I am just trying to install Qsynth a GUI controller for fluidsynth. When I run make -d I get the following message -
...
Considering target file `src/qsynthAboutForm.ui'.
File `src/qsynthAboutForm.ui' does not exist.
...
No implicit rule found for `src/qsynthAboutForm.ui'.
Finished prerequisites of target file `src/qsynthAboutForm.ui'.
Must remake target `src/qsynthAboutForm.ui'.
make: *** No rule to make target `src/qsynthAboutForm.ui', needed by `src/qsynth'. Stop.
The file does exist in src/ and the Makefile spelling etc. is OK.
Any ideas?
Thanks
Marc
I executed the command on just qsynthAboutForm.ui and then on the entire directory.
Thanks
unknown0023121f2421:src Marc$ pwd
/Applications/qsynth-0.3.8/src
unknown0023121f2421:src Marc$ ls -l qsynthAboutForm.ui
-rw-r--r-- 1 Marc staff 3928 Jul 8 2013 qsynthAboutForm.ui
unknown0023121f2421:src Marc$ ls -l
total 1200
-rw-r--r-- 1 Marc staff 3529 Dec 2 15:09 CMakeLists.txt
-rw-r--r-- 1 Marc staff 2835 Jan 26 15:11 Makefile
-rw-r--r-- 1 Marc staff 1812 Apr 9 2010 cmakeconfig.cmake
-rw-r--r--# 1 Marc staff 2813 Dec 31 05:24 config.h.in
-rw-r--r-- 1 Marc staff 26764 Jan 26 15:11 config.log
-rwxr-xr-x 1 Marc staff 28428 Jan 26 15:11 config.status
drwxr-xr-x# 27 Marc staff 918 Dec 31 05:24 images
-rw-r--r--# 1 Marc staff 11158 Jul 8 2013 qsynth.cpp
-rw-r--r--# 1 Marc staff 431 Aug 4 11:30 qsynth.desktop.in
-rw-r--r-- 1 Marc staff 5017 Jan 18 15:56 qsynth.mak
-rw-r--r--# 1 Marc staff 224 Mar 26 2010 qsynth.pro
-rw-r--r--# 1 Marc staff 954 Mar 26 2010 qsynth.qrc
-rw-r--r-- 1 Marc staff 2773 Jan 26 15:11 qsynth.spec
-rw-r--r-- 1 Marc staff 2797 Dec 31 05:16 qsynth.spec.in
-rw-r--r--# 1 Marc staff 1442 Jan 13 2013 qsynthAbout.h
-rw-r--r--# 1 Marc staff 3178 Jul 8 2013 qsynthAboutForm.cpp
-rw-r--r--# 1 Marc staff 1535 Jul 8 2013 qsynthAboutForm.h
-rw-r--r-- 1 Marc staff 3928 Jul 8 2013 qsynthAboutForm.ui
-rw-r--r--# 1 Marc staff 1893 Jul 2 2007 qsynthChannels.cpp
-rw-r--r--# 1 Marc staff 1770 Jul 3 2007 qsynthChannels.h
-rw-r--r--# 1 Marc staff 14078 Jul 8 2013 qsynthChannelsForm.cpp
-rw-r--r--# 1 Marc staff 2546 Jul 8 2013 qsynthChannelsForm.h
-rw-r--r--# 1 Marc staff 6133 Jul 8 2013 qsynthChannelsForm.ui
-rw-r--r--# 1 Marc staff 6001 Dec 28 2012 qsynthDialClassicStyle.cpp
-rw-r--r--# 1 Marc staff 1772 Dec 28 2012 qsynthDialClassicStyle.h
-rw-r--r--# 1 Marc staff 5484 Dec 28 2012 qsynthDialPeppinoStyle.cpp
-rw-r--r--# 1 Marc staff 1559 Dec 28 2012 qsynthDialPeppinoStyle.h
-rw-r--r--# 1 Marc staff 16827 Dec 28 2012 qsynthDialSkulptureStyle.cpp
-rw-r--r--# 1 Marc staff 1458 Dec 28 2012 qsynthDialSkulptureStyle.h
-rw-r--r--# 1 Marc staff 6690 Dec 28 2012 qsynthDialVokiStyle.cpp
-rw-r--r--# 1 Marc staff 1517 Dec 28 2012 qsynthDialVokiStyle.h
-rw-r--r--# 1 Marc staff 2306 Jul 2 2007 qsynthEngine.cpp
-rw-r--r--# 1 Marc staff 2129 Jul 2 2007 qsynthEngine.h
-rw-r--r--# 1 Marc staff 4335 Jan 13 2013 qsynthKnob.cpp
-rw-r--r--# 1 Marc staff 2806 Jan 13 2013 qsynthKnob.h
-rw-r--r--# 1 Marc staff 70686 Jul 8 2013 qsynthMainForm.cpp
-rw-r--r--# 1 Marc staff 4965 Jul 8 2013 qsynthMainForm.h
-rw-r--r--# 1 Marc staff 33978 Jul 8 2013 qsynthMainForm.ui
-rw-r--r--# 1 Marc staff 5381 Mar 26 2010 qsynthMessagesForm.cpp
-rw-r--r--# 1 Marc staff 2289 Mar 26 2010 qsynthMessagesForm.h
-rw-r--r--# 1 Marc staff 2241 Mar 26 2010 qsynthMessagesForm.ui
-rw-r--r--# 1 Marc staff 11227 Sep 12 2009 qsynthMeter.cpp
-rw-r--r--# 1 Marc staff 4024 Sep 12 2009 qsynthMeter.h
-rw-r--r--# 1 Marc staff 31060 Dec 22 2012 qsynthOptions.cpp
-rw-r--r--# 1 Marc staff 3251 Dec 22 2012 qsynthOptions.h
-rw-r--r--# 1 Marc staff 9698 Jul 9 2010 qsynthOptionsForm.cpp
-rw-r--r--# 1 Marc staff 1878 Mar 26 2010 qsynthOptionsForm.h
-rw-r--r--# 1 Marc staff 22877 Jul 9 2010 qsynthOptionsForm.ui
-rw-r--r--# 1 Marc staff 11433 Dec 29 2012 qsynthPresetForm.cpp
-rw-r--r--# 1 Marc staff 2142 Jul 8 2013 qsynthPresetForm.h
-rw-r--r--# 1 Marc staff 5929 Jul 8 2013 qsynthPresetForm.ui
-rw-r--r--# 1 Marc staff 6848 Dec 22 2012 qsynthSetup.cpp
-rw-r--r--# 1 Marc staff 2730 Dec 22 2012 qsynthSetup.h
-rw-r--r--# 1 Marc staff 31309 Jul 8 2013 qsynthSetupForm.cpp
-rw-r--r--# 1 Marc staff 2550 Jul 8 2013 qsynthSetupForm.h
-rw-r--r--# 1 Marc staff 35449 Jul 8 2013 qsynthSetupForm.ui
-rw-r--r--# 1 Marc staff 3569 Jul 8 2013 qsynthSystemTray.cpp
-rw-r--r--# 1 Marc staff 2164 Jul 8 2013 qsynthSystemTray.h
-rw-r--r--# 1 Marc staff 2986 Jul 8 2013 qsynthTabBar.cpp
-rw-r--r--# 1 Marc staff 1909 Jul 8 2013 qsynthTabBar.h
drwxr-xr-x 5 Marc staff 170 Jan 26 15:11 src
-rw-r--r--# 1 Marc staff 104 Sep 25 2010 src.pri.in
-rw-r--r--# 1 Marc staff 2164 Aug 4 11:30 src.pro
drwxr-xr-x# 8 Marc staff 272 Dec 31 05:24 translations
drwxr-xr-x# 5 Marc staff 170 Dec 31 05:24 win32

what is ~/.npm dir for?

I have installed the global npm package jslint and it lives here
$ ls -la /usr/local/bin/jslint
lrwxr-xr-x 1 lust admin 40 Feb 12 15:31 /usr/local/bin/jslint -> ../lib/node_modules/jslint/bin/jslint.js
$ ls -la /usr/local/lib/node_modules/jslint/bin
total 8
drwxr-xr-x 3 lust staff 102 Apr 16 2012 .
drwxr-xr-x 10 lust staff 340 Feb 12 15:31 ..
-rwxr-xr-x 1 lust staff 2330 Apr 16 2012 jslint.js
$ which jslint
/usr/local/bin/jslint
$ head -3 /usr/local/bin/jslint
#!/usr/bin/env node
var linter = require("../lib/linter");
So it is without any doubt whatsoever at this point that jslint is in fact being run from this dir and not here:
$ ls -la .npm/jslint/0.1.9/package/bin/
total 8
drwxr-xr-x 3 lust staff 102 Apr 16 2012 .
drwxr-xr-x 9 lust staff 306 Feb 12 15:31 ..
-rwxr-xr-x 1 lust staff 2330 Apr 16 2012 jslint.js
There appear to be two copies of the package, one in /usr/local/ and one in ~/.npm. Why is there one in .npm and is it safe for me to remove it?
~/.npm is a cache that npm uses to avoid re-downloading the same package multiple times. There's no harm in removing it. You can empty it with the command:
npm cache clean

Resources