Skip to content

Tag: linux

How to remove only the last word from a file

I created the following Perl one-liner in order to remove a word from a file This Perl also escapes special characters such as @ or $ or *, so every word that contains a special character will removed from the file. How to change the Perl syntax in order to delete only the last matched word from a file and

How do I find imagemagick temp folder in linux?

I am new to Imagemagick and linux. How do I find temp folder of in linux. I am using Imagemagick with liferay. Answer The easiest way, is to look for any environment variables that you have set, e.g.: MAGICK_TEMPORARY_PATH MAGICK_TMPDIR by running: Else, if you haven’t set any environment variable, do s…

linux sed reads whole file when only editing first line

I am currently working with CSV files that can be 10’s of GB in size, and need to edit the headers dynamically depending on the use case. For this I am using: which has the desired effect of only editing the headers, but can take upwards of 10 seconds to complete. I imagine this is because the whole fil…

Glassfish is not working on ReadHat Server

I am trying to install Glassfish 4.0 on a Linux Red Hat Entreprise Linux release 5.11 (Tikanga) Server. Therefore, I successfully installed Java jdk1.7.0_79 and NetBeans 4.0 on this server following this website instructions: https://blog.idrsolutions.com/2014/02/tutorial-setting-up-glassfish-on-a-linux-serve…

Gnu sort: stray characters in field specification

sort doesn’t seem to like my key specification. Why? From the man page: -k, –key=KEYDEF : sort via a key; KEYDEF gives location and type KEYDEF is F[.C][OPTS][,F[.C][OPTS]] for start and stop position, where F is a field number and C a character position in the field; both are origin 1, and the st…

Handling Dates in FTP

Here is my ftp script The output of this script is: I googled and seen some posts regarding dates but all provided formats not worked for me. Please advise Thanks in anticipation Answer through to FTP, which can include executing commands, substituting variables, and the like. That is to say, instead of writi…