LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-11-2018, 11:53 AM   #1
hmrtqmc27gfs
LQ Newbie
 
Registered: Dec 2018
Posts: 1

Rep: Reputation: Disabled
show command execution in shell


Hi,
I'm new at linux and need help to turn on information about show command execution in shell eg.

Now when I'm writing command:

root@kali:~# service apache2 start
root@kali:~#

// shell do not give me specific information. What can I do to after this kind of command shell show me specific information about how command is running eg.

root@kali:~# service apache2 start
[...] Starting web server: apache2apache2: using 127.0.1.1 for servername
. ok
root@kali:~#

// What can I do to turn on this kind of communicates?

"
[...] Starting web server: apache2apache2: using 127.0.1.1 for servername
. ok
"
 
Old 12-11-2018, 12:04 PM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,692

Rep: Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274
https://www.linuxquestions.org/quest...ad-4175614092/
Is this your homework?
I do not really understand what do you need. If you want to check apache you need to check its log file.
 
Old 12-11-2018, 12:12 PM   #3
notKlaatu
Senior Member
 
Registered: Sep 2010
Location: Lawrence, New Zealand
Distribution: Slackware
Posts: 1,077

Rep: Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732
I haven't used the 'service' command in ages, but there's often a --verbose (-v) flag for commands to show more information about what it's doing. Otherwise, there's the 'status' option:

Code:
# service apache2 status
Also:

I notice that you're logged in as root. It's generally not recommended to hang out as the root user (you can make dumb mistakes as root, and there'll be nothing standing in your way to stop it from happening). That said, 'root' might be the default for Kali, so maybe you have no choice. I have nothing against kali, but to *really* learn Linux, you might want to look at a "real" Linux distribution that you install and use on a daily basis, so you get used to the conventions. Heck, even Porteus, which you can run off of a USB thumbdrive, is something to look at, as long as you actually boot to it.

Either way, welcome and have fun!
 
Old 12-11-2018, 12:30 PM   #4
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,708

Rep: Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210
Follow
Code:
root@kali:~# service apache2 start
with
Code:
root@kali:~# service apache2 status
Maybe?

Oh notKlaatu said that...

Last edited by scasey; 12-11-2018 at 12:31 PM.
 
Old 12-11-2018, 12:41 PM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,553

Rep: Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946
Quote:
Originally Posted by hmrtqmc27gfs View Post
Hi,
I'm new at linux and need help to turn on information about show command execution in shell eg. Now when I'm writing command:
Code:
root@kali:~# service apache2 start
root@kali:~#
shell do not give me specific information. What can I do to after this kind of command shell show me specific information about how command is running eg.
Code:
root@kali:~# service apache2 start
[...] Starting web server: apache2apache2: using 127.0.1.1 for servername
. ok
root@kali:~#
What can I do to turn on this kind of communicates?
Code:
[...] Starting web server: apache2apache2: using 127.0.1.1 for servername
Two things stand out:
  • You need to learn what commands produce what output. Starting a service means that any information/errors go to that services log files or the system journal, NOT to the screen. Doing an ls or grep puts output to the screen (STDOUT). Different commands=different results
  • Your prompt of "root@kali".
Kali is for **ADVANCED** Linux users, and even then to be used for security/pentesting purposes, not to run a webserver. Their own website tells you this...stop where you are and load a version of Linux that's more suitable for new users.
 
1 members found this post helpful.
Old 12-11-2018, 12:50 PM   #6
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
if it is a script, you can just edit it to echo out whever information you need that the script gains within the script, and you can add special messages, like.

Code:
$program start
[message is]
program is starting...

Last edited by BW-userx; 12-11-2018 at 12:52 PM.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Remote command execution via SSH and newgrp command SuperMegaMau Linux - General 4 05-13-2011 07:31 AM
are they same " sh execution " and " ./ execution " shravee Linux - Newbie 1 04-17-2010 01:11 AM
Only execute 2nd command on successufl execution of 1st command kregec05 Linux - Newbie 3 08-19-2009 10:29 AM
crond shell execution problems lm317t Linux - General 1 02-22-2005 09:46 AM
Speeding up Shell Script execution?? funkymunky Programming 8 07-16-2004 08:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:07 AM.

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