Posts: 54
jbander
Joined: 17 Jun 2017
#1
I would guess there's a terminal command for it but I can't find it
Posts: 148
figosdev
Joined: 29 Jun 2017
#2
find $(echo $PATH | tr":""") -type f -perm /u=x # find all executable files in path

-type f prevents both symlinks and directories from being listed.

changing $(echo $PATH | tr":""") to simply / will list all files, not just those in the path, and will take longer. you may have wanted something else, this is probably how i would find command line apps on my machine. it cant tell which ones actually have a gui.
Posts: 54
jbander
Joined: 17 Jun 2017
#3
Thanks but like you said , the list is long and I just don't know which are command line apps. Getting closer though, One more question if I may, I'm building my own system and I'm concerned about the size . Is there a command that will tell me how big the partition is and how much of that is taken up by my build. I've used df -h --total and Sudo du -sh. The problem is I doubt the accuracy of these because adding files and subtracting filed, With purge . the two command line commands Don't go up when I pulll a app and vice versa. The numbers just don't seem to be following each other or what I'm changing in the distro, any help will be appreciated
Posts: 604
thriftee
Joined: 27 Feb 2009
#4
Try mc, its a command line app worth having.

install ncdu, it will help you find and delete the big unneeded files

look for posts by skidoo with regards to removing excess files

Here is a screenshot of mc with an info pane on the right. its a great command line program
Posts: 148
figosdev
Joined: 29 Jun 2017
#5
df and du -sh probably arent lying to you-- whatever youre doing to"pull an app" is probably ineffective if they dont change as you would expect.

if you run ldd /usr/bin/leafpad | grep gtk you can tell that it requires gtk to run.

i can make you a program for antix that uses information (manually) harvested from all the apps in /usr/share/applications to determine that an application is PROBABLY not a gui app, by referencing ldd against a list of expected gui libraries.

however, unless you really need a tool to weed out gui apps it isnt worth the trouble. if thats very useful to you, it would probably also be a good idea to search plaintext scripts (perl, python, bash) for known gui dialogs such as yad.

im happy to work on that, but only if its almost certainly going to get used. it would be in the form of a python script. any version of antix ive tried included python, so thats fine. note that ldd, which determines what libraries a binary uses, isnt perfect-- its probably"good enough" for this. but sometimes *it* lies.
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#6
At a terminal prompt, if you type
env
and press Enter, you're presented with a list of"environment variables".
One of those is"PATH". It shows the pathways which the terminal shell interpreter will search, looking for an executable (a"command line app") matching a command name you've typed.

PATH=.:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin

If you type"shoe", or"banana" (or whatever existing or non-existent command name)
without supplying a /full/path/to/shoe
the interpreter first checks whether you've supplied the name of an inbuilt command.
If not, it searches for a matching-named executable in the current working directory,
then checks for existence of a matching-named executable /usr/local/bin/
and if no matches, continues searching the contents of /usr/bin/, then /bin/ then...
in the example of"shoe", the interpreter ultimately responds with
"bash: shoe: command not found"

If you type"help" (no quotes) and press Enter, you can see a list of the inbuilt bash shell commands.
To read a description of each inbuilt command, you can type"help bg" or"help disown" (or whatever commandname).


Let's take a look at the contents of the /bin directory:
cd /bin && ls
To do so, we invoke the inbuilt"cd" command and supply a destination, then invoke a command named"ls"

Where is the"ls" executable?
It must reside in one of the directories known by our shell's PATH environment variable, eh?
whereis ls
^---v
ls: /bin/ls /usr/share/man/man1/ls.1.gz

Hmm, so this"ls" command has a manpage? Yep.
man ls

Hey, I don't remember"installing" this ls thing. How did it wind up in my filesystem?
dpkg-query -S /bin/ls
^---v
coreutils: /bin/ls

antiX operating system is based on the"Debian GNU/Linux distribution".
Distribution ~= distributed together: GNU utilities (utility executables) + Linux kernel.
Please take a few moments to read about coreutils
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://packages.debian.org/jessie/coreutils"
linktext was:"https://packages.debian.org/jessie/coreutils"
====================================

and notice the"list of files" (pre)installed via the coreutils package
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://packages.debian.org/jessie/amd64/coreutils/filelist"
linktext was:"https://packages.debian.org/jessie/amd6 ... s/filelist"
====================================


This same"list of files" information is (already) available to you locally.
Launch synaptic, type"coreutils" into searchbox.
Right-click the coreutils listing, click Properties }} InstalledFiles.
Also, note the displayed"!" exclamation point symbol (indicates coreutils is an"essential" package)

Thousands of"command line apps" (as you described 'em) are preinstalled in antiX.
Also, manpage docs are installed for most of 'em. Check it out:
"man man"
"man intro"
"man -k
"apropos"

I've created a"apropos: lookup list" reference for you, by scraping commandname+description
from the /usr/share/man files on my system. I uploaded it to pastebin.com:

========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://pastebin.com/51CnKSG6"
linktext was:"https://pastebin.com/51CnKSG6"
====================================

don't know which are command line apps
Yep. Can't know just by looking at a name, and
file my-notetaker.py
doesn't reveal whether or not my"app" provides a gui
Posts: 64
reverseDog
Joined: 13 Jul 2016
#7
There is a list of included cli apps in the antix FAQ (file:///usr/share/antiX/FAQ/index.html):
Why not try out our included cli apps:
  • Editors: nano and vim
    Newsreader: newsbeuter
    Chat: irssi
    Audio player: mocp
    Video player: mpv
    Audio ripper: abcde
    Torrent: rtorrent
    Cd burner: cdw
    Writer: Wordgrinder
mc (file manager) and links2 (web browser) are missing.
Last edited by reverseDog on 17 Aug 2017, 08:11, edited 1 time in total.
Posts: 850
fatmac
Joined: 26 Jul 2012
#8
Not sure if this is what you want, but,

Code: Select all

ls -C /bin /sbin /usr/bin /usr/sbin /usr/local/bin
will show you all the standard commandline programs, &

Code: Select all

apt-cache pkgnames
will show all installed packages.
Posts: 64
reverseDog
Joined: 13 Jul 2016
#9
fatmac wrote:

Code: Select all

apt-cache pkgnames
will show all installed packages.
This shows all packages known to APT, which is much more than just the installed ones.

To get the installed packages use

Code: Select all

apt list --installed
or

Code: Select all

dpkg --get-selections
Posts: 54
jbander
Joined: 17 Jun 2017
#10
figosdev wait on that and I'm really grateful for your support, it's a great offer but I'll see what I can do with the advice I'm getting from everyone. Thanks figosdev. I will take you up on your offer if need be.
Posts: 54
jbander
Joined: 17 Jun 2017
#11
figosdev, reverse dog, fatmac, skidoo, thriftee, Wow, ask and you shall receive, This support is much appreciated, thank you very much. This may take a while but I'm still enjoying it.
Posts: 148
figosdev
Joined: 29 Jun 2017
#12
well, i downloaded the 32bit version of antix 16.2, and i installed aptitude and used it to remove the following CATEGORIES of software from antix:

gnome
graphics
xfce
x11
video

when you remove those, it removes other stuff that requires it-- by the time it was done removing things, even gtk was uninstalled. so whats left is pretty much command line stuff...


transfer a list of packages to the net:

dpkg -l | grep ii | cat -n | curl -F 'sprunge=<-'
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://sprunge.us"
linktext was:"http://sprunge.us"
====================================



and now you have your list of command line packages:
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://sprunge.us/HUJM"
linktext was:"http://sprunge.us/HUJM"
====================================


but lets get a list of command line programs that are in your path:

find $(echo $PATH | tr":""") -type f | cat -n | curl -F 'sprunge=<-'
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://sprunge.us"
linktext was:"http://sprunge.us"
====================================



im sorry, i didnt add the code to only find executable files, but it only returned 1349 files:

(this is pretty accurate. when i tried it again with -perm /u=x i got 1348, so i stuck to the original url.)


========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://sprunge.us/KcMP"
linktext was:"http://sprunge.us/KcMP"
====================================



and then all executable files: find / -type f | -perm /u=x | cat -n > files.txt ; cat files.txt | curl -F 'sprunge=<-'
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://sprunge.us"
linktext was:"http://sprunge.us"
====================================


11203 files:
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://sprunge.us/dMOV"
linktext was:"http://sprunge.us/dMOV"
====================================
note that anything that starts with /live you can ignore.


so with that, there are 4605 executable files on antix 16.2 (including aptitude, which isnt an official part of antix) that are probably command line programs, listed here:
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://sprunge.us/dMOV"
linktext was:"http://sprunge.us/dMOV"
====================================


and if you just want the ones in your path, that gets you down to 1348 files:
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://sprunge.us/KcMP"
linktext was:"http://sprunge.us/KcMP"
====================================


this was easier than writing that program; i just ran antix in qemu so i had a fresh copy of the live cd/dvd running. if you try that, you can uninstall X while it is running... it still works, but have every graphical program you want to use open (like the term, and leafpad) because after you remove the graphical stuff, you wont be able to open new instances of those programs until you reinstall them.
Posts: 604
thriftee
Joined: 27 Feb 2009
#13
Great idea and post, fgiosdev!
figosdev
Posts: 148
figosdev
Joined: 29 Jun 2017
#14
thanks very much. im very fond of enumerating and categorizing files (i should work in a library...) and particularly when it comes to managing the size of distros.

if people on this forum suddenly all became obsessed with this topic it would be fine by me-- either way, im glad there are topics on it.
Posts: 54
jbander
Joined: 17 Jun 2017
#15
fatmac wrote:Not sure if this is what you want, but,

Code: Select all

ls -C /bin /sbin /usr/bin /usr/sbin /usr/local/bin
will show you all the standard commandline programs, &

Code: Select all

apt-cache pkgnames
will show all installed packages.
Thanks for the insight, is there a color code on the different colors on the command line programs list.