LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-31-2021, 12:28 PM   #1
Colombia
Member
 
Registered: Oct 2021
Posts: 72

Rep: Reputation: Disabled
how to order command output? (httpd -M)


hello,

this show not ordered output:
Code:
[root@cia ~]# httpd -M
Loaded Modules:
 core_module (static)
 so_module (static)
 http_module (static)
 mpm_prefork_module (shared)
 systemd_module (shared)
 cgi_module (shared)
 access_compat_module (shared)
 actions_module (shared)
 alias_module (shared)
 auth_basic_module (shared)
 authn_core_module (shared)
 authn_file_module (shared)
 authz_core_module (shared)
 authz_groupfile_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 deflate_module (shared)
 dir_module (shared)
 expires_module (shared)
 filter_module (shared)
 headers_module (shared)
 include_module (shared)
 log_config_module (shared)
 logio_module (shared)
 mime_module (shared)
 negotiation_module (shared)
 proxy_module (shared)
 proxy_ajp_module (shared)
 proxy_fcgi_module (shared)
 proxy_http_module (shared)
 proxy_wstunnel_module (shared)
 rewrite_module (shared)
 setenvif_module (shared)
 slotmem_shm_module (shared)
 socache_dbm_module (shared)
 socache_shmcb_module (shared)
 socache_redis_module (shared)
 status_module (shared)
 unique_id_module (shared)
 unixd_module (shared)
 userdir_module (shared)
 bwlimited_module (shared)
 ssl_module (shared)
 security2_module (shared)
 ruid2_module (shared)
[root@cia ~]#
how I can order the list ?

I try with
Code:
sort -o httpd -M
sort httpd -M
httpd -M --sort
but fail


thanks
 
Old 12-31-2021, 12:47 PM   #2
Colombia
Member
 
Registered: Oct 2021
Posts: 72

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Colombia View Post
how I can order the list ?

I try with
Code:
sort -o httpd -M
sort httpd -M
httpd -M --sort
but fail
and how get the NUMBER total of modules?

Last edited by Colombia; 12-31-2021 at 12:48 PM.
 
Old 12-31-2021, 12:56 PM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,792

Rep: Reputation: 7305Reputation: 7305Reputation: 7305Reputation: 7305Reputation: 7305Reputation: 7305Reputation: 7305Reputation: 7305Reputation: 7305Reputation: 7305Reputation: 7305
Code:
httpd -M | sort
httpd -M | wc
 
1 members found this post helpful.
Old 01-01-2022, 12:10 AM   #4
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,294
Blog Entries: 3

Rep: Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719
Or even this:

Code:
httpd -M | sort | cat -n

httpd -M | sort | cat -n | column
And so on.

Going from left to right, the stdout of one program becomes the stdin of the next. The pipeline can be made arbitrarily long by connecting more utilities with pipes.

Edit: I notice an off-by-one error in the above approaches, since the title line is not itself a module name:

Code:
httpd -M | grep -v Loaded | sort -k2,2r -k1,1 | cat -n
See the manual pages for grep, sort, and cat.

Last edited by Turbocapitalist; 01-01-2022 at 12:21 AM. Reason: off-by-one
 
1 members found this post helpful.
Old 01-01-2022, 07:54 AM   #5
Colombia
Member
 
Registered: Oct 2021
Posts: 72

Original Poster
Rep: Reputation: Disabled
many thanks by the helps


:-)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Failed at step EXEC spawning /usr/local/apache2/bin/apachectl: Permission denied while starting httpd using command "systemctl start httpd" linuxtale Linux - Server 4 06-29-2019 09:39 PM
[SOLVED] Can I set the cups output order to always print in reverse order Thane Ubuntu 3 07-09-2018 09:49 PM
Logi Sales Manager on Ncurses (invoice, invoicing, orders, order, sale order, sales order...)? Xeratul Linux - Software 0 03-25-2017 02:45 PM
httpd: Syntax error on line 210 of /etc/httpd/conf/httpd.conf: Syntax error on line 6 iswarya Linux - Newbie 1 01-25-2012 01:28 PM
Starting httpd: httpd: Syntax error on line 209 of /etc/httpd/conf/httpd.conf: Syntax sethukpathi Linux - Networking 6 04-12-2008 11:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration