Skip to content

Expanding asterisk in glob

I want to be able to print a list of all file in a directory in linux but my code only print out the first item in the directory inside home directory is text1.txt, text2.txt, text3.txt sys.argv[1] should be /home/* when I run it on command line: Script: the output is only the first file in the directory any …

Logstash not producing output

I have just installed logstash 1.5.3 on a Linux machine. Details: When I try to run the basic “hello world” setup I get nothing on stdout. Any ideas why? I installed this on my Windows machine and am able to run it there. Output to file is also not working: The file “logtest1” is not e…

Compare time-stamp of a remote file with a local file using Ant

I have an installer file on my remote machine with Installer-000.zip name and i want to copy that file into my local machine(linux-CentOS) under /media/Data/Installer/ directory using ant ftp task. I am able to copy the installer from remote server to my machine if the installer is not already present in my m…

Repack tar.gz to tar and exclude some files

I have a big backup.tar.gz file (260 GB) and about 160 GB of free storage space. Backup file contains three big dumb file (old backups, about 190 GB), which is not needed. So I want to untar backup.tar.gz to pipe excluding some files and tar it back without gzip. I have a text file, which contain names of dum…

How to reuse a function defined in another bash file?

I have a utility function that I used a lot (assertReturnStatus()). I’d like to define it in a utility file (utility.sh) and reuse it in other bash scripts. How can reuse the function from another bash script file? Thanks. Answer You need to “import” the first file in the second. Be warned t…