I've got a problem with editing eclipse.ini.
My system is Arch-based Manjaro, if it'll help.
I tried with edit it with a root rights with sudo -e /snap/eclipse/current/eclipse.ini, but it said "file system is for read only". Then I tried sudo gedit /snap/eclipse/current/eclipse.ini, and then it said "You're trying to save to save the file on a read-only disk". No system reboot is helped.
So what should I do? I'm trying to make my eclipse work for a few days already XD.
Related
Win 7
cygcheck (cygwin) 3.1.7
I created some mount points (mount winname name) years ago. I've just installed a new HDD and have to change the links.
There are some links where the owner:group is "?:?" (attributes are "??????????", size is "?" and time is "?"). I can not delete these links, change owner:group or chmod. They are inaccessible and return with an error message of "cannot access 'symlink': No such file or directory" whenever an operation is tried on them. But, they are listed under 'ls'.
I can not do a umount name. The error message is:
Is there any way that I can just delete these things and start over?
Well, I just forgot about mount tables (fstab). editing /etc/fstab solved my issues.
Sorry to have wasted your time.
Microsoft just introduced a Linux subsystem in its Windows 10 Anniversary Edition. The installation is pretty straight forward, but I could not locate bash files on Windows.
How does it work? What does ~ refer to in Windows? Where to find .bashrc?
Since the Windows 10 Fall Creators Update, the location changed to:
C:\Users\USERNAME\AppData\Local\Packages\{DIST}\LocalState\rootfs\home\{LINUXUSER}\
Where:
{DIST} is equal to CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc
{LINUXUSER} is the user for which you are looking for the .bashrc file
Just for anyone wondering that came here from Google.
Sorry for the misunderstanding, I check on google and it will be at C:\Users\USERNAME\AppData\Local\Lxss\home\USERNAME .
I tried and it works, in the cmd just type cd\ && dir *bashrc* /s it will locate the file, and in my case i see the line C:\Users\USERNAME\AppData\Local\Lxss\home\USERNAME but when I want to navigate it with the window browser it doesn't work, but if you copy paste it, it works :-)
I found it here.
Considering that you need to know where a file is located you can use the find command.
The syntax of the command is find {search-path} {file-names-to-search} {action-to-take}by default the action to take is printing the file name.
So if you are finding .bashrc file you can use find / -name .bashrc the bash will return you /home/yourusername/.bashrc
Also, if you want to access to your home directory you can use cd ~
Hope my answer will be helpful :-)
just type
vi ~/.bashrc
and that should put you into the file where ever it is.
You can navigate there simply by doing cd ~
List all files with ls -a and you should be able to see it.
~ means that is user home folder, way like /home/%username%/
you can list files like ls -al and see .bashrc file.
Right now on WSL 2 you can find it under /home/{user_name} and the file is hidden.
You can access it from Ubuntu console by {text_editor} .bashrc
If you want to edit that in Windows just type in ubuntu console explorer.exe . and it opens the current folder and shows all hidden files.
It's weird but works fine.
Other answers doesn't work for me using WSL 2.
The LocalState folder contains a virtual disk so rootfs does not exist,
and AppData\Local folder does not have the Lxss folder.
The solution for me is surprisingly simple:
wsl -u root
This will allow you to get into wsl as root.
From here, you have access to the whole linux.
Fix the .bashrc or anything you want.
Don't screw up the root user. :)
I find my .bashrc file in:
/home/your_user_name
you can run cd /home/your_user_name or cd ~ should work as well
If you previously installed git bash for window, you may also find .bashrc file in your window user profile folder. In Linux subsystem, you may local the file under /mnt/c/Users/your_window_user_name/.bashrc However, modifying that file only works for git bash in window but not for the shell terminal of the Linux subsystem.
Note: my installation of the Ubuntu is 20.04 LTS straight from window store.
I just installed Atom, and I am getting an error thrown up when I go to save the project.
Unable to save file: Permission denied
I am signed in with admin privileges.
Try running:
sudo chown -R username:www-data /path/to/directory
"username" being what gets spit out when you enter
whoami
Digital Ocean's tutorials are pretty good for installing stuff the right way. I got the above from https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-lamp-on-ubuntu-16-04
This is because of linux permissions. The best way to solve this problem is by providing permission for the user. This can be done by chown command.
sudo chown -R username:groupname directory
You can find your username using whoami command and your group name by using groups username command.
Let's say you got "john" as your username. To get groupname you run the command
groups john
You will get an output something like this
john : john staff adm cdrom lpadmin admin
The first name after : is your primary group. In the example it is "john"
The command will be
sudo chown -R john:john /opt/lampp/htdocs
This isn't an atom problem, it's a linux permissions problem.
You opened a file owned by another user (a file probably owned by root). If you want to edit that file, you have to either be root or change the permissions on the file to grant other users access.
Usually the best solution is to temporarily become root and edit the file:
sudo atom /path/to/file
if your case is same situation as this screenshot
try this
$ sudo chmod -R 777 ~/.atom
there is alot of ways to solve this problem, i just change the permisions on the proyect folder:
sudo chmod 777 /path/to/folder/proyect
This is happening because linux don't have permissions. The best way to solve this problem you have to provide permission for the user to access particular directory/folder or file.
Please follow the below steps to give permission.
First find your username by entering the following command in console.
whoami
You will get an output something like this
jrathor
You got "jrathor" as your username.
Now provide permission to that particular folder/directory or file which one you are not able to access.
sudo chown -R jrathor /path/to/folder/or/file
Now you can edit all the files which is available in directory.
It Will work for ubuntu as well as for MAC also.
If you get this error in ubuntu 20.04 as well, I found a solution.
In terminal(ctrl + alt + t), you can access to root using this order 'sudo su'.
Give your password then go to the directory exactly atom want to save.
First,'cd' to find right directory. then again, 'cd /usr/bin'.
Now you are in the directory /usr/bin. Type 'touch atom'. It will make atom txt file in your path. And type 'exit'
sudo chown -R username:www-data /path/to/directory
"username" being what gets spit out when you enter
whoami as #sam said above.
Go to atom, try save the file again. atom will be saved successfully.
before run your file with atom , if you change your file write permission other users can save it
you can read from here for permission linux-permission
$su -
password:
chmod 777 index.php
open new terminal and run your file with texteditor
$ atom /var/www/html/wordpress/index.php
It might be late to answer this, but I tried this and resolved my issue:
(Disclaimer : I tried to save changes in keymap.cson file in atom, got error : Unable to save changes : Permission denied)
chmod 777 <file name>
and after that,
go to the file "keymap.cson".
right click and go to properties.
un-check hidden check-box.
you are good to save changes in keymap.cson in atom
Happy saving :)
This same problem occurred on my Mac running OSX.
Problem:
for some reason npm created the react app with Read & Write permissions to System for only the app folder, although all files and folders contained had read/ write permissions to me, the creating user.
Solution:
You'll need the admin password.
Visit the app folder in Finder, like, "directory/ReactApps/react-app/...", right-click and click the dropdown menu for "Permissions", click the padlock icon in the bottom right of that pane and enter the admin password, create a new user by clicking "+" icon, select yourself, and Read/Write permission, click the (unlocked) padlock icon again.
Copy your current code in Atom, quit Atom (cmd+q), restart, select the file, select all (cmd+a), paste, then save (cmd+s).
Onward
If you are using AWS cloud 9 lightsail (magento in my case) use:
sudo chown -R bitnami:bitnami /opt/bitnami/apps
this will allow you to have full access to your file tree to create new folders and files. (may do more not sure, as im now to this).
Thank you,
So I was editing a cpp file in sublime on my linux machine and I'm not sure what I did or what happened but all of a sudden the file disappeared on sublime. So it went to it's directory to open it back up but it's not there.
I did a quick search for it and it says it's says it's still in the the directory it was in but it doesn't show the actual file.
I don't think it's hidden. Any ideas??
Thanks
Use chmod to give permission to use the file in user.
chmod 777 <filename>
Before running this command you have to open root privilege by using sudo su command.
I'm trying to install something on my MacOS (or Linux) system and I don't have permission because I'm not the admin. So I tried using sudo and it says that I'm not in /etc/sudoers file. I've tried editing the sudoers file but it won't let me, so I "googled" it. Everybody says to use visudo to edit the file. The problem is, it won't even let me use visudo! When I type "visudo" it just says
visudo: /etc/sudoers: Permission denied
Would appreciate some help. Thanks in advance!
EDIT: I tried switching users and then editing the sudoers file but still didn't work
You need to be root (or have rootprivileges) in order to use the visudo command and edit the sudoers file
If u messed up your sudoers file.You'll need to:
Reboot into recovery mode (hit escape during boot, choose the recovery mode option on the grub screen)
Choose the 'Enable networking' option (if you don't your filesystem will be mounted as read-only. who knew)
Chosee the 'Drop to root shell' option
run visudo, fix your file
Reboot with normal grub option
source :- http://mario.net.au/content/recover-etcsudoers-ubuntu-1204
You have to be root or use sudo to edit the sudoers file.
sudo visudo
I am new to mac. Very annoyed by the time=0 for sudoer (you havew to type the password every time you use sudo). I want to increase this value to a reasonable number:
timestamp_timeout=30.
After adding the above line to the /etc/sudoers file, I could not login as su anymore because the parser fails to read the sudoers file.
This posting is to document how I fix this problem.
1. Restart your mac
2. Hold on to Command-R two keys until you see the progress bar.
3. Start a new terminal, this terminal will be the root terminal
4. Edit the invalid sudoers file. Note this file is not in /etc/sudoers when you loggedin in as root
The full path is:
/Volumes/Macintosh HD/etc
restart then you are happy again.
This method will also apply to users who are not in the sudoers list and want to add themselves to the list.
Note: if you could not find the sudoers file as root use find:
find / -name sudoers