We have moved to a new Sailfish OS Forum. Please start new discussions there.
0

tree command?

asked 2019-10-11 13:45:46 +0200

chappi gravatar image

Didn't succeed when trying devel-su pkcon install tree (as a maybe naive translation from 'apt install tree').

Is there a way to install tree on my Jolla? Thanks.

edit retag flag offensive close delete

Comments

There does not seem to be such a package - you can search for packages with pkcon search NAME.

dyraig ( 2019-10-11 14:06:48 +0200 )edit
5

There is a similar approach you can use, it will list the contents of the current directory as a tree style format.

So if you just wanted to see the 'tree' of /home/nemo then you would type:

ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/'

Or move to a particular directory, say root, then you would need to 'devel-su'; (the same command as above but with devel-su added)

devel-su ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/'

If you wanted to 'print' your tree to a file for later viewing, add > my-tree.text to the end of the file, like this;

ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/' > my-tree.text

When the text file is viewed, It should look like the following, which is part of my '/home/nemo' directory;

   |-CallRecordings
   |-Desktop
   |-Documents
   |-Music
   |---Alanis Morissette - JLP Acoustic
   |---Frou Frou - Details
   |---playlists
   |-Pictures
   |---Camera
   |---Jolla
   |---Screenshots
   |---screenshots
   |-Playlists
   |-RPMS
   |-Videos
   |---Camera
   |---Jolla
   |-android_storage
   |---Alarms
   |---Android
   |-----data
   |-com.android.gallery3d
Spam Hunter ( 2019-10-11 14:28:14 +0200 )edit

thank you @szopin. Downloaded and [root@Sailfish nemo]# pkcon install-local tree-1.7.0-10.9.1.jolla_.armv7hl.rpm did work great.

chappi ( 2019-10-11 15:34:08 +0200 )edit

I went the openrepos route, but thank you for the interesting code (quite some grep/sed magic in there!)

chappi ( 2019-10-11 15:37:12 +0200 )edit
1

@szopin you should convert your comment to an answer, seeing as your response comes much closer to what the OP asked for.

Converting my answer to a comment . . . .

Spam Hunter ( 2019-10-11 17:20:50 +0200 )edit

1 Answer

Sort by » oldest newest most voted
4

answered 2019-10-11 15:02:43 +0200

szopin gravatar image

It's available from openrepos: https://openrepos.net/content/shellkr/tree

edit flag offensive delete publish link more
Login/Signup to Answer

Question tools

Follow
2 followers

Stats

Asked: 2019-10-11 13:45:46 +0200

Seen: 500 times

Last updated: Oct 11 '19