dp

linux cheats

summarized important shell commands

Debian

pdfs

  • merge pdf files: pdftk *.pdf cat output output.pdf
  • extract pages from pdf: pdftk A=inputfile.pdf cat A2-6 output outputfile-p2-p6.pdf
  • source and further useful commands: pdflabs.com

archives

tar cfv a.tar dir -> tar xfv a.tar
tar cfvz a.tar.gz dir -> tar xfvz a.tar.gz
tar cfvj a.tar.bz2 dir -> tar xfvj a.tar.bz2

dealing w/ images

  • resizing images: convert tmp.jpg -resize 50% tmp.png
  • mogrify -resize 1600 *.jpg
  • source and further useful commands: imagemagick.org

nautilus

  • image converter within nautilus:

    apt-get install nautilus-image-converter
    killall nautilus
  • restore nautilus location bar

    gconf-editor
    apps-nautilus-preferences - always_use_location_entry
  • nautilus-elementary

batch-renaming tools (img)

OS information

uname -a
cat /etc/*release or cat /etc/*version

cleanup ubuntu
sudo apt-get clean|autoremove

folders

mkdir -p ./with/subfolders
chmod 777 * -R
rm -rf dir/
du -sh /home/user
df -h
pwd

images

  • convert bin/cue to iso
    bchunk IMAGE.bin IMAGE.cue IMAGE.iso
  • mount an iso-image
    mount -o loop disk.iso /media/iso
  • mount a windows share
    sudo mount -t smbfs //ipaddress/folder /mnt/point

multimedia

  • merge avi files mencoder -ovc copy -oac copy video1.avi video2.avi -o completevideo.avi [src]
  • convert flac to mp3 for file in *.flac; do flac -cd "$file" | lame -h - "${file%.flac}.mp3"; done
  • create m3u playlist ls -w 1 *.mp3 > zzz.m3u n then add #EXTM3U to the top of the file
  • extracting images out of a video ffmpeg -i P1010247.MOV -r 1 -f image2 ./p247/image%03d.png
  • remove audio from video ffmpeg -i in.avi -an -vcodec copy out.avi
  • converting amr to mp3
    • sudo apt-get install faac faad gstreamer0.10-ffmpeg gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse libmp3lame0 non-free-codecs libavcodec-extra-52 gstreamer0.10-pitfdll
    • ffmpeg -i yourfile.amr -ab 128k yourfile.mp3
    • credit goes to the src
  • remove video from audio
    1. determine audio codec ffmpeg -i in.avi
    2. execute ffmpeg -i in.avi -acodec copy out.mp3

secure

scp user@server:/src/dir /local/destination/dir

services

kill -9 id
ps aux | grep service

some useful commands


rm filename
fm -rf directoryname
mv src dest
chown username folder/filename
# make a file executable
chmod +x filename
apt-get install/remove/autoremove
# adding an user to samba
sudo smbpasswd user
# removing files/folders recursively; works with hidden folders too (be sure to change to the directory you want to start, otherwise your complete home-folder will be searched AND, if anything found you looked for, deleted)
find -name "\foldername" -exec rm -rf {} \;

gnome and nautilus shortcuts

  • ubuntu-tutorials.com
  • restore linux mint panels
    gconftool-2 --shutdown
    gconftool --recursive-unset /apps/panel
    rm -rf ~/.gconf/apps/panel # if still present
    pkill gnome-panel

browser add-ons

debian and mysql

graphic card information

  • inxi -Gx

networking

  • /etc/init.d/networking start|stop|restart

RedHat, CentOS

networking

  • service network start|stop|restart
  • /etc/init.d/network start|stop|restart

yum

  • download rpms:
    # yum -y install yum-utils.noarch
    # yumdownloader httpd
  • repositories can be found in /etc/yum.repos.d/

Warning: count(): Parameter must be an array or an object that implements Countable in /homepages/7/d395059870/htdocs/dp/wp-includes/class-wp-comment-query.php on line 405

Comments are closed.