2x export path in bashrc = user home dir lost?

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
nuesse
Level 1
Level 1
Posts: 2
Joined: Mon Nov 06, 2017 2:32 pm

2x export path in bashrc = user home dir lost?

Postby nuesse » Tue Nov 07, 2017 4:47 pm

Good evening dear Mint community!
I had the great idea of ​​exporting the path twice in my bashrc instead of working with the colon.
Since I had the Nemo open, I could literally watch how this action sent all program mappings and data from my user account to Nirvana.

My question should now be less surprising: Do I have any chance to restore at least the data (videos, downloads, etc.)?

With stubborn and little hopeful Greetings from GER^ :]


PS: With the headline I hope to have done a favor (keyword: Google indexing) to other fools like me -- I couldnt find anything helpful in this^^ regard.

User avatar
xenopeek
Level 24
Level 24
Posts: 21380
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: 2x export path in bashrc = user home dir lost?

Postby xenopeek » Tue Nov 07, 2017 5:31 pm

nuesse wrote:exporting the path twice in my bashrc instead of working with the colon

Can you show what line you added to your .bashrc file? I don't quite understand what you meant you did. Setting the PATH variable multiple times doesn't affect where your files are. Just edit your .bashrc file and undo the change (just remove all lines having to do with setting the PATH variable and let the system default setting apply). If you can no longer login to your account, login to another (administrator) account and make the change from there or boot from the Linux Mint installation DVD/USB and edit the file on your hard disk from there.
Image

nuesse
Level 1
Level 1
Posts: 2
Joined: Mon Nov 06, 2017 2:32 pm

Re: 2x export path in bashrc = user home dir lost?

Postby nuesse » Thu Nov 09, 2017 4:20 pm

Oh, sry, I totally forgot that.
The first one was, according to the composer manual:

export PATH="$HOME/.composer/vendor/bin:$PATH"

No problems with that.
Now follows the stroke of genius, the one I added:

export PATH="usr/bin:$PATH"

^^This supplemented path emptied my user directory. :'(

User avatar
xenopeek
Level 24
Level 24
Posts: 21380
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: 2x export path in bashrc = user home dir lost?

Postby xenopeek » Thu Nov 09, 2017 7:07 pm

I still don't see how that can do anything like you described. PATH just sets where the operating system looks for commands. I just added export PATH="usr/bin:$PATH" to my account, logged out and logged back in and it doesn't do anything nefarious. It just means that if in the current directory (whichever that is) there is a subdirectory usr with a subdirectory bin, commands to run that aren't specified with a path are first searched for there. Nemo doesn't care about this. It didn't do anything here.

So I think you did something else. Stupid question but did you check your trash? Are they perhaps there. Do you recall filenames of any of the files? Did you try a search in /home to see if they are perhaps somewhere else?

Did you confirm from logging in to another user account or booting from the Linux Mint installation DVD/USB that in fact there are no longer files in your home directory? If so, did you have either disk or home directory encryption? In that case your files are lost if you didn't have a backup. Important files should be backed up, because hard disks can and do fail suddenly (and there are accidents, theft and what not to consider—any file without a backup is a file you don't care about!). Backups of personal files are easily set up with a program like Deja Dup.

Anyway, if indeed you've deleted the files and you don't have a backup then stop using the hard disk: any more disk writes to the hard disk risk overwriting the parts of the hard disk where the deleted files were located. You'll have to boot from the Linux Mint installation DVD/USB or similar live operating system. You'll need a second (external) hard disk to recover the files to. You can try to recover the files with a program called TestDisk or if that doesn't work with PhotoRec. You can find downloads here https://www.cgsecurity.org/ and that website also has guides and tutorials for how to use them. This isn't trivial but if you have no other recourse, with dedication and patience you can likely recover many the files.
Image


Return to “Newbie Questions”