I’m looking for a command-line program that will print out the text of a PDF file, just like cat for a text file. I’ve found pdftotxt, and that would be workable, but I’d prefer something that replicates the cat functionality because I want to pipe to grep. Thanks! Answer On the man pages for pdftotext, I found this: pdftotext [options]
Tag: command-line
Running PHP script from command line as background process
I’m trying to run a PHP script continually in the background via the command line in Linux. I have tried the command php filename.php & but it seems like the script execution terminates very quickly, while it should keep running until the process is terminated. Any suggestions? Answer Are you sure the script doesn’t contain any errors? This is what
Combining two files in different folders in Linux
I have two set of folders that have files with the same filenames and structure. The folder structure is something like this: So what I need to do is to combine (append) all the files with the same name in these folders (file1.txt with file1.txt etc.) into another file inside the outputfolder. After getting these combined files I also need
extracting unique values between 2 sets/files
Working in linux/shell env, how can I accomplish the following: text file 1 contains: text file 2 contains: I need to extract the entries in file 2 which are not in file 1. So ‘6’ and ‘7’ in this example. How do I do this from the command line? many thanks! Answer Explanation of how the code works: If we’re
Rename JPG files according to date created
I want to rename all files in a certain directory. Renaming them to their date of creation. So if my file is Image1.jpg, it should rename into something like “Jan 16 12:09:42 2011.jpg” I want to do this through command line. I’ve been trying: But how can I combine this with mv command? And how will I iterate stat and
MySQL the command line and pagers
I cant find anything about this from searching here. I use mysql on the command line at work and I work with fairly large tables so I set the mysql pager allowing a more readable result if I run a query, that returns 1000’s of results. I use the command below to set the pager. This suits my needs but
linux batch rename directories and strip # character from name
i have a directory with a lot of subdirectories with a # infront of them: I want to rename them all and remove the # caracter I tried to do: but didn’t seem to work. Any ideas on this. Thanks Answer Just use use -n just to check that what you think it would happen really happens. In you example
getting a program to return immediately at the command line so it’s not tied to the shell that launched it
Some programs return immediately when launched from the command line, Firefox for example. Most utilities (and all the programs I’ve written) are tied to the shell that created them. If you control-c the command line, the program’s dead. What do you have to add to a program or a shell script to get the return-immediately behavior? I guess I’m asking
How to get the last key pressed without stopping the C program?
Writing an application with command line interface and I would like to know at any time if F1 or ESC or an arrow key is pressed. What is the simplest way of doing this? I would like to avoid using a readline type library. This is a Linux specific question; the program is not multithreaded. Answer An implementation of kbhit()
A command to download a file other than Wget [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