Skip to content
Advertisement

Tag: command

No man page for the cd command

Ubuntu Linux 15.10 – I just noticed that there is no man page for cd This seems a bit strange. I tried: at the cmd line and I get back I was trying to find documentation on which is super-handy for flipping between the last dir and the current dir and cd — which seems to be an alias for

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

Option -l of exec shell command

Could you please clarify on the use of -l option of exec shell command. I didn’t notice any difference when I ran exec ls | cat and exec -l ls | cat. Answer The -l option of exec adds a – at the beginning of the name of your command. For example: Note the – everywhere before diff. The point

what is “.filename” in the linux and how to open that file? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question

Why count differs between ls and ls -l linux command?

I had a directory with number of files and need to check the count of files present in it. I tried the following two commands: and found there are differences while using both commands. (ie. number of files is greater in the usage of second command while comparing to the first command.) I would like to know the changes happening

How do I read the whole command line?

Command $ ls -l | ./main.out The output will show My question is, how do I make my program to read the command before that, ls -l Answer Command line parameters are passed as arguments when calling the program. And your program will read the entire command line arguments. But What you are doing ($ ls -l | ./main.out) is

Running shell script using .env file

I am fairly new to running scripts in UNIX/Linux. I have a .env file containing environment information and a .sh script containing folder creations etc for that environment. How would I run the script on the environment contained in the .env file or how could I point the script to the target environment? Would it be as easy as: Answer

Remove folder structure (parents only) using ZIP command in PHP

I want to create a zip of all files in X folder with the name filename.zip using following command in php like: exec(zip -r “./Zips/filename.zip” “./Uploads/Data/X/”) but the created zip has the folder structure Uploads/Data/X. Please help me to get rid of these parent folders – Uploads/Data. Answer Ignoring folder structure when creating zip archive (Linux): By default, zip will

Linux command How to delete all with .html extension

i am using putty, want to delete all files which having .html extension I am trying the below ways 1st get the file by using find command Listing all files having .html extension now i am going to delete those files OR both are not working for me, anybody know solution Thanks Answer make sure you’re deleting the right files

How to kill a process by its pid in linux

I’m new in linux and I’m building a program that receives the name of a process, gets its PID (i have no problem with that part) and then pass the PID to the kill command but its not working. It goes something like this: Can someone tell me why it isn’t killing it ? I know that there are some

Advertisement