I'm trying to deploy my qt app under Ubuntu.
I have Qt5.1.1. Libraries are linked dynamically.
In main()
QStringList paths = QCoreApplication::libraryPaths();
paths.append("libs");
paths.append("platform");
paths.append("audio");
paths.append("designer");
paths.append("sqldrivers");
QCoreApplication::setLibraryPaths(paths);
Folder structure (ls -Rl):
total 3184
drwxr-xr-x 2 viktor viktor 4096 Oct 25 10:09 audio
drwxr-xr-x 2 viktor viktor 4096 Oct 25 10:09 designer
drwxr-xr-x 2 viktor viktor 4096 Dec 5 12:18 libs
drwxr-xr-x 2 viktor viktor 4096 Oct 25 10:09 platforms
drwxr-xr-x 2 viktor viktor 4096 Dec 5 12:18 sqldrivers
-rwxr-xr-x 1 viktor viktor 3237902 Dec 5 13:06 App
./audio:
total 84
-rwxr-xr-x 1 viktor viktor 84564 Aug 27 14:24 libqtmedia_pulse.so
./designer:
total 32
-rwxr-xr-x 1 viktor viktor 14820 Aug 27 14:24 libqdeclarativeview.so
-rwxr-xr-x 1 viktor viktor 15248 Aug 27 14:24 libqwebview.so
./libs:
total 86524
-rwxr-xr-x 1 viktor viktor 22315900 Apr 29 2013 libicudata.so.51
-rwxr-xr-x 1 viktor viktor 2698565 Apr 29 2013 libicui18n.so.51
-rwxr-xr-x 1 viktor viktor 1742896 Apr 29 2013 libicuuc.so.51
-rwxr-xr-x 1 viktor viktor 4721396 Oct 25 10:10 libQt5Core.so.5
-rwxr-xr-x 1 viktor viktor 4629056 Aug 27 14:23 libQt5Gui.so.5
-rwxr-xr-x 1 viktor viktor 874308 Aug 27 14:23 libQt5Multimedia.so.5
-rwxr-xr-x 1 viktor viktor 1406652 Aug 27 14:23 libQt5Network.so.5
-rwxr-xr-x 1 viktor viktor 397104 Aug 27 14:23 libQt5OpenGL.so.5
-rwxr-xr-x 1 viktor viktor 334468 Aug 27 14:23 libQt5PrintSupport.so.5
-rwxr-xr-x 1 viktor viktor 2705336 Aug 27 14:23 libQt5Qml.so.5
-rwxr-xr-x 1 viktor viktor 3285156 Aug 27 14:23 libQt5Quick.so.5
-rwxr-xr-x 1 viktor viktor 224744 Aug 27 14:21 libQt5Sensors.so.5
-rwxr-xr-x 1 viktor viktor 256756 Aug 27 14:23 libQt5Sql.so.5
-rwxr-xr-x 1 viktor viktor 4627352 Aug 27 14:23 libQt5V8.so.5.1.1
-rwxr-xr-x 1 viktor viktor 31642416 Aug 27 14:23 libQt5WebKit.so.5
-rwxr-xr-x 1 viktor viktor 241052 Aug 27 14:23 libQt5WebKitWidgets.so.5
-rwxr-xr-x 1 viktor viktor 6465512 Aug 27 14:23 libQt5Widgets.so.5
./platforms:
total 1500
-rwxr-xr-x 1 viktor viktor 167272 Aug 27 14:24 libqlinuxfb.so
-rwxr-xr-x 1 viktor viktor 30600 Aug 27 14:24 libqminimal.so
-rwxr-xr-x 1 viktor viktor 134012 Aug 27 14:24 libqoffscreen.so
-rwxr-xr-x 1 viktor viktor 1196984 Aug 27 14:24 libqxcb.so
./sqldrivers:
total 732
-rwxr-xr-x 1 viktor viktor 747196 Aug 27 14:24 libqsqlite.so
But when I try to run app I got:
error while loading shared libraries: libQt5WebKitWidgets.so.5: cannot open shared object file: No such file or directory
I am not sure, but probably you should append not only the directory names, but also the full path. Get the application directory, and append to it the sub-directory names.
QString appFilePath = QCoreApplication::applicationFilePath();
QStringList paths = QCoreApplication::libraryPaths();
paths.append(QString("%1/%2").arg(appFilePath).arg("libs"));
paths.append(QString("%1/%2").arg(appFilePath).arg("platform"));
...
Related
I am working on point of sale bootp terminals. The client application, OS etc. and all its files live under /opt/posterm/x86_64/.../
ll /opt/posterm/x86_64
total 16
lrwxrwxrwx. 1 root root 7 Jul 31 2020 bin -> usr/bin
dr-xr-xr-x. 5 root root 4096 Sep 21 2021 boot
drwxr-xr-x. 2 root root 30 Jul 21 2021 dev
drwxr-xr-x. 84 root root 8192 Nov 22 2021 etc
drwxr-xr-x. 2 root root 6 Jul 31 2020 home
lrwxrwxrwx. 1 root root 7 Jul 31 2020 lib -> usr/lib
lrwxrwxrwx. 1 root root 9 Jul 31 2020 lib64 -> usr/lib64
drwxr-xr-x. 3 root root 27 Jul 29 2021 media
drwxr-xr-x. 2 root root 6 Jul 31 2020 mnt
drwxr-xr-x. 3 root root 24 Sep 15 2021 opt
dr-xr-xr-x. 2 root root 6 Jul 31 2020 proc
dr-xr-x---. 2 root root 112 Sep 29 2021 root
drwxr-xr-x. 14 root root 178 Jul 21 2021 run
lrwxrwxrwx. 1 root root 8 Jul 31 2020 sbin -> usr/sbin
drwxr-xr-x. 2 root root 6 Jul 31 2020 srv
dr-xr-xr-x. 2 root root 6 Jul 31 2020 sys
drwxrwxrwt. 7 root root 93 Oct 1 2021 tmp
drwxr-xr-x. 12 root root 144 Jul 21 2021 usr
drwxr-xr-x. 20 root root 278 Sep 21 2021 var
I was able to create the service however im not certain its right since the is-enabled command output shows me nothing. Why?
[root#zzpoxxxx]# systemctl enable posterm.service --root=/opt/posterm/x86_64
Created symlink /opt/posterm/x86_64/etc/systemd/system/multi-user.target.wants/posterm.service → /etc/systemd/system/posterm.service.
systemctl is-enabled --root=/opt/posterm/i386 posterm.service
systemctl is-enabled posterm.service --root=/opt/posterm/i386
[root#zzxxxxx]# echo $?
1
system]# find / -name posterm.service |xargs ls -al
lrwxrwxrwx. 1 root root 35 Nov 15 13:37 /opt/posterm/x86_64/etc/systemd/system/multi-user.target.wants/posterm.service -> /etc/systemd/system/posterm.service
-rw-r--r--. 1 root root 236 Nov 15 11:43 /opt/posterm/x86_64/etc/systemd/system/posterm.service
-rw-r--r--. 1 root root 236 Nov 15 11:38 /opt/posterm/x86_64/usr/lib/systemd/system/posterm.service
any help much appreciated!?
thank you!
I am getting this error when saving QBS:
warning: Dependency 'Qt.webengine' not found for product 'anime-dl'.
Here is the profile in the settings::
This should not be happening because I built this explicitly, as well as it does not happen if I throw this in a QMake Project File:
QT += core gui multimedia webengine webenginewidgets multimediawidgets
And its included in the qt that I built:
➜ Qt-5.15.2 ll include
total 472K
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 Qt3DAnimation
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 Qt3DCore
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 Qt3DExtras
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 Qt3DInput
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 Qt3DLogic
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 Qt3DQuick
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 Qt3DQuickAnimation
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 Qt3DQuickExtras
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 Qt3DQuickInput
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 Qt3DQuickRender
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 Qt3DQuickScene2D
drwxr-xr-x 3 root root 12K Jan 22 20:16 Qt3DRender
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtAccessibilitySupport
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtBluetooth
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtBodymovin
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtCharts
drwxr-xr-x 2 root root 4.0K Jan 22 20:15 QtConcurrent
drwxr-xr-x 3 root root 20K Jan 22 20:15 QtCore
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtDataVisualization
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtDBus
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtDesigner
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtDesignerComponents
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtDeviceDiscoverySupport
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtEdidSupport
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtEglFSDeviceIntegration
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtEglSupport
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtEventDispatcherSupport
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtFbSupport
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtFontDatabaseSupport
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtGamepad
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtGlxSupport
drwxr-xr-x 3 root root 20K Jan 22 20:15 QtGui
drwxr-xr-x 3 root root 4.0K Jan 22 20:17 QtHelp
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtInputSupport
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtKmsSupport
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtLinuxAccessibilitySupport
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtLocation
drwxr-xr-x 3 root root 12K Jan 22 20:16 QtMultimedia
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtMultimediaGstTools
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtMultimediaQuick
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtMultimediaWidgets
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtNetwork
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtNetworkAuth
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtNfc
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtOpenGL
drwxr-xr-x 2 root root 4.0K Jan 22 20:15 QtOpenGLExtensions
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtPacketProtocol
drwxr-xr-x 3 root root 4.0K Jan 22 20:17 QtPdf
drwxr-xr-x 3 root root 4.0K Jan 22 20:17 QtPdfWidgets
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtPlatformCompositorSupport
drwxr-xr-x 2 root root 4.0K Jan 22 20:15 QtPlatformHeaders
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtPositioning
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtPositioningQuick
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtPrintSupport
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtPurchasing
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtQml
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtQmlDebug
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtQmlModels
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtQmlWorkerScript
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtQuick
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtQuick3D
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtQuick3DAssetImport
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtQuick3DRender
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtQuick3DRuntimeRender
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtQuick3DUtils
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtQuickControls2
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtQuickParticles
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtQuickShapes
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtQuickTemplates2
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtQuickTest
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtQuickWidgets
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtRemoteObjects
drwxr-xr-x 2 root root 4.0K Jan 22 20:16 QtRepParser
drwxr-xr-x 3 root root 4.0K Jan 22 20:17 QtScript
drwxr-xr-x 3 root root 4.0K Jan 22 20:17 QtScriptTools
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtScxml
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtSensors
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtSerialBus
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtSerialPort
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtServiceSupport
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtSql
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtSvg
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtTest
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtTextToSpeech
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtThemeSupport
drwxr-xr-x 2 root root 4.0K Jan 22 20:16 QtUiPlugin
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtUiTools
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtVirtualKeyboard
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtVulkanSupport
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtWaylandClient
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtWaylandCompositor
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtWebChannel
drwxr-xr-x 3 root root 4.0K Jan 22 20:17 QtWebEngine
drwxr-xr-x 3 root root 4.0K Jan 22 20:17 QtWebEngineCore
drwxr-xr-x 3 root root 4.0K Jan 22 20:17 QtWebEngineWidgets
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtWebSockets
drwxr-xr-x 3 root root 4.0K Jan 22 20:17 QtWebView
drwxr-xr-x 3 root root 20K Jan 22 20:15 QtWidgets
drwxr-xr-x 2 root root 4.0K Jan 22 20:15 QtX11Extras
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtXkbCommonSupport
drwxr-xr-x 3 root root 4.0K Jan 22 20:15 QtXml
drwxr-xr-x 3 root root 4.0K Jan 22 20:16 QtXmlPatterns
How can I fix this error? I am fairly certain it must be detecting the system installed version of Qt, as opposed to the one I built, and yet in profiles, it should be pointing to the one I built.
I don't exactly understand what was going on, but I did manage to settle the issue by switching from Desktop Kit to the Imported Kit, despite both of them having as far as I can tell, the same settings.
When building qtdeclarative, I get the following artifacts:
drwxr-xr-x 6 4.0K Mar 8 21:17 cmake/
-rw-r--r-- 1 2.1M Mar 8 21:19 libQt5QmlDevTools.a
-rw-r--r-- 1 706 Mar 8 21:19 libQt5QmlDevTools.la
-rw-r--r-- 1 1.1K Mar 8 21:19 libQt5QmlDevTools.prl
-rw-r--r-- 1 761 Mar 8 21:07 libQt5Qml.la
-rw-r--r-- 1 1.1K Mar 8 21:07 libQt5Qml.prl
lrwxrwxrwx 1 18 Mar 8 21:12 libQt5Qml.so -> libQt5Qml.so.5.6.3*
lrwxrwxrwx 1 18 Mar 8 21:12 libQt5Qml.so.5 -> libQt5Qml.so.5.6.3*
lrwxrwxrwx 1 18 Mar 8 21:12 libQt5Qml.so.5.6 -> libQt5Qml.so.5.6.3*
-rwxr-xr-x 1 5.1M Mar 8 21:12 libQt5Qml.so.5.6.3*
-rw-r--r-- 1 924 Mar 8 21:12 libQt5Quick.la
-rw-r--r-- 1 998 Mar 8 21:16 libQt5QuickParticles.la
-rw-r--r-- 1 1.3K Mar 8 21:16 libQt5QuickParticles.prl
lrwxrwxrwx 1 29 Mar 8 21:17 libQt5QuickParticles.so -> libQt5QuickParticles.so.5.6.3*
lrwxrwxrwx 1 29 Mar 8 21:17 libQt5QuickParticles.so.5 -> libQt5QuickParticles.so.5.6.3*
lrwxrwxrwx 1 29 Mar 8 21:17 libQt5QuickParticles.so.5.6 -> libQt5QuickParticles.so.5.6.3*
-rwxr-xr-x 1 752K Mar 8 21:17 libQt5QuickParticles.so.5.6.3*
-rw-r--r-- 1 1.3K Mar 8 21:12 libQt5Quick.prl
lrwxrwxrwx 1 20 Mar 8 21:16 libQt5Quick.so -> libQt5Quick.so.5.6.3*
lrwxrwxrwx 1 20 Mar 8 21:16 libQt5Quick.so.5 -> libQt5Quick.so.5.6.3*
lrwxrwxrwx 1 20 Mar 8 21:16 libQt5Quick.so.5.6 -> libQt5Quick.so.5.6.3*
-rwxr-xr-x 1 5.2M Mar 8 21:16 libQt5Quick.so.5.6.3*
-rw-r--r-- 1 887 Mar 8 21:16 libQt5QuickTest.la
-rw-r--r-- 1 1.3K Mar 8 21:16 libQt5QuickTest.prl
lrwxrwxrwx 1 24 Mar 8 21:16 libQt5QuickTest.so -> libQt5QuickTest.so.5.6.3*
lrwxrwxrwx 1 24 Mar 8 21:16 libQt5QuickTest.so.5 -> libQt5QuickTest.so.5.6.3*
lrwxrwxrwx 1 24 Mar 8 21:16 libQt5QuickTest.so.5.6 -> libQt5QuickTest.so.5.6.3*
-rwxr-xr-x 1 167K Mar 8 21:16 libQt5QuickTest.so.5.6.3*
-rw-r--r-- 1 997 Mar 8 21:17 libQt5QuickWidgets.la
-rw-r--r-- 1 1.3K Mar 8 21:17 libQt5QuickWidgets.prl
lrwxrwxrwx 1 27 Mar 8 21:17 libQt5QuickWidgets.so -> libQt5QuickWidgets.so.5.6.3*
lrwxrwxrwx 1 27 Mar 8 21:17 libQt5QuickWidgets.so.5 -> libQt5QuickWidgets.so.5.6.3*
lrwxrwxrwx 1 27 Mar 8 21:17 libQt5QuickWidgets.so.5.6 -> libQt5QuickWidgets.so.5.6.3*
-rwxr-xr-x 1 97K Mar 8 21:17 libQt5QuickWidgets.so.5.6.3*
drwxr-xr-x 2 4.0K Mar 8 21:17 pkgconfig/
I am however looking for libQt5Declarative.so. Is there a build flag I can set somewhere to build this artifact?
It seems there are RPMs out there that contain this file so surely there must be a way to build it: https://rpmfind.net/linux/rpm2html/search.php?query=libQt5Declarative.so.5
According to the documentation, Qt Declarative has been renamed to Qt Quick 1, since Qt 5. So, you have to link with libQtQuick.so, instead.
But, it has been removed in Qt 5.6. You should port your app.
I'm trying to install the wordpress plugging but just can't bypass this FTP credential page.
I have tried:
1, add FS_METHOD: 'direct' to wp-config.php
2, change permission on the file folder, see blow,
Still just can't have it working, please help
:/var/www/html/wordpressblog# ls -la
total 196
drwxr-xr-x 5 nobody nogroup 4096 Jan 15 08:43 .
drwxr-xr-x 3 nobody nogroup 4096 Jan 15 07:36 ..
-rw-r--r-- 1 nobody nogroup 418 Sep 25 2013 index.php
-rw-r--r-- 1 nobody nogroup 19935 Jan 3 2017 license.txt
-rw-r--r-- 1 nobody nogroup 7413 Dec 12 2016 readme.html
-rw-r--r-- 1 nobody nogroup 5434 Sep 23 20:21 wp-activate.php
drwxr-xr-x 9 nobody nogroup 4096 Nov 30 03:06 wp-admin
-rw-r--r-- 1 nobody nogroup 364 Dec 19 2015 wp-blog-header.php
-rw-r--r-- 1 nobody nogroup 1627 Aug 29 2016 wp-comments-post.php
-rw-r--r-- 1 nobody nogroup 2901 Jan 15 08:43 wp-config.php
drwxrwxrwx 4 nobody nogroup 4096 Nov 30 03:06 wp-content
-rw-r--r-- 1 nobody nogroup 3669 Aug 20 12:37 wp-cron.php
drwxr-xr-x 18 nobody nogroup 12288 Nov 30 03:06 wp-includes
-rw-r--r-- 1 nobody nogroup 2422 Nov 21 2016 wp-links-opml.php
-rw-r--r-- 1 nobody nogroup 3306 Aug 22 19:52 wp-load.php
-rw-r--r-- 1 nobody nogroup 36583 Oct 13 10:10 wp-login.php
-rw-r--r-- 1 nobody nogroup 8048 Jan 11 2017 wp-mail.php
-rw-r--r-- 1 nobody nogroup 16246 Oct 4 08:20 wp-settings.php
-rw-r--r-- 1 nobody nogroup 30071 Oct 19 01:36 wp-signup.php
-rw-r--r-- 1 nobody nogroup 4620 Oct 24 06:12 wp-trackback.php
-rw-r--r-- 1 nobody nogroup 3065 Sep 1 2016 xmlrpc.php
/var/www# ls -la
drwxr-xr-x 3 root root 4096 Jan 10 10:28 .
drwxr-xr-x 12 root root 4096 Jan 10 10:28 ..
drwxr-xr-x 3 nobody nogroup 4096 Jan 15 07:36 html
The wp-content directory needs to be owned by the same user and group than the webserver. You might need to change these settings, e.g. in the httpd.conf if you are using apache
I encountered this before when I setup my own web server using nginx. The whole /var/www/html folder and all descendants need to be owned by the same user running nginx worker to enable install plugin without ftp inside wordpress dashboard for my case. Hope it helps!
Given an ls -l list of directories which are software release versions, how to sort into human-preferable form? Eg:
$ ls -loghF
total 209
drwxr-xr-x 2 3 Jun 18 11:33 12.0.40.0/
drwxr-xr-x 2 3 Aug 24 14:45 13.0.11.10/
drwxr-xr-x 2 3 Jul 13 14:12 13.0.11.4/
drwxr-xr-x 2 3 Jul 26 15:30 13.0.11.5/
drwxr-xr-x 2 4 Jul 27 11:33 13.0.11.6/
drwxr-xr-x 2 3 Aug 3 11:41 13.0.11.7/
drwxr-xr-x 2 3 Aug 10 11:53 13.0.11.8/
drwxr-xr-x 2 3 Aug 17 17:00 13.0.11.9/
drwxr-xr-x 2 3 Aug 3 14:37 13.0.17.0/
drwxr-xr-x 2 3 Aug 13 11:50 13.0.18.0/
drwxr-xr-x 2 3 Aug 17 11:21 13.0.19.0/
drwxr-xr-x 2 3 Jul 28 15:00 13.0.9.1/
The desired result is:
$ ls -loghF | sort ...
total 209
drwxr-xr-x 2 3 Jun 18 11:33 12.0.40.0/
drwxr-xr-x 2 3 Jul 28 15:00 13.0.9.1/
drwxr-xr-x 2 3 Jul 13 14:12 13.0.11.4/
drwxr-xr-x 2 3 Jul 26 15:30 13.0.11.5/
drwxr-xr-x 2 4 Jul 27 11:33 13.0.11.6/
drwxr-xr-x 2 3 Aug 3 11:41 13.0.11.7/
drwxr-xr-x 2 3 Aug 10 11:53 13.0.11.8/
drwxr-xr-x 2 3 Aug 17 17:00 13.0.11.9/
drwxr-xr-x 2 3 Aug 24 14:45 13.0.11.10/
drwxr-xr-x 2 3 Aug 3 14:37 13.0.17.0/
drwxr-xr-x 2 3 Aug 13 11:50 13.0.18.0/
drwxr-xr-x 2 3 Aug 17 11:21 13.0.19.0/
The sort must skip past the date portion of each line, then sort numerically (eg, starting with the 12 or 13), using '.' as a field separator.
I thought of two approaches, but am having difficulty with the sort -k syntax, if it's supported at all:
(1) Skip the first 36 characters, then with '.' as field separator, sort numerically on the next 4 fields.
(2) With field separator as whitespace, skip to the 7th field, then change the field separator to '.' and sort numerically on the next 4 fields.
The alternate is a little Perl script, but can't Unix sort do this "simple" task?
Here's a command line which uses awk to put the version numbers first, sorts using four numerical keys, then uses cut to get rid of the temporary at front:
$ ls -loghF | awk '{ print $7, $0; }' | sort -n -t. -k1,1 -k2,2 -k3,3 -k4,4 | cut -d' ' -f2-
drwxr-xr-x 2 3 Jun 18 11:33 12.0.40.0/
drwxr-xr-x 2 3 Jul 28 15:00 13.0.9.1/
drwxr-xr-x 2 3 Jul 13 14:12 13.0.11.4/
drwxr-xr-x 2 3 Jul 26 15:30 13.0.11.5/
drwxr-xr-x 2 4 Jul 27 11:33 13.0.11.6/
drwxr-xr-x 2 3 Aug 3 11:41 13.0.11.7/
drwxr-xr-x 2 3 Aug 10 11:53 13.0.11.8/
drwxr-xr-x 2 3 Aug 17 17:00 13.0.11.9/
drwxr-xr-x 2 3 Aug 24 14:45 13.0.11.10/
drwxr-xr-x 2 3 Aug 3 14:37 13.0.17.0/
drwxr-xr-x 2 3 Aug 13 11:50 13.0.18.0/
drwxr-xr-x 2 3 Aug 17 11:21 13.0.19.0/
The sort command there is borrowed from this answer. Another answer suggests sort -V (version sort), but my version of sort doesn't have it (yours might, though, so it's worth trying). Version sort is likely to be specific to newer GNU coreutils (my Linux box has it, and sort is from GNU Coreutils 8.5).
With version sort:
$ ls -loghF | sort -k7,7V
drwxr-xr-x 2 3 Jun 18 11:33 12.0.40.0/
drwxr-xr-x 2 3 Jul 28 15:00 13.0.9.1/
drwxr-xr-x 2 3 Jul 13 14:12 13.0.11.4/
drwxr-xr-x 2 3 Jul 26 15:30 13.0.11.5/
drwxr-xr-x 2 4 Jul 27 11:33 13.0.11.6/
drwxr-xr-x 2 3 Aug 3 11:41 13.0.11.7/
drwxr-xr-x 2 3 Aug 10 11:53 13.0.11.8/
drwxr-xr-x 2 3 Aug 17 17:00 13.0.11.9/
drwxr-xr-x 2 3 Aug 24 14:45 13.0.11.10/
drwxr-xr-x 2 3 Aug 3 14:37 13.0.17.0/
drwxr-xr-x 2 3 Aug 13 11:50 13.0.18.0/
drwxr-xr-x 2 3 Aug 17 11:21 13.0.19.0/
This isn't the fastest way to do it, but it is fairly simple to explain:
ls -loghF |
awk '{ print $7 " " $0 }' |
sort -t. -k 1,1n -k 2,2n -k3,3n -k 4,4n |
sed 's/^[^ ]* //'
The 'awk' command copies the directory field to the front of the line; the sort command only uses a single delimiter (.; I don't think you can use different delimiters for different parts of a line) and then sorts the 4 numeric parts explicitly in numeric order. Then the sed removes the field that was added at the front.
This is a simple version of 'make it easy for sort to find the keys', because splitting the input is one of the expensive operations in sort.
FYI: Here's what I ended up doing.
Special thanks to: http://www.sysarch.com/Perl/sort_paper.html
$ ls -loghF | perl -e '
use strict;
my #in = <>;
my #out = grep(m|\d+\.\d+\.\d+\.\d+/$|, #in);
print sort {
my #aa = $a =~
m|(\d+)\.(\d+)\.(\d+)\.(\d+)/$|;
my #bb = $b =~
m|(\d+)\.(\d+)\.(\d+)\.(\d+)/$|;
$aa[0] <=> $bb[0] or
$aa[1] <=> $bb[1] or
$aa[2] <=> $bb[2] or
$aa[3] <=> $bb[3]
} #out;
'
drwxr-xr-x 2 3 Jun 18 11:33 12.0.40.0/
drwxr-xr-x 2 3 Jul 28 15:00 13.0.9.1/
drwxr-xr-x 2 3 Jul 13 14:12 13.0.11.4/
drwxr-xr-x 2 3 Jul 26 15:30 13.0.11.5/
drwxr-xr-x 2 4 Jul 27 11:33 13.0.11.6/
drwxr-xr-x 2 3 Aug 3 11:41 13.0.11.7/
drwxr-xr-x 2 3 Aug 10 11:53 13.0.11.8/
drwxr-xr-x 2 3 Aug 17 17:00 13.0.11.9/
drwxr-xr-x 2 3 Aug 24 14:45 13.0.11.10/
drwxr-xr-x 2 3 Aug 29 17:31 13.0.11.11/
drwxr-xr-x 2 3 Aug 3 14:37 13.0.17.0/
drwxr-xr-x 2 3 Aug 13 11:50 13.0.18.0/
drwxr-xr-x 2 3 Aug 17 11:21 13.0.19.0/