Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Convert all text in a file from upper-case to lower-case

Answer:

Just one command needed:

# tr '[:upper:]' '[:lower:]' < input.txt

Removed opened port in ufw

Answer:

If you have opened a port using the ufw command in Ubuntu, but now you want to delete it, you can..

# sudo ufw delete allow 8080/tcp

And then do a reload

# # sudo ufw reload

That's all.

Combine multiple images into a single image with ImageMagick

Answer:

With the powerful ImageMagick program, we can easily handle common graphics tasks using command only.

For example, to combine multiple images into a single image, we need just one command:

# convert file1.jpg file2.jpg file3.jpg +append -quality 90 'output.jpg'

The above command (file1.jpg file2.jpg file3.jpg) into the file output.jpg with quality set to 90.

Remove all queued message in Postfix

Answer:

To remove queued message in your Postfix server, you should always check the queue listing first.

When you have confirmed, then you can do

1. Remove specific message based on Queue ID (You can find the ID via postqueue command)

# sudo postsuper -d Queue_ID

2. Remove all messages

# sudo postsuper -d ALL

Post a file to a server using the Curl command

Answer:

You can simulate a HTTP form post, with a file being uploaded to a remote server using the curl command.

curl -F 'photo=@/upload/image.jpg' http://example.com/upload.php

Assume the name of the form element of your upload is called "photo"