@ wrote... (10 years, 10 months ago)

Some useful Linux commands.

  • seq: creates a sequence of numbers
  • gnuplot: delimeter is 'set datafile separator “char”|whitespace'
  • fmt -0: newline at whitespace. echo $text|fmt -o > out.txt'
  • update-pciids: update db for lspci
  • xev: capture keycodes
  • jhead: lossless rotation of photos. jhead -autorot *.JPG. see: http://imagemagick.org/Usage/formats/#jpg_non-im for more info
  • kpartx: creates partition devices based on a lvm drive
  • dracut -H: remake your initramfs with your hosts bootable modules

To loop through files that have spaces in the name, try the following example from http://ramblings.narrabilis.com/wp/looping-through-files-with-spaces-in-the-names-in-bash

find . -maxdepth 1 -type f|egrep '(jpg|JPG)$' | while read file; do
    /do/something/to "$file"
done

or

export IFS=$'\n'
for file in *.avi; do
    mp4ize $file; # convert to ipod format
done

at: run a command at a specified time

  • at 2:00 pm tomorrow -f
  • at.cmd: mail -s “subject” to@email.com < ~/msg.txt
Category: tech, Tags: linux, shell
Comments: 0
Click here to add a comment