unix_commands printable version

vim

  • :set ingorecase (ou :set ic)
    :set noignorecase
  • gg go to beginning of the file
    :$ go to the end of the file
  • :setnu

Divers

  • $fdisk -l /dev/sda1
  • $top: puis taper “1” permet de voir la conso par core et non seulement par CPU
  • $xrdb -merge ~/.Xdefaults ou ~/.Xresources pour prendre en compte les modifications
  • $yeahconsole ou $tilda
  • $xbindkeys
  • $dd if=sc0 of=./image.iso
  • $mkisofs -o ./image.iso /tmp pour créer une iso du répertoire /tmp
  • $kompare
  • $alltray
  • $pybliographic
  • $kimagemapeditor
  • $imageinfo
  • $tcprobe fait partie de transcode, permet d'afficher des infos sur un media (j'ai utilisé ça pour tester le wall de vlc)
  • $ssconvert fait partie de gnumeric
  • $etherape display network activity (need to be root)
  • $libimage-exif-tool retrieve metadata of multimedia files
  • $exiftool
  • $ffmpeg -i file some informations about the video file
  • $writer2latex
  • $writer2bibtex
  • $writer2xhtml
  • $calc2xhtml
  • $cp -avRp ./src ./dest copy with overwrite the source to the destination (by default do not overwrite) (ajouter -i pour demander si overwrite).
  • $labyrinth
  • même chose sans pdftk
    #pdf2ps orig.pdf orig.ps
    #psselect -p3-5 orig.ps frag.ps
    #ps2pdf frag.ps frag.pdf
  • encore la même chose avec pdftops
    #pdftops -f first_page_number -l last_page_number fichier.pdf fichier.ps
    #ps2pdf fichier.pdf fichier.ps
  • $rsync -av --del --stats /home/nicolas /media/archimede/trantor-backup/
  • $rdfproc
  • $find . -print | sed -e 's;[^/]*/;|;g;s;|; |;g'
  • pour lister les packages installés:
    $dpkg --get-selections
  • $find . -iname *.xml | wc
  • pour setter le mode SELinux au plus permissif (très utile sous FedoraCore par exemple)
    $setenforce 0
  • $grub-install --root-directory=/media/disk-1 /dev/sda
  • pour faire du SSH tunneling:
    $ssh -L 7779:talk.google.com:5222 «sshserveraddress» -l «sshserverloginname»
    Then tell the jabber client to connect to localhost on port 7779
  • Pour obtenir la version de l'OS:
    #cat /etc/lsb-release
    #cat /etc/issue
  • Restarter nautilus
    #nautilus -q

GNOME

  • $gconf-editor
    • <mod4><hyper> pour la touche windows pour les keyboard shortcut
    • /apps/metacity/global_keybindings
    • /apps/metacity/keybinding_commands
  • configuration panel for NFS: $shares-admin

System

Renommer un FS:

  • #e2label ne peut fonctionner que sur un fs ext2/ext3, donc pas sur une USB key en fat32
  • #mlabel -i /dev/sdX ::newName pour un disque FAT32 (11 char max, insensible à la casse, afficher en majuscule sous Nautilus dans GNOME2.16.1).

Autres FS voir http://doc.ubuntu-fr.org/tutoriel/comment_renommer_un_disque

NFS

  • $shares-admin sous ubuntu
  • $arp -a pour connaitre les ip des machines sur le réseau local
  • dans /etc/fstab
    192.168.0.101:/home/nicolas /media/nfs-aurora-nicolas nfs user,auto 0 0
  • si NFS stale file handle
    $umount -t nfs -a

Keyboard & shortuts

Faire des raccourcis clavier: xbindkeys et xvkbd, voir http://doc.ubuntu-fr.org/souris_logitech_vx_revolution

Faire une tabulation sur un prompt: ctrl+v tab (sinon le tab classique active l'auto-complétion)

Beautifier / Formatter

  • $xmlindent -o outputfile < inputfile
  • $tidy -o outputfile -i inputfile

Bluetooth & Mobile phone

  • $hcitool scan

wifi

  • $iwlist wlan0 scan

VLC

  • $vlc -I ncurses rtsp://mafreebox.freebox.fr/freeboxtv/stream?id=201 --sout='#transcode{vcodec=h264, acodec=mp3, ab=32,channels=1, audio-sync}:std{access=file, mux=mp4, url="output_video.mp4"}'
    
  • $vlc rtsp://mafreebox.freebox.fr/freeboxtv/stream?id=201 --sout file/ogg:flux0.ogg
    
  • $vlc -I ncurses rtsp://mafreebox.freebox.fr/freeboxtv/stream?id=201 --sout='#transcode{vcodec=mp4v,vb=1024,deinterlace}:std{access=file,mux=avi,dst=flux.avi}'
    
  • screencast VLC:
    $vlc screen:// --screen-fps 60 --nooverlay --sout "#transcode{vcodec=h264,vb=2048,acodec=mp3,ab=128,channels=2}:duplicate{dst=std{access=file,mux=mp4,dst="toto.avi"}}"
    

MySQL

  • $mysql -u username -p
  • $create user username@localhost;
    $drop user username@localhost;
    $update user set password=password('mypassword') where user='username';
  • $create database dbname;
    $show database;
  • $grant all on dbname.* to 'username'@'localhost';
    $revoke all privileges on dbname.* from username@localhost;
    $flush privileges;
  • $select user from mysql.user;
    $describe tablename;
    $alter table tablename rename as new_tablename;
  • exporter une db:
    $mysqldump -u root -p dbname > dbname-backup.sql
  • importer une db:
    $mysql -u root -p dbname < dbname-backup.sql
  • $show variables like 'character_set%'
    $show variables like 'char%';

désactiver X au démarrage

  • update-rc.d -f gdm remove
  • update-rc.d -f gdm defaults

disable scrollkeep

sudo mv /usr/bin/scrollkeeper-update /usr/bin/scrollkeeper-update.real
sudo ln -s /bin/true /usr/bin/scrollkeeper-update
sudo find /var/lib/scrollkeeper/ -name \*.xml -type f -exec rm -f '{}' \;
sudo dpkg-divert --local --divert /usr/bin/scrollkeeper-update.real --add /usr/bin/scrollkeeper-update

from https://help.ubuntu.com/community/AA1/Using

 
unix_commands.txt · Last modified: 2010/11/09 15:41 by njames

 © Nicolas James 2009-2011

 Valid XHTML 1.0 Transitional Valid CSS! DokuWiki