General :: Command Line To Prepend 8 Bytes Of Data To A Binary File?
Jan 14, 2011i would like to add 8 bytes of data to the begigning of a binary file.is there a command for this?
View 2 Repliesi would like to add 8 bytes of data to the begigning of a binary file.is there a command for this?
View 2 RepliesIs it possible to use grep to search for a sequence of bytes? For instance say I was looking for the following byte sequence in a file:
64 03 40 30 ; add eax, fs:[eax+30h]
Is this possible to do using grep?
Now, I use Fedora Core (version 8) with core linux OS 2.6
I have some file data with size about 2G and I want to burn (write) this file to DVD rewrite.
I know linux OS can install software to burn data to DVD, but I don't have permission to install more software. I only use command line over Terminal (Gnome Terminal).
I recently had to move to a new machine, everything went well except for one thing. I did fresh installation of LAMP server all with default configs. Every time I'm using PHP script to that invokes include, require or require_once I get the following error:
Code: Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to allocate 7680 bytes) in /var/www/index.php on line 2 index.php file: PHP Code:
<?php include "index.php";?>
icukapi.php file:
PHP Code:
<?php echo "test";?>
My memory_limit in php.ini is set to 20M. I tried to increase that however it didn't quite work. PHP seems to allocate all possible space and return that message every time i try. If somebody has an idea of how to fix it I would be more than grateful. I spend quite a long time searching for an answer however the all things i found suggested increating memory_limit which in this case doesn't work.
I manually rotated my catalina.out file, and now the file jumps to 30+Mb and when I try to view it, less tells me it might be a binary file. It sure appears to have binary data in it, about 30meg of it.
I did the rotate via a copy:
copy catalina.out to another file
cat /dev/null > catalina.out
I have tried using echo:
echo "" > catalina.out
...also with the same result.
This application isn't something I can just bounce when necessary. It kind of appears that the original file is still there - sort of. But is it not readable text anymore.
SunOS 5.10
tomcat 5.5.26 (version required by app vendor)
I have installed RHEL-5 on a 64-bit machine recently, and want to install java. Earlier when I did "java -version", it showed jre1.4.0. But for my application , I need jre 1.5.0 or later, so I decided to download jre1.6. I am the root user here and I downloaded the jre1.6 as rpm.bin as well as simple .bin format.
But the problem is that when I tried executing any of them, I am getting below error message :
" ./jre-6u16-linux-x64-rpm.bin: line 368: ./install.sfx.20520: cannot execute binary file"
Moreover, now when I tried "java -version", it is not showing any thing.
Could anybody suggest me how can I resolve this deadlock situation, as I need to install my other application at the earliest.
I installed Fedora 10 on a pc I built from a barebones package, I have had no problems over the past couple months until recently. When I start up the pc the OS lags on a black screen with the cursor blinking. I have searched forums but I guess since I am a newbie I am still lost in the translations. What I am trying to do is save my files that are on the pc to a DVD-RW or my external hard drive before I have to reinstall the software again.
My questions are as follows:
How can I locate the files on the hard drive? When I have the bootable cd-rom inserted I am unable to locate the HDD. How can I transfer my files using the command line prompt? Finally, is it possible just to upgrade to the latest Fedora without losing my files and going through the data recovery process head ache? Or can I reinstall the OS and not lose my files?
I'd like show a certain line or lines of a file with context, kind of like a unified diff, on the command line in Linux:
$ (something) -l 154 stuff.py
150: def foo(bar):
151: """
[code]....
I have AMD Phenom 8550 triple code processor, with 2.20ghz speed and 4gb ram. I am trying to install Redhat linux 9 first time. I am new to linux. While install system hangs with message
ehci-hcd 00:13.2: PCI device 1002:4396
echi-hcd 00:13.2: irq 10, pci mem f880f800
usb.c: new usb bus registered, assigned bus number 2
PCI:00:13.2 PCI cache line size set incorrectly (64 bytes) by BIOS/FW" expecting 16
how to get rid of this message
Is there such an application that can handle opening a 30GB binary file containing hex data? GHex won't open it.
View 11 Replies View RelatedI have just created a usb boot disk so that I can install Fedora 14.I used the following which was successfully. However, I am left wondering what does the bs parameter actually does. I know it mean bytes and copies these at a time. But how do I know what to set it to?dd if=F14-Live-i686.iso of=/dev/sdb bs=8MIn the above example it is set to 8MB. However could I set this to any value that I want?
View 1 Replies View RelatedI have just compiled a linux build of tests in my VirtualBox VM. When I run it, I get:
bash: ./tests: No such file or directory
I did some research, and found it could permissions, missing libraries or different architecture. So I checked those:
ls -al tests:
-rwxr-xr-x 1 me me 9948598 2011-02-21 01:54 tests
file tests
tests: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, not stripped
uname -a
Linux DevBox 2.6.35-25-generic #44-Ubuntu SMP Fri Jan 21 17:40:44 UTC 2011 x86_64 GNU/Linux
ldd tests:
linux-vdso.so.1 => (0x00007fff7db90000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00007f10ef14c000)
[Code].....
I need to be able to convert HTML email messages saved as text files (.eml or .msg) to PDF documents, one PDF per email, retaining formatting and images.
Are there any Linux tools that will allow me to do this from the command line (so it can be scripted)?
To investigate an issue, I need to tarball all the files in a sub-directory without prepending the name of the subdir to each file. For instance, I do notwant tar to include MYSUBDIR:
Code:
/tmp# tar czvf package.tar.gz MYSUBDIR
MYSUBDIR/
MYSUBDIR/file1
MYSUBDIR/file2
I tried "-C MYSUBDIR", or "tar cvPf", but tar always includes the path to the files.
The only way I found is to "cd MYSUBDIR" before running "tar cvf".
Is there a way to tell tar to exlude the subdir name?
To start off I would like to acknowledge that I am not a very good C programmer and pretty much everything I know has been self taught through mostly trial and error. So forgive me if there is an obvious answer to my question, or if I don't immediately grasp the concepts involved in the possible solution.
Basically, I'm writing an application which will be creating log file entries rather rapidly (potentially hundreds per minute), and I would like each new line to appear at the top of the log file, rather than the end. Opening a text file in append mode is easy enough, but I can't seem to find any obvious way to do the opposite.
I have been looking online and it seems that there exists no standard way to do this, and I have only been able to find a few mentions of how somebody might achieve it. The most common method seems to be using two files and copying the data back and forth between them. This seems like it would be insanely I/O intensive with the number of lines I'm likely to be generating. If this is the best method to use, I will give it a shot; though I am not 100% clear on how to implement it, I am also open to any other ideas as to how to accomplish this, and I don't have to worry about portability since the program already uses Linux-only libraries. So calling out to sed or something is not necessarily out of the question (though I imagine performance would also be an issue there).
Let's say i have a link to a file http://www.domain.com/dir/myfile.ext
Is there a command line tool that will allow me to download this file. I'm looking for something like: download <http address> ... is there anything that simple?
I would like to insert a line into the /etc/sysconfig/iptables with a command like sed or with any script. How can I insert this line:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
but under the line "-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT"
I want to download a file from the Linux command line. Basically I'm using ssh and I'm trying to download a file to my file system on my laptop. How can I do that from the command line?
View 3 Replies View RelatedHow can I create multipart rar file in Linux using the official console rar client?RAR 3.90 Copyright (c) 1993-2009 Alexander Roshal 16 Aug 2009Shareware version Type RAR -? for helpI want a multipart rar with each part size being 150 MB.
View 1 Replies View RelatedHow to split a tar file into smaller parts at file boundaries?
How can I create a multipart tar file in Linux?
I have a jar, and I need to replace a class in it, at this moment, I can only open it with "archive manager" and then drag and drop the new compiled class into the jar, but I think this is really boring, if I can do with with just a command ?
View 1 Replies View RelatedWhat's a Unix/Linux one-liner that will let me delete all but the most recent N revisions of each file?
I've got a bunch of files with revision numbers as part of a legacy asset-management system:
bar.r7.js
bar.r8.js
bar.r9.js
bar.r10.js
bar.r11.js
[Code]....
I want to keep the last three of each, so in the above list the command would delete bar.r7.js, bar.r8.js and foo.r1.js.
I've got files in a directory as follows:
1.png
1_thumb.png
1-1.png
1-1_thumb.png
[code]....
I want to list all the files that don't have a copy with the same filename with -1 somewhere in it. So, in the example above, the results would be 3.png.
NB: the file and its copy with "-1" in it will be the same filesize, if that helps.
find and use the file-manipulation tools for the command line.
View 2 Replies View RelatedWhat is file-manipulation tool used for on the Linux command line?
View 7 Replies View RelatedI've got a Debian Squeeze computer on which the graphics have packed up, but the terminal in single user mode work perfectly fine.
There are a few files on this Debian computer that I want to transfer off, to a networked computer, but I have no idea how to do this.
The destination computer is a freshly re-setup Mandriva install, without (as yet) samba. I don't think it's necessary though. The Mandriva install works fine, has graphics, etc, but can't see the Debian Squeeze computer on the network, possibly because it's in single user mode, thus prompting the problem of how to transfer the files, using only a command line.
I want to insert the text "DB dept" in the last line of passwd file which looks like this right now
Quote:
newuser:x:717:717::/home/sacharje:/bin/bash
And I want it to be like this:
Quote:
newuser:x:717:717: DB dept:/home/sacharje:/bin/bash
I tried to do that with sed but failed, I'd like to know the proper syntex with sed to achieve this.
How do I find the file-manipulation tools on the command line?
View 5 Replies View RelatedI need to be able to edit a file from the commend line as I intend to script this operation, the file is called menu.lst The original is as below
Code:
titleUbuntu 8.04.3 LTS, kernel 2.6.24-24-generic
root(hd0,0)
kernel/boot/vmlinuz-2.6.24-24-generic root=UUID=b09feb23-5524-4ec4-862f-94700b968f64 ro quiet splash
[code]....
I want to tail the latest log file in one command line. I dont know what command/option to use for the same.
View 5 Replies View Related