Linux For Your Life

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Monday, 27 July 2009

Create a file delete command that uses the trash

Posted on 23:26 by Unknown
       As we know, the rm command doesn’t have a trash facility. Once files are deleted, they’re gone forever. However, you can create your own trash command which, when used at the prompt, will move files and/or folders to Ubuntu’s standard trash folder. The files can then be recovered, if desired, or permanently deleted in the usual way by emptying the Trash folder.

To add the new command, you’ll have to create an alias. you’ll need to edit the .bashrc file in your /home folder and add a line to the bottom, as follows:
1. Open a terminal window and type gedit  ~/.bashrc.
2. At the bottom of the file, add the following new line:
alias trash="mv -t ~/.local/share/Trash/files --backup=t" 

    Save the file, close Gedit, and open a new terminal window to test your new command. To delete filename.doc, for example, you would type trash filename.doc. The new command will work on folders too, and multiple files/folders can be specified one after the other (for example, trash filename1.doc filename2.doc).



Thank'u
By:Mr.Gm
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in Terminal | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Changing OpenOffice Splash Screen Images
    when we run openoffice will come openoffice splash screen image that was used we see, we may feel bored with the splash screen and want to r...
  • Subject-verb agreement
             Subject-verb agreement is a grammatical rule that states that the verb must agree in number with its subject.  In English,  prese...
  • Copy Seluruh Isi Website Dengan WebHTTrack
    S aat menyulusuri suatu website yang terdapat di internet,misalnya situs berisikan lyric lagu atau situs berisikan cerita komik,terkad...
  • Mengembalikan GRUB bootloader yang hilang pada Ubuntu Linux
        Tutorial ini akan menjelaskan bagaimana mengembalikan grub setelah menginstal Windows 7/Vista/Xp. Jika anda menggunakan dual boot PC de...
  • Make Repository local in Ubuntu and Debian
          The first step we doing when we will make the local Repository is download the complete package Repository. To download the complet...
  • Malin Kundang Story From Padang Indonesia
    Long time ago, in a small village near the beach in West Sumatera, lived a woman and her son, Malin Kundang. Malin Kundang's father ha...
  • Switch to Kubuntu, Xubuntu, or Edubuntu
            To switch to Kubuntu, Xubuntu, or Edubuntu , use Synaptic to search for and install kubuntu-desktop , xubuntu-desktop , or edubuntu...
  • Tangkuban Perahu Part 1
                  Once upon a time in west Java, Indonesia lived a wise king who had a beautiful daughter.   Her name was Dayang Sumbi.  She lik...
  • Grand Thief Auto V
        Grand Thief Auto atau yang sering ita dengar dengan GTA akan muncul dengan seri terbarunya yaitu Grand thief Auto V seri terbaru ini aka...
  • Tugas FPGA (Seven Segment Display)
        Seven segment adalah alat tampilan elektronik yang bisa menampilkan penomoran decimal. Seven segment biasanya diidentifikasi dalam indus...

Categories

  • Applications
  • cairo-dock
  • convert Rpm to Deb
  • Desktop
  • Distro
  • Download Manager
  • Fix Crash GUI
  • Format USB
  • game
  • hardware
  • Install Linux
  • internet and Web
  • Linux Intro
  • LiveUSB
  • Local Repository
  • nautilus
  • Optimize Linux system
  • Programming Language
  • Robot
  • Server
  • so
  • Terminal
  • Tips and Trick OpenOffice
  • Tugas Manajemen Proyek dan Risiko
  • Tugas SoftSkill
  • wifi

Blog Archive

  • ►  2012 (5)
    • ►  June (2)
    • ►  May (1)
    • ►  April (1)
    • ►  March (1)
  • ►  2011 (29)
    • ►  December (10)
    • ►  November (2)
    • ►  October (2)
    • ►  May (11)
    • ►  March (2)
    • ►  February (2)
  • ►  2010 (74)
    • ►  December (13)
    • ►  October (4)
    • ►  June (12)
    • ►  May (10)
    • ►  April (6)
    • ►  March (8)
    • ►  February (18)
    • ►  January (3)
  • ▼  2009 (42)
    • ►  October (6)
    • ►  September (13)
    • ►  August (13)
    • ▼  July (10)
      • Make the GNOME Terminal window translucent and us...
      • Create a file delete command that uses the trash
      • Give a boot menu a wallpaper
      • Give Nautilus windows their own wallpaper
      • install linux mint 7 (Gloria)
      • install OpenSuse 11.1
      • install debian 5.0 lenny
      • install cairo-dock for linux
      • Install Ubuntu 9.04 jaunty jackalope (Graphic Edit...
      • Install Ubuntu 9.04 (Jaunty Jackalope)
Powered by Blogger.

About Me

Unknown
View my complete profile