The tag has no usage guidance.

learn more… | top users | synonyms

0
votes
2answers
43 views

What can cause my shell to look like this? [duplicate]

I'm currently developing a home automation framework for my apartment. This involves getting JSON over Serial from an Arduino. When the JSON can't be parsed (usually only on startup) I log it as an ...
2
votes
1answer
6k views

“No such file or directory” on files that exist? [duplicate]

In the past day, I've found at least 4 binaries that say "bin-name: No such file or directory" when I try to run them. Even if I type part of the name and tab complete it, I get the same error. I'm on ...
0
votes
0answers
27 views

Directory became UNIX binary (OS X)

I recently fixed the file permissions of my home directory using System Recovery mode. But after rebooting I found that one directory had become a single unix binary. I have tried everything from ...
11
votes
3answers
546 views

How can I work with binary in bash, to copy bytes verbatim without any conversion?

I am ambitiously trying to translate a c++ code into bash for a myriad of reasons. This code reads and manipulates a file type specific to my sub-field that is written and structured completely in ...
1
vote
2answers
46 views

What's the POSIX way to read an exact number of bytes from a file?

Just hit this problem, and learned a lot from the chosen answer: Create random data with dd and get "partial read warning". Is the data after the warning now really random? Unfortunately ...
12
votes
5answers
25k 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?
3
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]"; ...
5
votes
3answers
100 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 ...
2
votes
2answers
73 views

Why does “head /bin/ls” reset the terminal

If you do something silly like cat /var/log/wtmp your terminal can get messed up as shown in the screenshot. I know there are a number of ways of fixing this. One of the ways not mentioned on that ...
3
votes
4answers
1k views

Fetching individual bytes from a binary file into a variable with bash

I need to make a fairly simple bash script to pull bytes one at a time from a binary file, send it out a serial port, and then wait for a byte to come back before I send the next one. This is ...
9
votes
3answers
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 ...
0
votes
1answer
16 views

Possible problems deleting /tools in LFS

I recently made a Linux From Scratch and now I want to delete the /tools directory. But before rushing through it, I ran ldd /bin/* | grep '/tools' Which gave me this liblzma.so.5 => ...
0
votes
1answer
23 views

Install Java 1.4.2 on recent Amazon Linux [duplicate]

I need Java 1.4.2 on a up-to-date Amazon Linux 2015.09 server. I've tried to install j2sdk-1_4_2_19-linux-ia64-rpm.bin. When I execute this file, I get an error message: line 442: ...
4
votes
4answers
6k views

Ubuntu vs. CentOS and Binary Compatibility

I am trying to install software that is built on CentOS 4.7. Do you know if it will also run in Ubuntu? I read CentOS is 100% binary compatible. Is the same true for the most recent version of Ubuntu? ...
3
votes
2answers
256 views

Alter certain bytes in many files

I need a large number of damaged .png files in order to test my project. To that end, I need to set all bytes from the 0x054-th to the 0xa00-th to 0. .png files contain chunks with checksums, I want ...
1
vote
1answer
17 views

Find all files (including libraries) a binary depends on

I'd like to find all files a binary depends on (including libraries, configuration files, basically all files referenced in the binary). I know, that you can find shared libraries with objdump, ldd, ...
26
votes
3answers
32k views

How to find binary executables within a directory

How do I list all binary executable files recursively within a directory? I use find command like this: find /mydir/mysubdir -executable -type f All executable files are listed (excluding ...
-2
votes
1answer
55 views

how to fix potentially infected binary files? [closed]

when I installed the updates on my computer (Ubuntu 14.04), I typed the password, thinking that it was asked for regular updating , but when I noticed some strange behavior and crash at this moment, I ...
0
votes
1answer
31 views

Convert line of ASCII file to binary packet for NetCat

I have an ASCII file, which looks like this: 36,36,0,1 36,36,0,2 ... What I want to do is to send every row of it as one binary TCP segment's payload with NetCat. To convert the number from file ...
32
votes
2answers
13k 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
642 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
107 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 ...
213
votes
5answers
40k 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
377 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
51 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
255 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
24k 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
37 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
123 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
60 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
52 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
223 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
312 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
96 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
11k 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
1k 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
30 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
16 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 ...
9
votes
2answers
931 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
58 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 ...
10
votes
4answers
25k 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
102 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?
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
152 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
51 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 ...
1
vote
0answers
1k 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
85 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
323 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
312 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
650 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.