Sapiens Search

How to check GMail by terminal?

1 Type:
curl -u <Your gmail username> --silent "https://mail.google.com/mail/feed/atom" | perl -ne 'print "\t" if //; print "$2\n" if /<(title|name)>(.*)<\/\1>/;'
2 Enter the password
3 See your unread messages

How to create a symbolic link (symlink)?

ln -s <Path to the file> <Path to the target>

Example

ln -s /media/data/script.sh /home/garou/scripts/


Arcam Sapientia

We can use sudo in the beginning of the command if we don't have write privilege in the target.

We can specify a new name to link too, like:
sudo ln -s /media/data/script.sh /usr/bin/macro.sh

How to prompt for a password when running a command or script?

kdesudo "<Full command>"

Example

1 - Open the run command with Alt+F2
2 - To reboot (needs root), for example, type:
kdesudo "shutdown -r now"
3- Type your root password and hit Return
4 - Your system will reboot after this

 Arcam Sapientia

You can use this on scripts to prompt for a pass when it is needed.

#!/bin/sh
clementine
kdesudo "shutdown -r 00:00"

This will open the clementine music player and reboot at 00:00 time.

How to put something on clipboard?

1 Install xclip
sudo apt-get install xclip
2 Type:
echo "<Your text here>" | xclip

Example

echo "Sapiens Garou is a good blog." | xclip

Test on a text editor pressing Control+v to see working

Arcam Sapientia

See the manual to other usefull options:
man xclip
 P.S.: Learn how to put a text on the clipboard by using a command line (terminal) on Linux/Unix.

How to change the brightness (backlight) on Linux by terminal?

xbacklight -set <value>

Example

xbacklight -set 20.0

 Arcam Sapientia

See the man for more options
 man xbacklight

How to change the constrast by terminal on Linux?

xgamma -gamma <value>

Example

xgamma -gamma 0.6

Arcam Sapientia

Gamma values must be between  0.100 and 10.000
See the man too
$man xgamma