Skip to content

Instantly share code, notes, and snippets.

@codegoalie
Created January 13, 2010 19:25
Show Gist options
  • Save codegoalie/276506 to your computer and use it in GitHub Desktop.
Save codegoalie/276506 to your computer and use it in GitHub Desktop.
Handy Linux Commands
# Rotate the screen for e-reading
xrandr -o left
xrandr -o normal
# Batch modify 2880x900 .png's down to 1440x900 and then resize 50% with imagemagick
mogrify -crop 1440x900+1440 -resize 50% *.png
#To seach and replace in multiple files:
grep -rl OLDSTRING . | xargs sed -i "s/OLDSTRING/NEWSTRING/g"
#(Can also use other char for delimiter in regex: i.e. "s:OLDSTRING:NEWSTRING:g")
# lftp command line FTP
lftp -u username,password site_address
mput -d path/to/file/same/on/remote/as/local
#move files out of subdirectories (like Photos/2010/1/17/)
find <root of your subdirectories> -type f -exec mv {} <target directory> \;
#display random hex values in a infinite scrolling fashion:
# found here: http://unix.stackexchange.com/questions/21347
export GREP_COLOR='1;32'; cat /dev/urandom | hexdump -C | grep --color=auto "ca fe"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment