Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

203 votes
7 answers
181338 views
How to do I convert an animated gif to an mp4 or mv4 on the command line?
What command would I use to convert an mp4 or mv4 video file to an animated gif, and vice versa. That is, convert a animated gif to a mp4 or mv4.
What command would I use to convert an mp4 or mv4 video file to an animated gif, and vice versa. That is, convert a animated gif to a mp4 or mv4.
stinkypyper
Jun 12, 2012, 08:54 PM • Last activity: Aug 3, 2025, 06:14 PM
0 votes
1 answers
3086 views
Convert non-RAID disk with data into RAID 1 disk (hardware controller)
I moved away from software RAID due to all the hassle it brings. After an OS reinstall, I am left with only one drive. I ordered a hardware RAID controller today, and when the controller arrives, I'd like to plug in the identical drives into the RAID controller and set up RAID 1 WITHOUT losing...
I moved away from software RAID due to all the hassle it brings. After an OS reinstall, I am left with only one drive. I ordered a hardware RAID controller today, and when the controller arrives, I'd like to plug in the identical drives into the RAID controller and set up RAID 1 WITHOUT losing any data or needing to reinstall the OS (Debian Jessie x86_64). Output of lsblk:
NAME              MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                 8:0    0 931.5G  0 disk
├─sda1              8:1    0   953M  0 part /boot
├─sda2              8:2    0  29.8G  0 part [SWAP]
└─sda3              8:3    0 900.8G  0 part
  ├─vgmain-lvroot 254:0    0 621.4G  0 lvm  /
  ├─vgmain-lvmail 254:1    0  93.1G  0 lvm  /var/vmail
  ├─vgmain-lvhome 254:2    0  93.1G  0 lvm  /home
  ├─vgmain-lvtmp  254:3    0  18.6G  0 lvm  /tmp
  └─vgmain-lvvar  254:4    0  74.5G  0 lvm  /var
sdb                 8:16   0 931.5G  0 disk
Can I do this somehow by dding the existing data to the clean drive while having it plugged into the RAID controller and set up as RAID 1? To clarify, let's say sda is the drive with my data, sdb is the drive which is not in use. * Plug sda into the mobo sata controller * Plug sdb into the RAID controller * Define sdb as RAID 1 drive * Boot from liveCD and dd contents of sda → sdb * Plug sda into RAID controller, define as RAID1 * RAID controller syncs the drives, (copies over sdb to sda) (?) * Boot without problems? Will dd copy the drive in a way that mbr/partitions/etc. are preserved? Am I thinking in a completely stupid way of doing this? I contacted the RAID controller manufacturer and asked if it has some kind of utility to convert a drive into 2 drives in RAID1, but they said no. If it's relevant in any way, the specific controller is a HighPoint RocketRAID 620 PCI-Express 2.0 x1 SATA III RAID card.
Axel Latvala (109 rep)
Jun 13, 2016, 04:12 PM • Last activity: Jul 25, 2025, 11:04 PM
2 votes
3 answers
2013 views
Convert SQLite CSV output to JSON
I want to format SQLite output in JSON format from the command line. Currently, I have CSV output that looks like this: label1,value1 label2,value2 label3,value3 ... Now I'd like to have it formatted like this: {'label1' : 'value1', 'label2': 'value2', ... } Thanks!
I want to format SQLite output in JSON format from the command line. Currently, I have CSV output that looks like this: label1,value1 label2,value2 label3,value3 ... Now I'd like to have it formatted like this: {'label1' : 'value1', 'label2': 'value2', ... } Thanks!
michelemarcon (3593 rep)
Jan 13, 2016, 03:45 PM • Last activity: Jun 12, 2025, 08:10 PM
4 votes
1 answers
2962 views
How to convert root filesystem to virtual disk format (img, vmdk or vdi)?
I unpacked the contents of a Mageia 6 ISO image, including a Linux root file system in it, and I've updated the root file system by chrooting into it and running `dnf update`. I also installed a few extra packages and I'd like to know how to turn the directory into a virtual disk format I can run in...
I unpacked the contents of a Mageia 6 ISO image, including a Linux root file system in it, and I've updated the root file system by chrooting into it and running dnf update. I also installed a few extra packages and I'd like to know how to turn the directory into a virtual disk format I can run in VirtualBox, or Virt Manager. If I can boot this root file system, without converting it to a virtual disk format, describing how I might manage this would also be an acceptable answer.
Josh Pinto (3533 rep)
Nov 4, 2018, 10:49 AM • Last activity: Jun 6, 2025, 05:01 AM
1 votes
2 answers
2120 views
Converting a TXT file to PDF from the command line using a custom font
I want to convert a UTF-8 txt file to PDF for printing with CUPS. The problem I'm facing is that all tools I've tried have either failed to format the PDF (resulting in a fully white document with no text) or ignored font options. I have also tried converting my text file to PostScript 1st (as sugge...
I want to convert a UTF-8 txt file to PDF for printing with CUPS. The problem I'm facing is that all tools I've tried have either failed to format the PDF (resulting in a fully white document with no text) or ignored font options. I have also tried converting my text file to PostScript 1st (as suggested in some previous answers to similar topics) but have faced issues with then printing the PostScript files with the added fonts. What I have tried: text2pdf (creates blank document when custom font specified) unoconv (fails to run with network error) LibreOffice CLI (no font parameters) enscript (initial PostScript conversion works however when then printing that PS or converting it to PDF the font reverts to courier) paps (PostScript conversion succeeds but font parameter seemingly ignored as file is the same regardless of what font you specify or whether or not it exists) pandoc (font options ignored)
psvg200 (11 rep)
Jun 26, 2023, 08:02 PM • Last activity: Jun 3, 2025, 02:04 AM
0 votes
2 answers
3666 views
How to convert BTRFS to bcachefs on Linux Mint and Linux Mint Debian Edition LMDE?
**2023-10-31, Bcachefs Merged Into The Linux 6.7 Kernel:** * https://www.phoronix.com/news/Bcachefs-Merged-Linux-6.7 * https://web.archive.org/web/20231103095158/https://www.phoronix.com/news/Bcachefs-Merged-Linux-6.7 **Manuals:** * https://manpages.ubuntu.com/manpages/impish/man8/bcachefs.8.html *...
**2023-10-31, Bcachefs Merged Into The Linux 6.7 Kernel:** * https://www.phoronix.com/news/Bcachefs-Merged-Linux-6.7 * https://web.archive.org/web/20231103095158/https://www.phoronix.com/news/Bcachefs-Merged-Linux-6.7 **Manuals:** * https://manpages.ubuntu.com/manpages/impish/man8/bcachefs.8.html * https://web.archive.org/web/20230205131951/https://manpages.ubuntu.com/manpages/impish * https://manpages.ubuntu.com/manpages/impish/man8/bcachefs.8.html * https://web.archive.org/web/20230205131951/https://manpages.ubuntu.com/manpages/impish **Mailing list:** * http://vger.kernel.org/vger-lists.html#linux-bcachefs The bcachefs management software bcachefs-tools are available by Application Management of Linux Mint 21 and actual Debian version, and consist follow related information: bcachefs migrate [options] device Migrate an existing filesystem to bcachefs -f fs Root of filesystem to migrate --encrypted Enable whole filesystem encryption (chacha20/poly1305) --no_passphrase Don't encrypt master encryption key -F Force, even if metadata file already exists bcachefs migrate-superblock [options] device Create default superblock after migrating -d device Device to create superblock for -o offset Offset of existing superblock **Source:** * https://web.archive.org/web/20230205130327/https://bcachefs.org/bcachefs-principles-of-operation.pdf **Remark:** I am looking for a answer now, which use the bcachefs-tools, gparted or comparable tools. The existing answer, to copy the data from old ext4 partition to a new bcachefs partition, are not what I am looking for.
Alfred.37 (129 rep)
Feb 9, 2023, 11:43 AM • Last activity: Jun 1, 2025, 01:07 PM
0 votes
2 answers
1914 views
img2pdf batch script
I currently have over 10K folders. Each folder has .png and .jpg images that need to be turned into .pdf files. Files are numerically in order already. I am looking for speed. I can currently cd into each folder and run img2pdf * -o out.pdf And I get a perfectly created out.pdf in less than a second...
I currently have over 10K folders. Each folder has .png and .jpg images that need to be turned into .pdf files. Files are numerically in order already. I am looking for speed. I can currently cd into each folder and run img2pdf * -o out.pdf And I get a perfectly created out.pdf in less than a second, even with several hundred images. My end goal is to automate this in a shell script that can be invoked, so each folder is basically turned into a .pdf file with the filename the same as the old directory like so Directory001/img001.jpg img002.jpg img003.jpg OtherDirectory/img1.png img2.png img3.png becomes Directory001.pdf OtherDirectory.pdf while only use img2pdf to do this, as it is by far the fastest way create the pdfs. I have some simple bash experience, but only with simple one liners (like turning all directories to zips). I know this can be done, but have no idea where to begin.
lolimans (1 rep)
Feb 17, 2019, 03:00 PM • Last activity: May 22, 2025, 11:07 AM
2 votes
1 answers
2766 views
alien conversion from deb to rpm on fedora 27
I find myself unable to convert a .deb package to .rpm to install it on fedora. I am not able to download the equivalent rpm file, so conversion is my only way out. I get this error after using the prompt alien -r package.deb as su. Package build failed. Here's the log of the command (cd shadow-beta...
I find myself unable to convert a .deb package to .rpm to install it on fedora. I am not able to download the equivalent rpm file, so conversion is my only way out. I get this error after using the prompt alien -r package.deb as su. Package build failed. Here's the log of the command (cd shadow-beta-0.8.62; rpmbuild --buildroot='/home/user/shadow/shadow-alpha-artful(1)/shadow-beta-0.8.62' -bb --target x86_64 'shadow-beta-0.8.62-2.spec'): Fehler: Zeile 5: Leerer Tag: Summary: Für folgende Zielplattform(en) wird gebaut: x86_64 Edit: I am unable to follow the suggestions in the answers. How can I edit a file that is not even generated because the conversion failed?
Ijusthaveatinyquestion (21 rep)
Dec 24, 2018, 01:57 AM • Last activity: May 1, 2025, 09:02 AM
2 votes
1 answers
3419 views
Migrate from thunderbird to sylpheed while preserving folder structure
Is there an automatic way migrate a `thunderbird` mailbox to `sylpheed` while preserving the folder structure. I tried the importexport extension for `thunderbird` and got a directory with multiple mbox files and subfolder which contain again mbox file. For example inbox1 inbox2 foo.sdb foo1inbox1 f...
Is there an automatic way migrate a thunderbird mailbox to sylpheed while preserving the folder structure. I tried the importexport extension for thunderbird and got a directory with multiple mbox files and subfolder which contain again mbox file. For example inbox1 inbox2 foo.sdb foo1inbox1 foo2inbox1 foofoo.sdb foofoo1inbox1 foofoo1inbox2 foo2.sdb foo2inbox1 foo2inbox2 Sure I can import manually every single mbox file with sylpheed, but is there an automatic way to import all at once and preserve the folder structure?
student (18865 rep)
Aug 21, 2012, 02:07 PM • Last activity: Apr 19, 2025, 04:04 AM
19 votes
3 answers
12478 views
Why can I not split a .ape file?
I would like to split a `.ape` album into individual tracks in `.flac` format using a `.cue` sheet. For this I followed a [tutorial][1] I found. In short I pass this command to the terminal: cuebreakpoints example.cue | shnsplit -o flac example.ape But I get the following error back: shnsplit: warni...
I would like to split a .ape album into individual tracks in .flac format using a .cue sheet. For this I followed a tutorial I found. In short I pass this command to the terminal: cuebreakpoints example.cue | shnsplit -o flac example.ape But I get the following error back: shnsplit: warning: failed to read data from input file using format: [ape] shnsplit: + you may not have permission to read file: [example.ape] shnsplit: + arguments may be incorrect for decoder: [mac] shnsplit: + verify that the decoder is installed and in your PATH shnsplit: + this file may be unsupported, truncated or corrupt shnsplit: error: cannot continue due to error(s) shown above Unfortunately I don't know how to overcome this issue. One thing I think can be discarded is the file being corrupt since I had the same error with another .ape and I have followed this procedure with origin .flac files with no problem. How can I solve this problem?
Chris Daniels (191 rep)
Nov 2, 2014, 02:59 AM • Last activity: Apr 18, 2025, 08:51 PM
42 votes
8 answers
11627 views
Convert between Unicode Normalization Forms on the unix command-line
In Unicode, some character combinations have more than one representation. For example, the character *ä* can be represented as * "ä", that is the codepoint U+00E4 (two bytes `c3 a4` in UTF-8 encoding), or as * "ä", that is the two codepoints U+0061 U+0308 (three bytes `61 cc 88` in UTF-8...
In Unicode, some character combinations have more than one representation. For example, the character *ä* can be represented as * "ä", that is the codepoint U+00E4 (two bytes c3 a4 in UTF-8 encoding), or as * "ä", that is the two codepoints U+0061 U+0308 (three bytes 61 cc 88 in UTF-8). According to the Unicode standard, the two representations are equivalent but in different "normalization forms", see UAX #15: Unicode Normalization Forms . The unix toolbox has all kinds of text transformation tools, *sed*, *tr*, *iconv*, Perl come to mind. How can I do quick and easy NF conversion on the command-line?
glts (602 rep)
Sep 10, 2013, 06:47 PM • Last activity: Mar 22, 2025, 02:58 PM
2 votes
1 answers
2948 views
How to convert .bin-files to .iso-files fast?
I try to convert a `.bin` CD image file (with no `.cue`-file) of less than 800 MB with [`iat`][1] (Iso9660 Analyzer Tool v0.1.7) to an `.iso`-file on FreeBSD. With an AMD FX-8370 after 30 minutes `iat` still has not finished yet (`iat` uses one core with nearly 100% load). Is this normal? Is there a...
I try to convert a .bin CD image file (with no .cue-file) of less than 800 MB with iat (Iso9660 Analyzer Tool v0.1.7) to an .iso-file on FreeBSD. With an AMD FX-8370 after 30 minutes iat still has not finished yet (iat uses one core with nearly 100% load). Is this normal? Is there any way to make iat work faster? Or what other better alternative is there to convert .bin-files into .iso-files? I have multiple images to convert and I've never seen such a bad performance when handling large files. Decompression of an encrypted 20 GB archive takes less time.
viuser (2724 rep)
May 18, 2017, 02:52 AM • Last activity: Mar 3, 2025, 03:04 PM
7 votes
2 answers
2017 views
How to convert ęąśćżńł TXT to PDF with enscript?
I have problem converting a file to PDF. I create the file with echo ęąśćżńł > text and convert: enscript -O text -o - | ps2pdf - out.pdf However, `out.pdf` has an encoding problem: ![screenshot of corrupted pdf file][1] [1]: https://i.sstatic.net/ttQqp.png
I have problem converting a file to PDF. I create the file with echo ęąśćżńł > text and convert: enscript -O text -o - | ps2pdf - out.pdf However, out.pdf has an encoding problem: screenshot of corrupted pdf file
Miko (71 rep)
Apr 21, 2015, 01:34 PM • Last activity: Feb 19, 2025, 01:40 PM
4 votes
2 answers
8509 views
Convert json to csv with headers in jq
Is it possible to convert this json: ```json [ { "bytes": 276697, "checked": false }, { "bytes": 276697, "checked": false } ] ``` to a table WITH headers in jq? I've tried: ```sh cat file.json | jq '.[] | join(",")' ``` but it omits headers: ``` "276697,false" "276697,false" ``` it should be: ``` "b...
Is it possible to convert this json:
[
    {
        "bytes": 276697,
        "checked": false
    },
    {
        "bytes": 276697,
        "checked": false
    }
]
to a table WITH headers in jq? I've tried:
cat file.json | jq '.[] | join(",")'
but it omits headers:
"276697,false"
"276697,false"
it should be:
"bytes,checked"
"276697,false"
"276697,false"
I hoped that you can just run two commands:
cat file.json | jq '.[] | keys, .[] | join(",")'
but the second one fails:
"bytes,checked"
jq: error (at :64): Cannot iterate over null (null)
Ideally it would be simpler than this .
Daniel Krajnik (371 rep)
Aug 25, 2023, 05:23 PM • Last activity: Feb 3, 2025, 11:25 PM
1 votes
1 answers
103 views
Should we use convert or img2pdf for creating lossless multi-page PDF files out of gray PNM photocopies? And why?
Let's assume that you have 4 scanned pages, created by `scanimage -resolution 1200` and postprocessed by GIMP: each page was rotated so that the text lines were horizontal, the bled-through text was removed, and the margins were removed. You would like to losslessly create a single 4-page PDF docume...
Let's assume that you have 4 scanned pages, created by scanimage -resolution 1200 and postprocessed by GIMP: each page was rotated so that the text lines were horizontal, the bled-through text was removed, and the margins were removed. You would like to losslessly create a single 4-page PDF document out of the 4 pages. Here is what you tried:
$ sum_sofar=0; for file in $(for i in $(seq 1 4); do echo page_$i.pnm; done | xargs echo); do sum_sofar=$((sum_sofar + $(stat -c%s "$file"))); done; echo "The sum of the sizes of the PNM files is $sum_sofar bytes."
The sum of the sizes of the PNM files is 415300162 bytes.
$ convert $(for i in $(seq 1 4); do echo page_$i.pnm; done | xargs echo) -compress Zip -quality 100 -density 1200 tmp_output_document.convert.pdf && pdftk tmp_output_document.convert.pdf update_info  Producer:        https://imagemagick.org 
> CreationDate:    …
> ModDate:         …
16,17c16,17
 File size:       254364579 bytes
> Optimized:       no
(Above, you dropped the timestamps for simplicity.) Inspection with diffpdf reveals no differences. Both img2pdf and convert produce, in your understanding, lossless files, don't they? So why do the sizes differ by a factor of 254369508/201800756 ≈ 1,26 ? What does it mean that file created by img2pdf file is “optimized”, whereas the file created by convert is not? For lossless storage, which method is better: img2pdf or convert+pdftk, and how to use it properly™?
AlMa1r (1 rep)
Feb 2, 2025, 02:56 AM • Last activity: Feb 2, 2025, 08:10 PM
0 votes
1 answers
152 views
Convert (ImageMagick) ignores quality level setting when converting to webp in Mint 22
I've been using `convert` to recompress images to webp for publication. My command line is: convert -quality 70 input.jpg test.webp This works in Mint 20 (ImageMagick 6.9.10-23), but in Mint 22 (ImageMagick 6.9.12-98) the -quality flag seems to do nothing at all. Whether I say -quality 1 or -quality...
I've been using convert to recompress images to webp for publication. My command line is: convert -quality 70 input.jpg test.webp This works in Mint 20 (ImageMagick 6.9.10-23), but in Mint 22 (ImageMagick 6.9.12-98) the -quality flag seems to do nothing at all. Whether I say -quality 1 or -quality 99, I get the same result. However, -quality 100 produces a gigantic (I assume uncompressed image)
SurpriseDog (662 rep)
Dec 19, 2024, 10:41 PM • Last activity: Dec 19, 2024, 11:35 PM
64 votes
9 answers
96310 views
convert images to pdf: How to make PDF Pages same size
I did something like convert -page A4 -compress A4 *.png CH00.pdf But the 1st page is much larger than the subsequent pages. This happens even though the image dimensions are similar. These images are scanned & cropped thus may have slight differences in dimensions I thought `-page A4` should fix th...
I did something like convert -page A4 -compress A4 *.png CH00.pdf But the 1st page is much larger than the subsequent pages. This happens even though the image dimensions are similar. These images are scanned & cropped thus may have slight differences in dimensions I thought -page A4 should fix the size of the pages?
Jiew Meng (2523 rep)
Sep 3, 2011, 04:02 AM • Last activity: Dec 19, 2024, 04:49 PM
4 votes
1 answers
3978 views
Is there a way to check the losslessness of a FLAC file in Linux?
Let me explain my question with greater detail: I know `FLAC` is a lossless audio format **with respect to the original file;** this is, any piece of audio encoded with `FLAC` will be preserved completely. But say I got an CD album in `MP3` format (which is, of course, lossy) and then decide to re-e...
Let me explain my question with greater detail: I know FLAC is a lossless audio format **with respect to the original file;** this is, any piece of audio encoded with FLAC will be preserved completely. But say I got an CD album in MP3 format (which is, of course, lossy) and then decide to re-encode it in FLAC and give this "lossless" version to a friend. How does he/she know that the file received from me is not an exact copy of the CD album but a camouflaged lossy copy? I've read something about it and it seems there is some app for Windows which identifies this fake FLACs but I haven't found anything like that for Linux. So my question is: Is there a way to tell real FLACs from fake ones in Linux?
Carl Rojas (1139 rep)
Dec 29, 2014, 02:15 AM • Last activity: Dec 10, 2024, 12:25 PM
125 votes
7 answers
213741 views
Creating a GIF animation from PNG files
Is there a tool to create a `gif` animation from a set of `png` files? I tried the `convert` command from the [ImageMagick](http://www.imagemagick.org/) suite, but this doesn't always succeed. Also, I have several issues with this: 1. I can't tell what the progress is. 2. No matter what I try, the `...
Is there a tool to create a gif animation from a set of png files? I tried the convert command from the [ImageMagick](http://www.imagemagick.org/) suite, but this doesn't always succeed. Also, I have several issues with this: 1. I can't tell what the progress is. 2. No matter what I try, the -delay flag doesn't change the frame rate of the gif animation. 3. convert determines the frame order based upon the alphabetical order of the files names. This means that `name500.png will be placed right after name50.png and not after name450.png` I can fix this by adding 0's but this is annoying.
Yotam (2744 rep)
Nov 5, 2011, 06:01 PM • Last activity: Nov 15, 2024, 03:24 AM
4 votes
1 answers
1818 views
Ffmpeg problems on centOS 5.8 64 bit
I did install `ffmpeg` with `winff`, unsuccessfully when I try converting avi to x264, it says I don't have it. When I try to convert mp4 to Xvid I get `unknown encoder 'libxvid'`. It's like nothing really works except avi Msi compatible using `winff`. Can anyone help?
I did install ffmpeg with winff, unsuccessfully when I try converting avi to x264, it says I don't have it. When I try to convert mp4 to Xvid I get unknown encoder 'libxvid'. It's like nothing really works except avi Msi compatible using winff. Can anyone help?
dale (767 rep)
Apr 6, 2012, 04:55 PM • Last activity: Nov 9, 2024, 08:02 PM
Showing page 1 of 20 total questions