Program

Not so used

Files (Read, get specific info)


#! /bin/bash

# move the mouse  x    y
xdotool mousemove 1800 500

# left click
xdotool click 1

# right click
xdotool click 3

Jobs and Processes

jobs -l
disown %2
kill -l # to see the trap list
exec vi # replace the shell by vim => destroy the shell) tty # to get my tty (of course)
stty -a # show shell shortcut for SIGNALS
echo $$; echo $BASHPID # Get my (shell) pid $$ -> Expands to the process ID of the (current) shell.
$! -> Expands to the process ID of the most recently executed background command.
$PROMPT_COMMAND To automate cmds
disown -h %<jobid> # After that, you can safely exit the terminal

/proc/{PID}/cwd is as symlink the pwd of the current process

" Send commadn to oter terminal (shell)  
A: mkfifo mypipe  
A: eval $(cat mypipe)  
B: echo "ls" > mypipe  
vi Mem/vim; eval $(cat /tmp/ttypipe21)  

Ps

ps ax | grep pts/16
ps -f ax | grep pts/16
ps --ppid $$ -o CMD

Change default

/usr/share/gnome/applications/defaults.list
touch ~/.local/share/applications/defaults.list
touch ~/.local/share/applications/mimeapps.list
mimetype img.jpg

// Get current font
gsettings get org.gnome.desktop.interface monospace-font-name

gconftool-2 –get /apps/gnome-terminal/profiles/Unnamed/font
gconftool-2 –set /apps/gnome-terminal/profiles/Unnamed/font –type string “courier new 12”

Mouse

sudo modprobe -r psmouse
sudo modprobe psmouse proto=imps

Par (format text with indent and hard-wrap)

    w - specify line length
    r - repeat characters in bodiless lines (empty line "" -> "    "
    j - justifies text (add extra spaces to end at same point)
    e - remove ‘superflous’ lines
    q - handle nested quotations in plaintext email
    f - fit: good argumnent for all lines to be good len (even th first; 
      protected one