Howto: Terminal tips and tricks

July 20, 2006 at 4:55 pm | Posted in tips and tricks, xubuntu | 5 Comments

Xubuntu requires the terminal more than Ubuntu…so let’s have fun with it!

1) Move to Trash: Currently, Xubuntu doesn’t have an option to move files to the trash. You can, however, recreate it in the terminal:

First, create a file named /usr/bin/del:

sudo mousepad /usr/bin/del

Copy and paste the following into the file:

#!/bin/bash
mv -vi -- "$@" $HOME/.Trash

Save, exit, and make the file executable. Run sudo chmod -v 755 /usr/bin/del.

Now, to move a file to the trash, just run del filename and it will be moved to the .Trash folder. If you’re used to DOS, using del will be easy for you.

2) Aliases: If you want to save some typing time, then aliases are for you. (Example: Rather than constantly typing sudo apt-get install, you can just type apt.)

To make an alias, edit the file ~/.bashrc, by running mousepad ~/.bashrc. The method is as follows:

alias aliasname='command'

aliasname being the name of the alias, and command being the command run when you type the alias. Example:

alias apt='sudo apt-get install'

Here are all of my aliases:

alias free='free -m'
alias kill='pkill'
alias apt='sudo apt-get install'
alias remove='sudo apt-get remove'
alias search='apt-cache search'
alias edit='mousepad'
alias suedit='sudo mousepad'
alias i='sudo dpkg -i'
alias upgrade='sudo apt-get upgrade'
alias dist-upgrade='sudo apt-get dist-upgrade'
alias update='sudo apt-get update'
alias clean='sudo apt-get autoclean'
alias build-dep='sudo apt-get build-dep'
alias df='df -Hl'
alias home='cd ~'
alias mktar='tar -cvf'
alias mkbz2='tar -cvjf'
alias mkgz='tar -cvzf'
alias untar='tar -xvf'
alias unbz2='tar -xvjf'
alias ungz='tar -xvzf'
alias ls='ls --color=auto'
alias mv='mv -i'
alias cp='cp -i'
alias rm='rm -i'
alias del='rm -r'
alias sources.list='sudo leafpad /etc/apt/sources.list'
alias menu='edit .config/xfce4/desktop/menu.xml'
alias xorg.conf='sudo leafpad /etc/X11/xorg.conf'

Just copy and paste these into your .bashrc file, and log in and out. Using the terminal is now a lot faster!

5 Comments »

RSS feed for comments on this post. TrackBack URI

  1. Hey, welcome aboard🙂 Just happened by your blog. It is very well done. We need more folks blogging about U/X/Kubuntu

  2. Configuring a Trash Bin for Xubuntu…

    If you have read the \”Xubuntu Desktop Guide\” you know that \”Xubuntu does not currently feature a trash bin. Deleted files can not be restored\”. And after a quick scan to the changelog for xfce4.4 beta2 I think that we have to wait a little …

  3. Well, your idea is great, but as i tried it, it lacked the ability to restore items moved to trash can. When I open my trah can, items look like “0-filename” and when I try to restore them, Xubuntu complains about not knowing where to restore. So I have provided a “hack” in my version to fix this issue. Whole file looks like this (note that i have my trash can in $HOME/.local/share/Trash/ and it contains two subdirectories: files (for files) and info (for deletion info)):

    #!/bin/bash
    mv -vi “$@” $HOME/.local/share/Trash/files/$@
    echo -e “[Trash Info]\nPath=`pwd`/$@\nDeletionDate=`date +%Y-%m-%d%a%H:%M:%S`” > $HOME/.local/share/Trash/info/$@.trashinfo

    The date format is not what it should be, but I couldn’t figure out how to provide single letter for week name. Anyway, it seems to work for me:>.

  4. Ðåãèñòðàöèÿ â Áåëûõ Êàòàëîãàõ 8931 êàòàëîã – 30$
    Ïî âñåì âîïðîñàì ñòó÷àòü â ICQ 374551957

    Registratsija v Belyh Katalogah 8931 katalog – 30$ ICQ 374551957

  5. Woah! I’m really digging the template/theme of this site.
    It’s simple, yet effective. A lot of times it’s very hard to get that “perfect balance” between superb usability
    and appearance. I must say that you’ve done a great job
    with this. In addition, the blog loads extremely quick for me on Firefox.
    Excellent Blog!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.
Entries and comments feeds.

%d bloggers like this: