LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   how to see what is a command going to do? (https://www.linuxquestions.org/questions/linux-general-1/how-to-see-what-is-a-command-going-to-do-4175498453/)

turalo 03-17-2014 04:39 AM

how to see what is a command going to do?
 
Hi guys, long time no see :)


I have a maybe a very strange question, about a command, an unknown command ( googled it and found nothing)

so there is a command in my centos (last) whne I execute it it says please press enter to continue. Problem is I dont know what that command does, this is an voip / asterisk based server. It's partially installed byt a partner company. So the question is, is there a way to see what this command will do without really executing it ?
when i try to find it's location by - whereis it shows me a bash with it.

looks like this :

[root@localhost ~]# pcrack

Press enter to continue


^C

[root@localhost ~]# whereis pcrack
pcrack:





Please help / advise.

I want to know what this command does without executing it completely.
because this is a production server, so I cannot risk it.

thanks in advance.

kirukan 03-17-2014 04:57 AM

In first place, if you scare to continue and it won't impact your production service just Ctrl+C and terminate the command from the shell first.
Don't know there is a command call "pcrack" in Centos, if have just check the command have manpage for it.

OR
you can trace this command process using "strace"

Sandcrawler 03-18-2014 08:08 AM

Hey,

No command in CentOS I know of pcrack.
Also just tried to run this on one of my Asterisk boxes - no command found.

Sounds like something custom written. As kirukan says strace or try to use locate/find rather than whereis if its a script have a look inside it see what it does.

Habitual 03-18-2014 08:27 AM

Ask the partner company?

pan64 03-18-2014 08:32 AM

probably I would try a chroot-ed environment. also try ldd pcrack to check what libs it wants to use. You may also try file pcrack to identify its type.


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