Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

GNOME 3: Fewer Interruptions

Reduzir imagens em linux com ImageMagick

find . -iname *.jpg | xargs -l -i convert -resize 75% -quality 70 {} ./small/{}

Linux - Rename


RENAME(1)   Linux Programmer’s Manual   RENAME(1)

NAME
rename - Rename files

SYNOPSIS
rename from to file...

DESCRIPTION
rename will rename the specified files by replacing the first occurrence of from in their name by to.

For example, given the files foo1, ..., foo9, foo10, ..., foo278, the commands

rename foo foo0 foo?
rename foo foo0 foo??

will turn them into foo001, ..., foo009, foo010, ..., foo278.

And
rename .htm .html *.htm

will fix the extension of your html files.

SEE ALSO
mmv(1), mv(1)

VI/VIM "case insensitive"

Por defeito as pesquisas nos editores VI/VIM são "case sensitive". Para tornar as pesquisas "case insensitive" basta executar o seguinte comando em modo NAV:
:set ignorecase
Este comando pode ser abreviado para :set ic. Para voltar atrás, use o seguinte comando:
:set noignorecase

Linux - Encontrar texto dentro de ficheiros

Estou constantemente à procura deste comando para encontrar texto dentro dos ficheiros de uma directoria e respectivas sub-directorias. Na linha de comandos executar:

find . -type f -exec grep -i "frase" {} \; -print

Este comando pesquisa a "frase" a partir do directório actual, em todos os seus ficheiros em modo case insensitive.