General :: How To Empty A File

Jul 15, 2010

I have a large file that a process writes to. I would like to empty that file. If I delete it the process will stop writing to it. Just flush the content but keep the file.

View 9 Replies


ADVERTISEMENT

General :: Shell Scripting \ (test If A File Is Empty, If It Is Then Display "file Is Empty" Otherwise Display "file Is Not Empty")?

Oct 5, 2010

I am a final year student doign Computer systems engineering and just been introduced to linux. While still strugling to catch up with the commands, I am now given an assignment under shell scripting.I seriously am strugling to understand this question, can you please assist me.Here follows the assignment:

Operating Systems III
Some tips
e.g. (test if a file is empty, if it is then display "file is empty" otherwise display

[code]....

View 10 Replies View Related

General :: Create Empty Or Blank Iso File?

Nov 23, 2010

I having been searching for a way to create an empty or blank iso file, so that I can mount it, and have a backup application think it's a blank CD. I am tired of wasting CD's by having the application write a recovery CD, just for me to turn around and export it to an iso image to be stored in a online archive, and then throw away the physical CD.

View 5 Replies View Related

General :: Cron - Mysqldump Job Creates An Empty Sql File

Apr 14, 2010

My cron job is executing the below mysqldump command but it produces an empty sql file. However, when I run from the command line, it works as expected.

Code:
15 6 * * * root mysqldump -uroot -pXXXXXXX mydbname | gzip > /home/dbbackup/db_`/bin/date +\%Y\%m\%d\%H\%M`.sql.gz

I'm on CentOS 5.4 and use "env EDITOR=nano crontab -e" edit my cron (then paste the above command.

View 5 Replies View Related

General :: Wget Showing An Empty File Being Created At Root On Every Run?

Feb 19, 2010

I have set up a cron job in linux server using the command 'wget -q -o wget_outputlog url'

But on every run, an empty file being created at root.

How to stop this.

View 6 Replies View Related

General :: Can't Empty The /tmp Directory Read-only File System Warning

Mar 2, 2010

Does anyone know why files in my /tmp directory are not able to rm even using root login? not only that, I can't even chmod or do anything to files in /tmp directory... it always saying "read only file system" warning

View 8 Replies View Related

OpenSUSE :: Empty The /tmp File Or Other File To Free Up Space?

Mar 23, 2010

I've noticed that when I run:

davek@linux-kw2x:~> df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda2 20641788 8427780 11165368 44% /
udev 961204 192 961012 1% /dev
/dev/sda3 217642344 4037944 202548468 2% /home
davek@linux-kw2x:~>

I have 44% used. It should be much smaller, under 10%. How do I empty the /tmp file or other file to free up space?

View 9 Replies View Related

OpenSUSE :: Cannot Remove Empty File?

Mar 2, 2011

I was copying an .avi file to an external hard drive and half way through the copy the drive reset and required remounting. Consequently I have an empty .avi file on the hard drive. I tried to recopy the file and overwrite, but I keep getting 'Could not write to media/harddrive/filename.avi'. I tried to rename to file to be copied but got the same response, I cannot delete the empty file either, as I get an error telling I cannot delete it. I have tried to do this as the user and root with the same result.Any other file I tried to copy onto the external hard drive is fine, just this one zero length file and the file I was trying to copy, the original of the file. I also tried to delete the file on another computer but couldn'tExternal hard drive is a WD elements ntfs, which works great except for this glitch.

View 3 Replies View Related

Ubuntu :: Sed Command Empty The File?

Mar 13, 2010

I have this file: 1.txt, with this contents:

Code:
test
mycomputer

I just try change the string "mycomp*" by "othercomputer":

Code:
sed 's/mycomp.*$/othercomputer/' 1.txt > 1.txt
but sed command empty the file.

[Code].....

View 2 Replies View Related

Programming :: In Correct File Is Empty?

Jun 17, 2010

I am using embedded Linux. File open is successful. The file has all the permissions. It is present in current directory too. The size is about 27KB. But s.st_size says it is zero.

inputFileName = "abc.mp3";
FILE* inFile = NULL;
inFile = fopen(inputFileName, "r+b");

[code]...

View 2 Replies View Related

Server :: The Boot.log File Is Empty?

Feb 28, 2010

Does anybody know why isn�t anything on the /var/log/boot.log file. After the boot I saw some services that fail to load and looking for more detail data on the boot.log file I couldn�t found anything this file is empty. This is My syslog.conf file:

Code:
kern.* /dev/console
*.info;mail.none;authpriv.none;cron.none /var/log/messages

[code]...

View 3 Replies View Related

Ubuntu :: Syslog.conf Empty File

Mar 15, 2010

I was checking my syslog.conf file recently and it seems that it is an empty file >_> it shouldn't be correct?

View 2 Replies View Related

Fedora :: Yum And Comps File Is Empty/damaged?

Dec 2, 2010

I have setup a local repository containing several .rpm files. I created a comps.xml file outlining the category and groups for the local repository. However, when I issue the yum grouplist command, I get the following error:

Failed to add groups file for repository: localRepo - comps file is empty/damaged

However, if I try to install one of the the packages in the repository, it works just fine.

Here are the steps I took to create the repodata:

The comps.xml and repository are stored in the directory:
/var/www/html/myrepo/x86_64
cd /var/www/html/myrepo/x86_64
createrepo -g comps.xml .

[Code]....

View 1 Replies View Related

Server :: Empty PID File While Starting Script?

Aug 16, 2010

I'm trying to write shell script to use etc/init.d In fact, my application has written by java and I have made the fat.jar (etest.jar)file as executable one and after I wrote the small script to run it background (etestruner.sh) that is,

Code:

#!/bin/sh
java -jar /root/les/run/etest.jar >/opt/etstout.out 2>&1 &

And after I wrote the service script That is ,

Code:

#!/bin/sh
#
# Startup script for epict
#
# chkconfig: 2345 25 88

[code]....

I tried with google to solve this issue but did not get any result.

View 3 Replies View Related

Programming :: Bash There Will Be Empty Lines At The End Of The File?

Mar 26, 2011

Using awk I pull the first field of a random line from my datafile.myvar1=`awk -F" " 'NR=='$randline' {printf "%s", $1}' myfileThis works fine. The problem is there will be empty lines at the end of the file. Rather than using awkto filter out blank lines I would like to figure this out first.So I test $myvar1 for a blank string after setting $randline to one that I know is blank:test -z "$myvar1" && echo "true" || echo "false"But, this returns "false"? So the string is not zero length. Why? It's a tab-separated file. Is awk storing the tab with the $1 field or something.This is where I get headache. I try to echo my variable to see what it looks like.

echo "$myvar1"
outputs: nothing
echo "My variable is [$myvar1]"
outputs: [y variable is [

Why is the closing bracket at the beginning? What character could be stored in $myvar1 that would do such a thing and how did it get there?

View 7 Replies View Related

OpenSUSE :: Configuration File Proftpd.conf Is Empty?

Oct 1, 2010

I just installed proftpd using webpin but when i tried to gonfigure it ,i figured out that the configuration file proftpd.conf is empty, is it about permission ?i just dont get it!

View 1 Replies View Related

Fedora Servers :: Can't Upload File To Empty Home Directory

Feb 1, 2009

I just installed FC10 and then used yumex to install the vsftpd FTP daemon package. I'm using the vsftpd.conf file that came with the distribution, and its almost identical to one I copied from my FC2 machine's working set-up. When I try to FTP in as a known system user I'm presented with my home directory /home/myusername/. The directory appears empty to the FTP program, but isn't in reality. I can't upload a file to the empty home directory. I can move up the directory hierarchy to /home/, but again that appears as an empty directory.

I don't think it's a vsftpd.conf file issue. I've tried everything I can there. Could it have something to do with permissions? I fiddled with those, but couldn't make an FTP directory listing work.

[code]....

View 5 Replies View Related

Fedora :: Geany + Gvfs + F13 When Try To Save, It Saves Empty File?

Aug 11, 2010

after update f12 to f13 geany stopped to work correctly on remote storage (sftp). Geany opens file correctly, but when I try to save, it saves empty file. I tried "notepad" and "gedit", they work good on f13. Geany on f12 worked correctly too.

View 3 Replies View Related

Ubuntu :: Error Line 1: Char 1 Whitespace Or Empty File

Jun 16, 2011

Greetings, I have installed a VMware host on Windows 7 64bit and followed with a 10.04LTS 64 bit guest install. Everything went smooth. I have used VMware before, but the other way around.. Linux host and Windows guest.

So this time I am installing the VMWare tools on the guest, ubuntu 10.04, but it seems to be failing. The vmware tools install ran fine the first time with no errors, but I was getting the follwoing error after logging into the Ubuntu guest afterwards.

Could Not Apply the Start Configuration for Monitors
Error Line 1: Char 1 Whitespace or empty file

So I re installed the VMware tools once again, but still the same.

I am hoping that someone here has come across this before and hs a workaround. I don't think the vmware tools was installed correctly.

View 1 Replies View Related

Ubuntu Servers :: Using TShark And Grep - Output Empty File?

Jul 13, 2011

I am not sure why this does not work..
tshark |grep 'string'
Gives me what I want but
tshark |grep 'string' >/tmp/outputfile
Gives me an empty file.

View 3 Replies View Related

Ubuntu Servers :: Modify The Httpd.conf File But It's Empty And Wordpress Installation

Jun 17, 2011

I'm installing Wordpress and I want Hosting Multiple Sites with them. For that I need modify the httpd.conf file but it's empty. Where I can make that changes? These are the changes:

1. Type: LoadModule rewrite_module /libexec/mod_rewrite.so
2. Find the <VirtualHost> section in the httpd.conf file.
3. Find a line in the <VirtualHost> section of the httpd.conf that looks like this: AllowOverride None
3. Replace that line with this line: AllowOverride FileInfo Options
4. On a new line, type ServerAlias *.[URL].
5. Save the httpd.conf file and close it.

View 1 Replies View Related

General :: How To Empty Several Subdirectories

Aug 18, 2010

I looked through google but can't find an answer for this..... say I have a directory called "files"; this directory contains several other directories..... what I wanna do is delete ALL the files within the subdirectories, but NOT delete the subdirectory. Can this be done easily without having to run a command for each subdirectory?

View 8 Replies View Related

General :: Using An Empty Ex4 Partition

Apr 12, 2011

I have Ubuntu in one partition . The partition is about to be full..I have a spare partition which I thought could merge with the existing..But I guess it is not possible. I am slightly confused with the way linux stores the files. There is a root directory and within that there are boot ,Var,tmp and home..

Suppose I install an application from a package manager , I really do not understand where the path is ...Supose I want to store certain new applications in the spare partition , how do I tell the system? Also while installing it doesnt give a choice regarding the path ...All I see is a couple of files exracted and when it completes , it sits on the menu neatly. From a storage perspective how do you gain control? Say in Win , normally any package will ask for the path which you can customize..How do you plan the storage of files in Linux?

View 7 Replies View Related

General :: List Only Non-empty Files Using Ls?

Sep 23, 2010

How can I list (using ls) all files that are not empty (size > 0) using linux?

View 7 Replies View Related

General :: Command To Empty Recycle Bin?

Oct 15, 2010

Simple question but even google does not come up with an answer, seems to be too easy that someone else asked it ;). Could anyone tell me what is the shell command to empty the garbage bin under Linux?

View 3 Replies View Related

General :: Empty Map In Nautilus But Not In Terminal?

Aug 25, 2010

Lucid 10.04 distro. On an ext usb hd I have 250Ǵ info in 6 directories. All directories are visible in terminal mode mod 755. All directories are visible in nautilus, all files are visible except in one directories which contains 200gig of videos.A file search shows all in all directories. All files can be opened mv, cp etc. I can move a file from this directory to another and all is well.In my Debian 5.05 distro with the same hd and directories etc, this problem does not occur.

View 6 Replies View Related

General :: How To Delete All Empty Folders

Jun 7, 2010

I just had a bad experience with a server, and now i have a 17GB lost+found. It appears a lot of the stuff in there are folders which are empty. Since those really serve no purpose as far as recovering data from what I can tell, is there a slick way to delete just the empty folders from my /data/lost+found folder, leaving me with just the stuff I truly need to look through?

View 3 Replies View Related

General :: Everything Is Going Great \ Mail.log Is Empty?

Apr 15, 2010

OS: DebianMail Server : PostFixAV: ClamAVI have a newly created SMTP mail server and so far, everything is going great. Over 300 mails are being sent a day and no major issue has come up since then.However, the thing is that every morning I'm rotating my logs so that mail.log becomes mail.log.0 and so on.Its working fine but this morning, mail.log after having been empty and rotated, is empty and nothing is being logged anymore in it.The strange thing is that mail.info is but not mail.log. Mail server is still working well, syslog shows nothing strange, mail.err either, everything is working smoothly as its always been since I started everything, but my mail.log is being kept empty

View 2 Replies View Related

General :: Forcing Tar To Create An Empty Archive?

Apr 21, 2010

I'm trying to use tar to tar files before transfer, so I can keep the entire file path rather than losing it along the way. However, when I try to tar an empty folder, it tells me that it is cowardly refusing to create an empty archive. I want to keep the empty folder on the other end, but don't want to put anything else into the archive to make it non-empty. Is there any way to do this?

View 1 Replies View Related

General :: Empty Bash Command Line?

Sep 28, 2010

I am looking for a way to delete the currently entered commandline without wasting seconds on the "Backspace"-key.

For example I scrolled the bash history and have a long commandline that would execute when I pressed ENTER:

~$ aptitude search openssl | grep dev

But now I decide that I do not want to execute this command. Can I get an empty prompt fast without deleting the whole line with Backspace? On the Windows "cmd" you can just press ESCAPE and it is gone. This behavior would be what I want.

The question may seem trivial but this is bothering me for a long time now.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved