Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

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

3 Answers 3

up vote 2 down vote accepted

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
share|improve this answer
    
I did it but no changes :( –  iav-babak Jun 3 '12 at 10:11
    
Modified! Now you should be able to do what you want! –  espectalll123 Jun 3 '12 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 '12 at 10:25
add comment

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

share|improve this answer
    
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 '12 at 10:09
    
For the second command, read what I answered! –  espectalll123 Jun 3 '12 at 10:12
    
I did it but no changes in result :( –  iav-babak Jun 3 '12 at 10:14
add comment

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
share|improve this answer
    
That's not what's he asking... I think. –  espectalll123 Jun 3 '12 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 '12 at 9:58
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.