0

I have a Problem on my Ubuntu machine. When I try to open some file in an editor like nano, vi or sudo gedit, nothing shows up, but nano ~/.bashrc works fine without any problem.

I have two user accounts on my Ubuntu system, and it's the same problem with the other user account.

6
  • Why you tagged this question as it would be about Ubuntu One?
    – Xerz
    Jun 3, 2012 at 9:50
  • Which system version are you using? Why sudo gedit?
    – Xerz
    Jun 3, 2012 at 9:50
  • I dont know exactly where to ask my question :(
    – iav-babak
    Jun 3, 2012 at 9:51
  • Ubuntu One is a Dropbox-like service... Tag it with the Ubuntu version you're using!
    – Xerz
    Jun 3, 2012 at 9:53
  • Can you say me which files are you trying to edit?
    – Xerz
    Jun 3, 2012 at 9:56

3 Answers 3

2

You're trying to open the files with commands like this:

nano etc/apt/sources.list
nano conf/hadoop-env.sh

In the first, you forget to add the root folder! Just add a slash before the rest of the file path:

nano /etc/apt/sources.list

In the second, you need to add the Hadoop path:

nano $HADOOP_HOME/conf/hadoop-env.sh

Also, you'll probably need to open them as root user, so add sudo before all the command (just like with gedit!):

sudo nano /etc/apt/sources.list
sudo nano $HADOOP_HOME/conf/hadoop-env.sh
3
  • I did it but no changes :(
    – iav-babak
    Jun 3, 2012 at 10:11
  • Modified! Now you should be able to do what you want!
    – Xerz
    Jun 3, 2012 at 10:15
  • 1
    Wow...good catch @espectalll123. I made the assumption that he was coming from a relative path and knew what he was opening. (I just typed the /etc out of habit more than anything.)
    – JasCav
    Jun 3, 2012 at 10:25
0

The reason you are having an issue manipulating files is that you must have the appropriate level permissions in order to manipulate those files.

So, for example, if you want to manipulate /etc/apt/sources.list, that requires that you use sudo to temporarily elevate your permissions so you can edit the file. On your current user account, try:

sudo nano /etc/apt/sources.list

If you are already part of the sudo group, then you will be asked for your password. Once you type in your password, your privileges will be temporarily escalated so you can edit the file and save it.

If you are not part of the sudo group, another user on the system who has sudo access can add you by doing:

sudo usermod -a -G sudo your-user-name

Learn more about Linux permissions here: https://www.linux.com/learn/tutorials/309527-understanding-linux-file-permissions

3
  • thank you for your answer. for this command sudo nano /etc/apt/sources.list works fine but for this one sudo nano conf/hadoop-env.sh the problem remain
    – iav-babak
    Jun 3, 2012 at 10:09
  • For the second command, read what I answered!
    – Xerz
    Jun 3, 2012 at 10:12
  • I did it but no changes in result :(
    – iav-babak
    Jun 3, 2012 at 10:14
0

vi function in Ubuntu is different, you can install vim-nox or vim package So after that you can try it for the same file

use following command

sudo apt-get install vim-nox 

or

 sudo apt-get install vim
2
  • That's not what's he asking... I think.
    – Xerz
    Jun 3, 2012 at 9:56
  • thank you for your answer but I thin my problem is from another thing. if i run nano etc/apt/sources.list it works fine. The folder the the file are in them have a lock
    – iav-babak
    Jun 3, 2012 at 9:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .