E138: Can't write viminfo file $HOME/.viminfo [closed] - linux

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am using opensuse for my production environment.
I am login as "test" user and trying to edit a file using "vi" but when i am going to save
that file it shows the following error
**
E138: Can't write viminfo file /home/test/.viminfo
**
Under the "test" user all the files and folder autometically become read-only.
I am trying to change the permission using "root" user but unable to change it.
also I look for temp file like "~/.viminf*" but there nothing like this.
Don't know what to do plaese help....
anyone aware about this problem

Fix your home directory owner and permissions.
sudo chown -R test /home/test
sudo chmod u+rw -R /home/test
And finally check that no old temp files were left behind (e.g. ~/.viminf*) and that you can write in the directory of the .viminfo file.

Related

read-only files on Ubuntu [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
when trying to delete file, I got the rm command on ubuntu page at https://help.ubuntu.com/community/DeletingFiles. And on, this page I got the term read-only files. I have tried to google read-only file linux, but cannot find any definition about this. Could you tell me what read-only mean? Does it mean all owner, group and other have only read permission? Thank you!
Does it mean all owner, group and other have only read permission?
They may have different permissions. But you (the current user) have only read permission.
Linux has three kind of permission for user, group and others.
r: read permission
w: write permission
x: execute permission
If the file is read-only, it means you (the user) don't have the w permission on it and so you cannot delete the file.
Use:
chmod +w FILE
To add that permission. You can change files permission only if you're the owner of the file.
Otherwise, you can remove the file using sudo, gaining super user privilege.
sudo rm FILE
It will prompt you for a password and it will works only if you're in the /etc/sudoers/ file (and you're likely to be there if you're the only user, since you're using Ubuntu).
A read-only file is a file that you don't have permission to alter its content. To see detailed info about your permissions use ls -l; if you want to change the permissions, use chmod. Also see this example for better understanding.
Change the Permissions with chmod or try with sudu:
sudo rm file.xxx

difference in outputs of pwd and /bin/pwd [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
i created a soft link from my home folder to /etc/ by using
"ln -s /etc/ foo"
then i changed directory to foo
"cd foo"
now i executed the following two commands
"pwd" and "/bin/pwd"
Both gave me different outputs.
The output of "pwd" was /home/myhome/foo and of "/bin/pwd" was /etc.
I am not able to understand the difference in the outputs although both commands are the same.
Possibly a bit oversimplified, but the bash builtin pwd tracks cd commands, so when you cd through a symbolic link, it remembers that. On the other hand, /bin/pwd walks the directory tree back to the root, and, as such, has no idea what symbolic links you might have walked through to get where you are.

cp: cannot create directory Permission denied [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have a Folder named "Parser" with in my directory .
I am trying to copy this folder (Parser) from my own directory to my collegues directory under /home/vinay
But i am getting this Exception
cp: cannot create directory `/home/vinay/Parser': Permission denied
These are the commands i executed .
-bash-3.00$ cp -r Parser /home/vinay/
cp: cannot create directory `/home/vinay/Parser': Permission denied
This is because you have no permission to write vinay's home folder.
You can do this either as a root user (if you're in sudoer list), or you can place the file at someplace public (e.g. /tmp) and told vinay to fetch it there.
This is an article about linux file permissions. Hope it helps.
The error message reads Permission denied, which means you - a user - don't have permission to write to vinay - another person - home directory. For more reading

How to create a link to a directory on linux [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
This post was edited and submitted for review last month and failed to reopen the post:
Original close reason(s) were not resolved
Improve this question
How to create a link to an existing file or directory using a GNU Linux shell command?
Symbolic or soft link (files or directories, more flexible and self documenting)
# Source Link
ln -s /home/jake/doc/test/2000/something /home/jake/xxx
Hard link (files only, less flexible and not self documenting)
# Source Link
ln /home/jake/doc/test/2000/something /home/jake/xxx
More information: man ln
/home/jake/xxx is like a new directory. To avoid "is not a directory: No such file or directory" error, as #trlkly comment, use relative path in the target, that is, using the example:
cd /home/jake/
ln -s /home/jake/doc/test/2000/something xxx
you should use :
ln -s /home/jake/doc/test/2000/something xxx

Untaring files into a new folder [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I've got a bunch of tar and tar.gz files that I would like to unzip. Inside these files, most of them have the same folder structure zipped up inside (although with different files).
If I were to do this manually by right-clicking and selecting "Extract Here," it'd would create a new folder for me with the original file name and dump the files there.
However, when I do this via the command line, the behavior isn't always the same. Sometimes it'd create the desired new folder and other times it wouldn't, causing it to overwrite the extraction of others.
Using the -C option seems to require the folder already existing. How can I mimic the behavior of the manual "Extract Here" in the command line?
Thanks.
You could create a bash function like this;
function untarhere() {
(mkdir -P $1; cd $1; tar xzf $2)
}
and then call it like
untarhere /your/destination/directory /your/tar/file.tar

Resources