The tag has no usage guidance.

learn more… | top users | synonyms

27
votes
2answers
11k views

Fix terminal after displaying a binary file

I'd tried command cat with an executable file: cat /bin/ls Now I can't read any word in this terminal (Linux console). How can I fix it?
6
votes
4answers
491 views

How to gather byte occurance statistics in binary file?

I'd like to know the equivalent of cat inputfile | sed 's/\(.\)/\1\n/g' | sort | uniq -c presented in ...
3
votes
2answers
68 views

Trace a binary stream from a device file

I'm debugging a binary stream that is coming from a device file. I would like to have the output printed out in real time as hex values. So far I've used tail -f /dev/ttyAPP2 | hexdump -C but after ...
4
votes
2answers
4k views

Use curl to send binary file through POST with content-type multipart/form-data;

A post request is made to: http://www.example.com/example/ and the post data is as follows: ------WebKitFormBoundaryB8NNdk2kNdndnnn Content-Disposition: form-data; name="picture[uploaded_data]"; ...
198
votes
5answers
36k views

/usr/bin vs /usr/local/bin on Linux

Why are there so many places to put a binary in Linux? There are atleast these five: /bin/ /sbin/ /usr/bin/ /usr/local/bin/ /usr/local/sbin/ And on my office box, I do not have write permissions ...
1
vote
2answers
239 views

Extract data between two matched patterns in a binary file

I am trying to extract a jpeg image from a binary text file. I want to extract all data between 0xFF 0xD8 (start of image) and 0xFF 0xD9 (end of image) inclusive. Earlier, I have successfully run the ...
4
votes
1answer
46 views

Finding out binary's compiling computer name

We have recently in our workplace stumbled upon a really old binary file that originates from unknown old computer. However in order to run this binary we need to get some local resources and ...
5
votes
2answers
226 views

Create the same PNG with ImageMagick 2 times: Binaries differ

I create two images that should be identical, but their binaries are different: $ convert -size 1x1 xc:white out1/w.png $ sleep 1 $ convert -size 1x1 xc:white out2/w.png $ diff out1/w.png out2/w.png ...
19
votes
2answers
21k views

How to convert a shell script into a binary executable?

I want to convert my shell scripts into binary executable so that nobody else could edit or read it. Is there a way to convert it into a binary executable?
2
votes
1answer
36 views

Is there a way to create endless stream with custom character?

I need to create an endless stream of characters like /dev/zero but I need it to spam custom character (like 'a') instead of 0x00. Is there a way to do it?
1
vote
1answer
55 views

Apply SHA256 and Base64 to string in script

I'm trying to apply SHA256 and then Base64 encode a string inside a shell script. Got it working with PHP: php -r 'echo base64_encode(hash("sha256", "asdasd", false));'. But I'm trying to get rid of ...
0
votes
2answers
59 views

What does mean by “Debian on track to prove binaries' origins”?

I found an article on The Register of the UK about the reproducible builds in Debian. I couldn't understand much from it. Could anyone simply this for me, please? Here's the link: Reproducible Builds
0
votes
1answer
48 views

How to recognize binaries installed in `~/bin`? [duplicate]

I am trying to execute some binaries manually installed in a bin directory in my $HOME (normal user). Files are present in /home/user/bin and have exec permission: $ ls -la ~/bin/ total 120 ...
2
votes
1answer
219 views

How do I repair binaries?

So, basically I was messing up with minix and qemu and I messed up too much. me@meplepl ~ $ which bash: /usr/bin/which: cannot execute binary file: Exec format error me@meplepl ~ $ file ...
2
votes
2answers
249 views

How can I effectively purge a manually installed package?

I installed SBCL 1.2.3 on Ubuntu 12.04 by downloading sbcl-1.2.3-x86-64-linux-binary.tar.bz2, and running sudo bash install.sh However, I was curious about how I would be able to uninstall it? It ...
3
votes
1answer
92 views

Is there a way to “stabilize” past built unstable Gentoo binary packages without rebuilding?

Here's the scenario: build some ~amd64 package versions on your binhost later those same package versions go stable in portage, so no version bumps involved even if packages are listed stable in ...
5
votes
2answers
9k views

What is Binary package? How to build them?

I want to get detail about binary package and run them on linux. I am running Debian base (Ubuntu/Linux mint) Linux os. How to build binary package from source? And can I directly download binary ...
4
votes
1answer
978 views

In emacs, is there a way to Hex edit/view a buffer without losing the undo info?

When I use hexl-mode in emacs, it discards the buffer's undo info. Is there another way to hex-edit the buffer and yet retain the undo info? If there is no alternative hex-editor, is there a ...
3
votes
2answers
27 views

How to set binary installed by package manager as default?

I installed a newer version of tcpdump via MacPorts and would like to make it the default binary. $ which -a tcpdump /usr/sbin/tcpdump /opt/local/sbin/tcpdump For now I set an alias, but that of ...
0
votes
0answers
14 views

Where exactly is page permissions set in fs/binfmt_elf.c?

As I understand that in linux, the ELF loader (binfmt_elf.c) is the one that loads a particular binary into memory. Usually data will be RW and code segment will be RE. But where exactly in the source ...
8
votes
2answers
843 views

Can hd and od replace each other?

hd and od are both dump viewers of binary content. Can hd be used wherever od is and vice versa?
1
vote
1answer
45 views

Find longest matching portion with in two binary files

Say I've got two binary files, each roughly 50MB, that may contain a digitally-identical portion. Is there an easy way to compare these two files, find the longest identical portion, and save that to ...
4
votes
2answers
77 views

How does grep decide that a file is binary?

I have a large utf-8 text file which I frequently search with grep. Recently grep began reporting that it was a binary file. I can continue to search it with grep -a, but I was wondering what change ...
10
votes
4answers
24k views

How to use bash script to read binary file content?

I want to read a character and then a fixed length of string (the string is not null terminated in the file, and its length is given by the preceding character). How can I do this in a bash script? ...
0
votes
1answer
98 views

What's the fastest way of writing 1s to a hard disk? [duplicate]

I'm currently writing 1s to a file using the following: tr '\0' '\377' < /dev/zero > /dev/sdb But this is a really slow method when I want to fill a 500GB disk. Is there a quicker way?
7
votes
2answers
4k views

Are there alternatives for `dd`?

What other tools should I use to read and write files with truncation, seeking and skipping. dd's command line options seem inconvenient and foreign and I don't like choosing between slow, but precise ...
21
votes
5answers
3k views

Generating a random password; why isn't this portable?

I want to generate a random password, and am doing it like so: </dev/urandom tr -dc [:print:] | head -c 64 On my laptop, which runs Ubuntu, this produces only printable characters, as intended. ...
4
votes
3answers
122 views

Handling NULL characters in shell

Is there a portable way of handling NULL characters in shell? A typical example would be splitting the output of find ... -print0 with shell (and shell only) either in a pipe or in a command ...
1
vote
2answers
47 views

Viewing Binary not Hex

Debian jess 64 Alright let me start out by saying this maybe a very stupid,uninformed question due to my lack of understanding of binary, but I guess that's what this site is for, questions. That ...
9
votes
5answers
22k views

Binary to hexadecimal and decimal in a shell script

I have a context where I need to convert binary to hexadecimal and decimal and viceversa in a shell script. Can someone suggest me a tool for this?
1
vote
0answers
589 views

How do I create generalized binary tarballs for SageMath?

I would like to create a generalized binary tarball (i.e., a tar-compressed archive that contains an executable shell script for a wide range of different Linux distributions. It must be first ...
0
votes
1answer
69 views

Grep all strings from several binary files into one txt file

I've decided to play around dumping all process memory of couple utilities in order to find out, how much trace of sensitive info an attacker could theoretically obtain from app's memory. I've found ...
2
votes
3answers
256 views

Split binary data of fixed byte offset by byte position?

I have binary data which I review by xxd -ps in hex format. I notice that the byte distance is 48300 (=805*60) bytes between two headers where the separator is fafafafa. There is the beginning of ...
4
votes
4answers
262 views

How can I convert two-valued text data to binary (bit-representation)

I have a text file with two (2) only possible characters (and maybe new lines \n). Example: ABBBAAAABBBBBABBABBBABBB (Size 24 bytes) How can I convert this to a binary file, meaning a bit ...
0
votes
3answers
260 views

is there a way to run a linux binary on OS X

Is there a way to run a linux binary in OS X? I tried to run a binary but it said it isn't executable.
2
votes
2answers
44 views

Workaround for busybox head that drops NUL from data

TL;DR: Latest busybox (1.23.2) provided head is buggy and will happily drop NUL characters in the provided data. Replacing the binaries is not an option. I'm using head -[nc] -X in my scripts, is ...
1
vote
2answers
195 views

ls or find option to exclude binary files

How can I list only files that aren't compiled code in the current directory? I'm reviewing the custom scripts and code on several HPUX and Linux servers before transferring them to a newer system. ...
2
votes
2answers
4k views

Convert binary mode to text mode and the reverse option

By the following way I convert a simple binary file into a text file od –t x1 Check.tar | cut –c8- > Check.txt What is the opposite way to convert the Check.txt to Check.tar as the original file ...
1
vote
1answer
1k views

unsquashfs fails

Debian 7.0, I extracted the firmware.bin image using binwalk. The extracted content is squashfs-root folder containing subdirectories, and a separate file.squashfs file. I tried unsquashfs this ...
6
votes
2answers
3k views

Can vim display ASCII characters only, and treat other bytes as binary data?

I already know vim -b, however, depending on the locale used, it displays multi-byte characters (like UTF-8) as single letters. How can I ask vim to only display ASCII printable characters, and ...
0
votes
0answers
258 views

How to use binaries in jailshell?

I'm offering jailshell (on CentOS- whm) access to someone in order to use the folder sync tool called Unison (Some sort of bidirectional rsync) That's for the background. Unison is installed, as ...
1
vote
2answers
332 views

How to obtain a plain (raw) binary dump of any file in Unix/Linux?

I have read many similar question on the Stack Exchange community but none of them address a 'clean' binary dump. I have used: xxd and sed combinations to try to obtain a clean binary dump from any ...
2
votes
2answers
6k views

How to enter non-ascii characters using hex or octal codes in vi

I'm trying to write a golfing library for postscript. But it needs to be condensed itself. So I need a convenient way to type-in arbitrary bytes within mostly ascii text. I know this can easily be ...
5
votes
3answers
13k views

Can xxd be used to output the binary representation of hex number , not a string?

I would like to generate a raw binary packet from hex in the command line for the purpose of testing a protocol. I'm hoping its simpler to do it this way than writing an aplication. Here is what ...
-2
votes
2answers
73 views

How can I identify if a binary file is set-user-ID? [closed]

In Linux, how can I identify if a binary file is set-user-ID? Can I use ls -l?
0
votes
1answer
270 views

How do i write a shell script so that when i compile my c++ program it will put the binary into the Binary Directory

I have a directory called Binary and bunch of source files: ./ ├── Binary/ ├── lesson02.cpp ├── lesson04.cpp └── lesson06.cpp when I compile the source code g++ lesson01.cpp -o lesson01 I want ...
8
votes
2answers
7k views

tr complains of “Illegal byte sequence”

I'm brand new to UNIX and I am using Kirk McElhearn's "The Mac OS X Command Line" to teach myself some commands. I am attempting to use tr and grep so that I can search for text strings in a regular ...
1
vote
1answer
510 views

How to install an Intel binary file on ARM?

I am trying to install a binary file, and I get the output as "Cannot install binary". When I did file .bin, the output is: c64plus-imglib_2_02_00_00_Linux-x86_Setup.bin: ELF 32-bit LSB executable, ...
6
votes
2answers
1k views

Cannot execute binary in NixOS - No such file or directory

I tried to install the current oracle jre on a VM running NixOS. Now the following happens: [michas@cc:~]$ tar xvzf jre-7u40-linux-x64.tar.gz |grep bin/java jre1.7.0_40/bin/javaws ...
11
votes
1answer
890 views

When can I edit strings in an executable binary?

I have an executable binary; let's call it a.out. I can see the binary contains strings $ strings a.out ... /usr/share/foo .... I need to change the string /usr/share/foo to /usr/share/bar. Can I ...