Skip to content
Advertisement

Tag: command-line

get all aliases in linux shell

How to list all aliases defined in a shell. Like the command below to list all files/folders in a directory I have defined some alias in ~/.bashrc i want to list all that command Answer Are you wondering if you have a UNIX alias already set for a specific command? You can find it easily by issuing this on the

Shell param doesn’t pass with command

I use the following code to execute shell command, the issue is that when I put it as parameter which I should get from user it doesn’t work but If I put it hard-coded it works. Working Not working In the not working version which I do cat to param I see the value printed OK, what could I miss

How to get Linux command location in C?

I am using execv in C, but it demands to get the path of the command to get it executed, For example: To execute ls I must have char* command = “/bin/ls”; To execute gedit I must have char* command = “/usr/bin/gedit”; My question is how to get the string “/bin” or “/usr/bin” in C ? Answer You can get

Advertisement