Linux and UNIX bash shell aliases

shell
Hi

Commonly used for a long strings that are frequently used. Alias allows you to have a small more familiar command or name to execute a long string.

Set an alias
Syntax
alias [name[='command']

nameSpecifies the alias name.
commandSpecifies the command the name should be an alias for.
-aRemoves all alias definitions from the current shell execution environment.
-tSets and lists tracked aliases.
-xSets or prints exported aliases. An exported alias is defined for scripts invoked by name.
-pPrints the list of aliases.

Examples
alias command with no arguments or with the -p option prints the list of aliases:

$ alias
alias ff='firefox'
alias l='ls -CF'
alias la='ls -A'
alias ll='ls -l'
alias ls='ls --color=auto'
alias sx='startx'

Sets clr to type clear

$ alias clr='clear'

Remove an alias
Syntax
unalias [name]

nameSpecifies the alias name.
-aRemoves all alias definitions

Clear all Linux / UNIX bash shell aliases

$ unalias -a

Note
When the computer is rebooted all alias will be lost.

How to prevent it?
All alias must be added to .bashrc file located at your user folder (example: /home/saeid/.bashrc)

Example

$ gedit /home/saeid/.bashrc

paste:

alias clr='clear'

now you have to ‘compile’ your .bashrc file

$ source .bashrc

Now clr alias it’s saved.

Good luck

How to install gOS on Ubuntu Gutsy Gibbon

ubuntu-logo-small.png
Hi

I installed gOS on Ubuntu Gutsy Gibbon.
It’s nice but I prefer Gnome windows desktop environment.

gos_screenshot.jpg

If you want to install gOS , from terminal do the following (ONE LINE AT A TIME HITTING ENTER AFTER EACH STEP):

  • Adding gOS repositories
    echo "deb http://packages.thinkgos.com/gos/ painful main"\
     | sudo tee -a /etc/apt/sources.list
    
    echo "deb-src http://packages.thinkgos.com/gos/ painful main"\
     | sudo tee -a /etc/apt/sources.list
    

  • In the terminal enter the command to import the public key of the repository so that the signatures could be verified as follows :
    wget -q http://www.thinkgos.com/files/gos_repo_key.asc -O-\
     | sudo apt-key add -
    
  • Next update your apt cache database using the command :
    sudo apt-get update
    
  • To install the necessary files which will allow you to run gOS on Ubuntu, run the following apt-get command :
    sudo apt-get install greenos-desktop
    
  • If you do not have enlightenment (e17) window manager (WM), then apt-get will have to download and install that too which could hike your download size by around 35 MB.
    • Once installed, you can select gOS/Enlightenment from sessions option in your login screen.

      Good Luck

Root Terminal in Ubuntu

terminal_icon_48_48.jpg
Hi
Ubuntu has the root account disabled.
You use sudo to run commands as root. if you need root access for some work:

  • To start a root shell, but keep the current shell’s environment, use:
    sudo -s
  • To start a root shell (i.e. a command window where you can run root commands), starting root’s environment and login scripts, use:
    sudo -i

There is also a root terminal that is in the Applications menu. You have to right-click to edit the menu’s and add a check to the root terminal in System Tools items.

Don’t forget to type ‘exit’ (or press Ctrl+D) to switch back to your normal user when you are done.

More information about sudo in Ubuntu wiki

Download a website to a local location

linux
Hi
Linux users:
for download a website to a local location in Linux, you can use wget command with a some parameter.
It’s very simple:

wget URL -k -c -r -p

How to Change GNOME default media player

gnome
Hi

For changing GNOME default media player, please follow steps:
1. Press Alt+F2, then enter gconf-editor to run:

gconf-editor

2. Go to /desktop/gnome/applications/media/

3. Change value of exec key to your media player name. like Exaile:

gconf-editor-media-player-exec

Good bye