Results 1 to 6 of 6

Thread: Ubuntu recover undelete .bashrc file

  1. #1
    Senior Member eawedat's Avatar
    Join Date
    May 2008
    Location
    Palestine
    Posts
    320
    Thanks
    4
    Thanked 3 Times in 3 Posts
    Rep Power
    7

    Lightbulb Ubuntu recover undelete .bashrc file

    hey all
    when i
    ls -a .b*

    i get
    .bash_history .bash_logout .bashrc

    but when :
    pico .bashrc

    its an empty file..

    how can i recover it ?

    thanks.
    Be to be and not to pee

  2. #2
    Never say die nixcraft's Avatar
    Join Date
    Jan 2005
    Location
    BIOS
    Posts
    4,512
    Thanks
    17
    Thanked 799 Times in 511 Posts
    Rep Power
    10

    Default

    May be file is empty. Can you see anything with the following command:
    Code:
    cat .bashrc
    All [Solved] threads are closed by mods / admin to avoid spam issues. See Howto mark a thread as [Solved]


  3. #3
    Senior Member eawedat's Avatar
    Join Date
    May 2008
    Location
    Palestine
    Posts
    320
    Thanks
    4
    Thanked 3 Times in 3 Posts
    Rep Power
    7

    Cool

    i did :
    cat .bashrc

    its empty

    i used to see things inside there,,
    i added some commands inside the file
    and somehow it got empty ..
    so i wanna recover it..

    thanks.
    Be to be and not to pee

  4. #4
    Never say die nixcraft's Avatar
    Join Date
    Jan 2005
    Location
    BIOS
    Posts
    4,512
    Thanks
    17
    Thanked 799 Times in 511 Posts
    Rep Power
    10

    Default

    Use Photorec app
    PhotoRec - CGSecurity
    All [Solved] threads are closed by mods / admin to avoid spam issues. See Howto mark a thread as [Solved]


  5. #5
    Junior Member
    Join Date
    Jun 2009
    Posts
    22
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default chattr

    Dude, you can look at another systems .bashrc and copy it.
    Then make whatever changes you want.

    Then try:

    $chattr +i .bashrc

    To make the file undeleteable.

    OR

    $chattr +a .bashrc

    Check the man pages on that command to know the difference between the commands.

    Quote Originally Posted by eawedat View Post
    i did :
    cat .bashrc

    its empty

    i used to see things inside there,,
    i added some commands inside the file
    and somehow it got empty ..
    so i wanna recover it..

    thanks.

  6. #6
    Senior Member
    Join Date
    Jun 2007
    Location
    Hyderabad, AP, India
    Posts
    806
    Thanks
    44
    Thanked 55 Times in 48 Posts
    Rep Power
    13

    Default

    Though is answer is not up to the requirement just give a thought to this..

    Are you sure recently it got removed?
    if its recently removed(data) then you can use recovery tool suggested by Nix.. if long time back its content are deleted then chances are less..
    i don't think it is having important data, as the above person suggested change the permissions after coping this file from /etc/skel
    ..
    Thanks,
    Surendra Kumar Anne
    Linux: Fast, friendly, flexible and .... free!
    Support Open source.
    http://www.linuxnix.com

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. FreeBSD: Undelete A Directory?
    By Black Dahlia Murder in forum All about FreeBSD/OpenBSD/NetBSD
    Replies: 3
    Last Post: 2nd March 2010, 10:51 PM
  2. [Solved] .bashrc file coding question
    By jaysunn in forum Coding in General
    Replies: 4
    Last Post: 28th September 2009, 08:39 PM
  3. .bashrc, doubts about bash scripting.
    By KaLPo in forum Shell scripting
    Replies: 5
    Last Post: 14th March 2009, 01:39 AM
  4. 'bashrc 'User Profile
    By caron_k2000 in forum Linux software
    Replies: 2
    Last Post: 23rd July 2008, 02:52 PM
  5. How do I recover a bzip2 file?
    By jerry in forum Linux software
    Replies: 1
    Last Post: 14th June 2006, 04:27 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •