Home > linux > why 'cannot overwrite existing file'?

why 'cannot overwrite existing file'?

March 8Hits:2
Advertisement

I try to write to a file "date > file" but Linux says 'cannot overwrite existing file'. I tried chmod 755 but still cannot write to the file. What should I do? Thank you.

Answers

If you are running bash, the noclobber option has been set. Use >| if you want to temporarily override this.

It is possible that the file was set as immutable with chattr. It's rarely used, but it's a realistic possibility. In that case:

chattr -i [filename]

... should be able to remove that attribute.

  1. Go to your home folder
  2. Press Ctrl + H to show hidden files
  3. Check whether any of the folders are locked
  4. Right click on the folder then click "properties". In that click "permissions".
  5. Under owner, change folder access to "create and delete files."
  6. Click "Apply Permissions to Enclosed files"

If you cannot see any locked folders then select all folders and do the above

Related Articles

  • why 'cannot overwrite existing file'?March 8

    I try to write to a file "date > file" but Linux says 'cannot overwrite existing file'. I tried chmod 755 but still cannot write to the file. What should I do? Thank you. --------------Solutions------------- If you are running bash, the noclo

  • How to update a content management installation by overwriting existing files via ssh and shell?June 20

    I have installed a cms (modx) on a webserver running CentOS 5 and Apache 2.2. Now there is a new version and I would like to update it. The instructions in the modx-wiki suggest to overwrite the existing files. I've downloaded a .zip-File and extract

  • Why doesn't tar ask before overwriting existing files?February 22

    I lost a couple hundred lines of a Vim plugin I wrote and continue back up every so often because I extracted a tar file containing an older version. I decided not to use source control management when I wrote the plugin, since I only update it perio

  • ItemAdding not firing when "Overwrite existing files" is checked for SharePoint Document libraryMay 30

    I need to copy Existing file to A folder("Archive") while another file is uploaded with same file name to the document library. Ex I already have a filename "example.txt" in a document library. Now i upload another file with same name

  • Set "Overwrite existing file?" unchecked by default when uploading documentOctober 11

    Due to Business requirement is it possible to set "Overwrite existing file?" unchecked by default when uploading document. This change would let users prompt when overwriting document, at the moment due to user error documents are overwritten. -

  • I want to remove "Overwrite existing files" check from rteUploadDialog.aspx in sharepoint 2010February 4

    I need to uncheck the "Overwrite existing files" check that comes by default on the rteUploadDialog.aspx page (while adding file to a rich text box in OOTB lists). How can it be achieved? If I modify the page from the /_layouts folder then it gi

  • Files 3.6.3 overwrites existing files when merging two foldersApril 28

    I've upgraded from Ubuntu 12.10 that I installed with Wubi, to Ubuntu 13.04. When copying a folder from my secondary hard drive to a folder located in "/host/" with the same name, "Files" asks me if I want to merge these two folders. A

  • How to avoid overwriting existing files while using tar command?June 4

    The tar command just overwrote my file an hour ago while I was trying to make a tar to backup it. I ran tar zcvf foo.tex foo.bib and after that my tex source file lost. What's worse, this is the second time I lost my file in this way. I use gvim, but

  • disable overwrite existing filesJuly 22

    i have a requirmet to disable the "overwrite existing files" checkbox on sharepoint 2010 i am following this article but i dont have access to <<< Navigate to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPL

  • How can I set up a job to copy a directory, not overwriting existing files? January 18

    How can I create a job that copies the Directory /media/hdd/docs to the Windows share \192.168.1.3\Docs each night at 23:00, not overwriting existing files. The Windows share is shared to "Everyone" With read/Write on a Win2k12 server box ------

  • Extracting multiple rpm files and overwrite existing filesJune 4

    I have a bunch of rpm files in a directory, where all rpm files are extracted as /usr/.. I would like to extract all rpm files and overwrite existing files. I normally do that with file-roller -f *.rpm which brings up the GUI to ask the location to e

  • Prevent scp from overwriting existing files?January 15

    Have been googling this for a while, and the problem is not so much of one where I trust my users to "do the right thing" and have them use rsync with various options to avoid overwriting files. I actually need to somehow have scp not overwrite

  • apt-get: How to overwrite existing files from another package?May 3

    I'm trying to install Gnome3 for Natty, using the source deb http://ppa.launchpad.net/gnome3-team/gnome3/ubuntu natty main, however the following error: $ sudo apt-get install -f ... Unpacking replacement gnome-games-common ... dpkg: error processing

  • Robocopy, do not overwrite existing files, but copy the changed / new onesSeptember 24

    Is it possible to mirror the two directories without overwritting the files in destination directory with new/changed/deleted files. Something like snapshots. Example: Copy the source directory with all files and sub-directories to destination direct

  • Extract and overwrite existing filesOctober 3

    I am trying to write a batch script to extract files out of an existing zip file, into another folder on my desktop and to have the system not prompt me as to whether I want to overwrite the existing files or not. The script works with just -o but on

  • how to overwrite existing file in ftp using wput.exeOctober 31

    How can I force to always overwrite an existing file in ftp using wput? Anyone? please provide the dos command line. Thanks. --------------Solutions------------- You have to use -u and -nc options while uploading. For details check the project's Sour

  • sftpd allows file creation, but not overwriting existing files on HP-UXMay 13

    one of our operational systems (linux) pushes files to our server (HPUX) using SFTP. Sometimes (..) they need to resend an updated version using the same file_name, but the sftp server doesn't allow them to overwrite. the unix login used for copying

  • Overwrite existing fileJanuary 16

    I want to overwrite 2 files. Both files store information about my in memory database (HSQLDB): db.data and db.script My following code should do this: public class DBReset { public Path db_data = Paths.get("db_sep/db_backup/db.data"); public Pa

  • why CopyFile cannot overwrite existing file?October 18

    CopyFile return $Failed when the file exists on destination. is there any way to force CopyFile to overwrite the existing one? the way I use now is DeleteFile and then CopyFile --------------Solutions------------- Use the OverwriteTarget -> True opti

  • Uncheck "Overwrite Existing Files" from document library upload formAugust 16

    I have multiple document libraries in my sub-site. I want to uncheck the check - box appears on the upload form. Whenever user uploads form the form should appear with the check box unchecked. I referred this article but not helped me. How should I d

Copyright (C) 2018 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.744 s.