LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   show command execution in shell (https://www.linuxquestions.org/questions/linux-general-1/show-command-execution-in-shell-4175644089/)

hmrtqmc27gfs 12-11-2018 11:53 AM

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
"

pan64 12-11-2018 12:04 PM

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.

notKlaatu 12-11-2018 12:12 PM

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!

scasey 12-11-2018 12:30 PM

Follow
Code:

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

root@kali:~# service apache2 status
Maybe?

Oh notKlaatu said that...;)

TB0ne 12-11-2018 12:41 PM

Quote:

Originally Posted by hmrtqmc27gfs (Post 5935940)
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.

BW-userx 12-11-2018 12:50 PM

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...



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