LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices


Old

Convert and resize images using imagemagick

Posted 05-30-2011 at 10:07 PM by sag47
Updated 05-31-2011 at 01:23 AM by sag47

This past memorial day weekend I took a bunch of pictures which I wanted to post to the web. Web photos are best viewed in 800x600px and I had a lot of them. So I used a simple command to do it.
Code:
for x in `ls -1`;do convert -resize 800x600 $x `echo $x | sed 's/.JPG/.png/'`;done
mkdir web_album
for x in `ls -1 *.png`;do convert $x web_album/`echo $x | sed 's/.png/.jpg/'`;done
rm *.png
Now I don't have to spend all my time in Gimp with that simple batch command.
Senior Member
Posted in Uncategorized
Views 4530 Comments 1 sag47 is offline
Old

awk variables

Posted 05-30-2011 at 01:42 PM by karthik3152

awk variables
In awk there are many default variables which can be used .
We will see each of them with examples:
acer@ubuntu:~$ cat > record1
John robinson
koren inc
phno:555555555


usha
yyy technologies
ph no:546456456


dddd
aaa technologies
ph no:44444444


acer@ubuntu:~$

consider the above record in which our requirement is to produce a single line...
LQ Newbie
Posted in Uncategorized
Views 452 Comments 0 karthik3152 is offline
Old

awk variables

Posted 05-30-2011 at 01:40 PM by karthik3152

awk variables
In awk there are many default variables which can be used .
We will see each of them with examples:
acer@ubuntu:~$ cat > record1
John robinson
koren inc
phno:555555555


usha
yyy technologies
ph no:546456456


dddd
aaa technologies
ph no:44444444


acer@ubuntu:~$

consider the above record in which our requirement is to produce a single line...
LQ Newbie
Posted in Uncategorized
Views 287 Comments 0 karthik3152 is offline
Old

listing available disks and partitions

Posted 05-30-2011 at 07:30 AM by neonsignal

The format disk utility fdisk is a quick way of showing available disks and partitions (including those that are not mounted).
Code:
fdisk -l
Further information about the mounted file systems is provided by df, including used space, available space and the mount points.
Code:
df
Senior Member
Posted in Uncategorized
Views 277 Comments 0 neonsignal is offline
Old

recursively setting permissions

Posted 05-30-2011 at 07:26 AM by neonsignal

The chmod itself can be used recursively to set the permissions on a directory and the subtree of that directory:
Code:
chmod -R u=rwX,go=rX directory
the 'X' flag only sets execute permissions if the node is a directory or already has execute access.

Alternatively, find can be used to give a little more control over the changes. For example, sometimes it is useful to clear all the execute bits after data files have been transferred from a FAT32 system....
Senior Member
Posted in Uncategorized
Views 248 Comments 0 neonsignal is offline

  



All times are GMT -5. The time now is 10:29 PM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration