Saturday, September 11, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


USB not recognised

Posted: 11 Sep 2021 09:49 AM PDT

Hope someone can help, my apologies first as rather confused with Linux as a newbie having only just used Window to date. So her goes : I have a dual boot System Win 10/Linux Mint Cinnamon 20.2 just plugged in my USB but wasn't recognised. Did some research answer seemed to revolve around Gparted to create a partition table, partition and lastly format all in Gparted but couldn't even create partition table as below

Further research suggested the USB might be corrupted as full 16 Gb was never there only 10 showing. Needed to replace the partition table with a new one using fdisk see next screenshot

Then I should be able to make the filesystem EXT4 but it's still Unrecognised I done nothing and I've run of ideas not even to sure was on right path.

Please Help

zsh: interpret date in .zsh_history file

Posted: 11 Sep 2021 08:36 AM PDT

I have copied .zsh_history file from another session, and I want to inspect it. Normally, if I was inspecting my standard ~/.zsh_history file, I would just use the zsh built-in command history, where I can specify custom date format:

$ history -t '(%a) %Y-%b-%d %H:%M' 0  90  (Sat) 2021-Sep-11 17:24  cd ..  91  (Sat) 2021-Sep-11 17:24  ls  92  (Sat) 2021-Sep-11 17:26  run-help history  

The history command does not seem to have option to specify which file to read. I can simply cat the file, but then I see the non-human readable date format (epoch?):

: 1631327094:0;echo  : 1631340742:0;true  

How could I either interpret the history file using some zsh's function, or if not possible, how could I interpret this using some simple python script, so that I can see date format similar to my history example above.

E5105 in NeoVim in Debian 11

Posted: 11 Sep 2021 09:22 AM PDT

I have installed bufferline plugin on neovim using vim-plug with Plug 'akinsho/bufferline.nvim'. I should add require("bufferline").setup{} into my init.vim for keeping this plugin enable. When I do that, I get error below before neovim startup:

Error detected while processing /home/reza-main/.config/nvim/init.vim:  line   78:  E5105: Error while calling lua chunk: ...are/nvim/site/plugged/bufferline.nvim/lua/bufferline.lua:9: attempt to index field 'fn' (a nil   value)  

I use code below in my init.vim:

lua << EOF  require("bufferline").setup{}  EOF  

Version of my neovim: 0.4.4

OS: Debian 11

I install neovim plugins in ~/.local/share/nvim/plugged

Why I get this error and how can I solve it?

Timeshift broke my OS

Posted: 11 Sep 2021 07:22 AM PDT

I am a linux noob who is using Elementary OS. Recently I had to reinstall my OS in order to get the new version of elementary OS (Odin). I had a backup of my file made using deja dups (that I've recovered without any issue) and a backup of the system made with Timeshift. What happened is that, after having reinstalled Timeshift and told him to recover the last version of my system (all using timeshift default option which I thought were legit) the OS just stopped to work. After the reboot in fact the only thing I could see was a minimal terminal exactly like this one

I tried to use boot reipair but it didn't worked (it just failed to repair anything).

I had to access the boot menu and boot with windows, now I just reinstalled Elementary OS but i still didn't recovered the system using timeshift and I am afraid the issue will happen again. Also I am very curious about what happened and it seems a good way to learn new things about how linux works. Thank to whoever is going to help me!

How to setup :0.1 virtual display on-the-fly in X

Posted: 11 Sep 2021 09:28 AM PDT

I want to create a virtual monitor, add it to my current display as a seperate screen (In X sense) and share it over VNC. Now what I want to do is neatly described below in Arch Linux Wiki article on Multihead setup

This is the original way of configuring multiple monitors with X, and it has been around for decades. Each physical monitor is assigned as an X screen, and while you can move the mouse between them, they are more or less independent. Normally the X display has a single identifier such as :0 set in the DISPLAY environment variable, but in this configuration each screen has a different $DISPLAY value. The first screen is :0.0, the second is :0.1 and so on. With this configuration, it is not possible to move windows between screens, apart from a few special programs like GIMP and Emacs which have multi-screen support. For most programs you must change the DISPLAY environment variable when launching to have the program appear on another screen:

# Launch a terminal on the second screen  $ DISPLAY=:0.1 urxvt &  

Alternatively, if you have a terminal on each screen launching programs will inherit the DISPLAY value and appear on the same screen they were launched on. But moving an application between screens involves closing it and reopening it again on the other screen. Working this way does have certain advantages, such as windows popping up on one screen will not steal the focus away from you if you are working on another screen - each screen is quite independent.

Tl;dr: A display like :0.1

I have created virtual displays at past which are extenstion of current screen, with xrandr.

xrandr --newmode "1024x768_60.00"  64.11  1024 1080 1184 1344  768 769 772 795  -HSync +Vsync  xrandr --addmode VIRTUAL1 1024x768_60.00    xrandr --output VIRTUAL1   

The problem which arise that I need to pull the windows between monitors (Pull from actual monitor to VNC monitor). How can I specify to make the new display to be a new screen ? I want to do thing opposite to this question, inducing the "problem", so that windows open in same monitor it is called from.

Battery loses power even when connected to a good power source

Posted: 11 Sep 2021 06:40 AM PDT

I am running Arch linux on my Lenovo ideapad 320 with KDE as the GUI. My laptop is always connected to a good power source but for some reason it keeps losing power from the battery, i.e. 1% every 2 days. When I close all the applications and leave it charge, it does reach to 100%, so I'm not sure why it loses power in the first place.
I have TLP installed and enabled, so does anyone have any idea to fix this power problem? Or are there any certain packages I need to know about that drains the battery?

Here are some relevant info:

sudo tlp-stat  +++ System Info  System         = LENOVO Lenovo ideapad 320-15IKB 80XL  BIOS           = 4WCN47WW  Kernel         = 5.10.62-1-lts #1 SMP Fri, 03 Sep 2021 10:00:32 +0000 x86_64  /proc/cmdline  = root=UUID=e87279ed-e340-4301-b3de-ddf89b45fb3d rw initrd=\intel-ucode.img initrd=\initramfs-linux-lts.img loglevel=3 quiet  Init system    = systemd   Boot mode      = UEFI    +++ TLP Status  State          = enabled  RDW state      = not installed  Last run       = 16:04:16,    107 sec(s) ago  Mode           = AC  Power source   = AC    lscpu  Architecture:            x86_64    CPU op-mode(s):        32-bit, 64-bit    Address sizes:         39 bits physical, 48 bits virtual    Byte Order:            Little Endian  CPU(s):                  4    On-line CPU(s) list:   0-3  Vendor ID:               GenuineIntel    Model name:            Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz      CPU family:          6      Model:               142      Thread(s) per core:  2      Core(s) per socket:  2      Socket(s):           1      Stepping:            9      CPU max MHz:         3100.0000      CPU min MHz:         400.0000  

Thanks in advance :)

Virt-v2v VM conversion from esx 6.7 to OLVM 4.3 (ovirt) takes too long

Posted: 11 Sep 2021 06:16 AM PDT

Is it common, that the conversion process of a oracle Linux 7 VM to KVM takes about 30 minutes? I'm using rhv-upload so I have to use raw format, can't use qcow2, but after the conversion is done, the raw upload of the images takes hours per 100 GB. I don't get it? 10Gbe, SAN with SSD, 32 cores with 3 GHz base clock. CPU utilization is low. But throughput is about lousy 10 MB/s. Am I doing something wrong?

Grep a stream against a set of "correct" words?

Posted: 11 Sep 2021 06:18 AM PDT

I feel like this is a very basic question but I cannot figure out how to best accomplish this: I have a couple of documents (written in Latex) and I would like to run the program spell on them to generate a list of spelling errors:

spell -n -o *.tex | sort -k2 | uniq >misspelt.txt  

The problem of course is that there are some valid keywords that it thinks are spelt incorrectly, for example one such line from the file is:

...  /home/me/Documents/doc1.tex: documentclass  ...  

I was thinking if it would be possible to put words like documentclass into a file and incorporate that as part of the above command so that it is not counted as a misspelling?

Why doesn't Qemu boot my custom linux kernel?

Posted: 11 Sep 2021 05:40 AM PDT

I was watching this tutorial https://www.youtube.com/watch?v=awik6Iittu4 on building our custom linux os. The problem is that when I do qemu-system-x86_64 -hda image I get this output

enter image description here

And then it instantly reboots, in loop. What am I doing wrong? Is the tutorial old? Note that I didn't modify even one line of the kernel, I only did what the tutorial did.

I did this stuff on an Ubuntu x64 machine in VMware, and my main machine is Windows 10. What i did:

1 - sudo apt install build-essential musl-tools grub-pc-bin  2 - git clone https://github.com/MichielDerhaeg/build-linux  3 - cd build-linux/    (where the git cloned)  4 - git submodule init && git submodule update  5 - make -j4 image  6 - i said the command above  

AX_CHECK_X86_FEATURES for CXXFLAGS

Posted: 11 Sep 2021 05:56 AM PDT

The autoconf AX_CHECK_X86_FEATURES will test for -mavx, -mavx2, etc and add it to CFLAGS. What is the right way to propagate it to CXXFLAGS too? Is it "clean" to always add CFLAGS to CXXFLAGS? It doesn't seem so... But my C++ code contains some avx2 code, so I need this.

Why am I getting free(): invalid pointer? [migrated]

Posted: 11 Sep 2021 05:30 AM PDT

I am currently reading Linux System Programming by Robert Love and am stuck on the read() example that takes care of all five error cases. I am getting an free(): invalid pointer error. I am assuming that it has something to do with advancing the buffer in case the read is not finished.

It works if I store the offset and return the pointer to its original position. This is not mentioned in the book. Is there a better approach?

#include <stdio.h>  #include <malloc.h>  #include <unistd.h>  #include <fcntl.h>  #include <errno.h>  #include <string.h>    int main()  {        int fd;        if( (fd = open("someFile.txt", O_CREAT | O_WRONLY | O_TRUNC, 0664)) < 0)          perror("open for write");        char * text =  "This is an example text";      write(fd, text, strlen(text));        close(fd);        if( (fd = open("someFile.txt", O_RDONLY)) < 0)          perror("open");        char *buf;         if( (buf = (char *) calloc(20, sizeof(char))) == NULL )          perror("calloc");        int len = 50;      ssize_t ret;        /* If I store the offset in a variable it works */        offt_t offset = 0;        while (len != 0 && (ret = read (fd, buf, len)) != 0) {          if (ret == -1) {              if (errno == EINTR)                  continue;              perror ("read");              break;          }            len -= ret;          buf += ret;          offset += ret;  // Offset stored here        }        if( close(fd) == -1 )          perror("close");        buf -= offset;     // Here I return the pointer to its original position      free(buf);        return 0;  }      

Can't encode this string

Posted: 11 Sep 2021 06:10 AM PDT

I'm doing a simple exercise where copy a base64 encoded cookie value, and then make a few changes and then re-encode, and then use the result to log into a site as admin.

I have the following encoded string:

Tzo0OiJVc2VyIjoyOntzOjg6InVzZXJuYW1lIjtzOjU6ImRhZHNhIjtzOjc6ImlzQWRtaW4iO2I6MDt9   

I decode it like so:

$ echo Tzo0OiJVc2VyIjoyOntzOjg6InVzZXJuYW1lIjtzOjU6ImRhZHNhIjtzOjc6ImlzQWRtaW4iO2I6MDt9 | base64 --decode                       1 ⨯  O:4:"User":2:{s:8:"username";s:5:"dadsa";s:7:"isAdmin";b:0;}   

I then make a small change in order to be able to log in as admin:

O:4:"User":2:{s:8:"username";s:5:"dadsa";s:7:"isAdmin";b:1;}   

And them attempt to encode it again:

$ echo O:4:"User":2:{s:8:"username";s:5:"dadsa";s:7:"isAdmin";b:0;} | base64                                                    1 ⨯  zsh: parse error near `}'  

Which gives me a parsing error. I did this the other day, where this worked perfectly .

Why am i not able to encode this string?

Why isn't zsh printf respecting octal notation?

Posted: 11 Sep 2021 09:26 AM PDT

sh -c 'printf "%d " 024'  bash -c 'printf "%d " 024'  zsh -c 'printf "%d" 024'  

The above outputs 20 20 24. Why is zsh not respecting octal notation? Is there a way to change this?

Code works in bash, not in zsh -- flock on arbitrary fd

Posted: 11 Sep 2021 07:20 AM PDT

Am new to shell scripting, and it makes me wonder why the following snippet does not work in zsh but does in bash? Is there a zsh equivalent of the same snippet? I get error parse error near `200'

(     flock -e 200    echo "In critical section"    sleep 5   ) 200>/tmp/blah.lockfile   echo "After critical section"  

The above snippet of code is from src: https://stackoverflow.com/a/13551882/15087532

How to get only stdout_lines with Ansible using mail module

Posted: 11 Sep 2021 05:26 AM PDT

I'm using ansible to scan hosts with clam antivirus and I'm receiving reports via email. Reports contain everything and I want only to receive stdout lines. Is there any way to accomplish this? I wrote email template according to https://gist.github.com/halberom/0aea275632d2b47af0536e5def01d4d2 although only thing that is not the same is that I've piped to nice json:

The {{ host }} says {{ hostvars[host]['result']['stdout'] | to_nice_json }}  

The error I get is:

Unable to convert data using to_nice_json, falling back to to_json: 'dict object' has no attribute 'stdout'. the task includes an option with an undefined variable the error was ansible no_log:false

If I remove ['stdout'] then email report looks like this:

ClamAV scan was performed on host_server  {      "changed": true,      "msg": "All items completed",      "results": [          {              "ansible_loop_var": "item",              "changed": true,              "cmd": [                  "clamscan",                  "-r",                  "-i",                  "/usr/bin"              ],              "delta": "0:00:37.293719",              "end": "2021-09-09 18:47:55.626094",              "failed": false,              "invocation": {                  "module_args": {                      "_raw_params": "clamscan -r -i /usr/bin",                      "_uses_shell": false,                      "argv": null,                      "chdir": null,                      "creates": null,                      "executable": null,                      "removes": null,                      "stdin": null,                      "stdin_add_newline": true,                      "strip_empty_ends": true,                      "warn": true                  }              },              "item": "/usr/bin",              "rc": 0,              "start": "2021-09-09 18:47:18.332375",              "stderr": "",              "stderr_lines": [],              "stdout": "\n----------- SCAN SUMMARY -----------\nKnown viruses: 8563204\nEngine version: 0.103.2\nScanned directories: 1\nScanned files: 701\nInfected files: 0\nData scanned: 110.08 MB\nData read: 109.50 MB (ratio 1.01:1)\nTime: 37.113 sec (0 m 37 s)\nStart Date: 2021:09:09 18:47:18\nEnd Date:   2021:09:09 18:47:55",              "stdout_lines": [                  "",                  "----------- SCAN SUMMARY -----------",                  "Known viruses: 8563204",                  "Engine version: 0.103.2",                  "Scanned directories: 1",                  "Scanned files: 701",                  "Infected files: 0",                  "Data scanned: 110.08 MB",                  "Data read: 109.50 MB (ratio 1.01:1)",                  "Time: 37.113 sec (0 m 37 s)",                  "Start Date: 2021:09:09 18:47:18",                  "End Date: 2021:09:09 18:47:55 "              ]          }      ]  }  

Is there a way to accomplish getting only stdout_lines in my report? I tried with grep in the shell command but failed

CentOS 7: What is /bin/sh? It looks like Bash but seems to be something else

Posted: 11 Sep 2021 05:29 AM PDT

When I run a Centos 7 Docker Image like this

docker run -it centos:7 bash  

Running something which is uses Process Substitution is fine (as expected, as Bash supports Process Substitution since the beginning of time - Bash 1.4.x actually).

For example:

while IFS= read -r test; do echo $test; done < <(cat anaconda-post.log)  

But when I switch to /bin/sh the same code doesn't work anymore

/bin/sh  while IFS= read -r test; do echo $test; done < <(cat anaconda-post.log)  sh: syntax error near unexpected token `<'  

Although /bin/sh seems to be Bash

/bin/sh --version  GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu)  Copyright (C) 2011 Free Software Foundation, Inc.  License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>  

But then why doesn't process substitution work anymore? Other non-POSIX features seems to work, though

echo ${PATH//:/ }  /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin  

Can't update grub config inside a chroot [closed]

Posted: 11 Sep 2021 08:45 AM PDT

Edit: I asked for this to be deleted but it was closed instead..

I want to edit my GRUB config for a chrooted BTRFS system (/mnt/arch(/@)). I ran these commands:

> sudo chroot /mnt/arch/@/  > grub-mkconfig -o /boot/grub/grub.cfg  

But I got this error: /usr/bin/grub-probe: error: cannot find a device for / (is /dev mounted?).

How can I fix this?

Can you configure NGINX to redirect a HTTP request to SSH connection?

Posted: 11 Sep 2021 09:18 AM PDT

I have a server that is only accessible through a single port (I use a VPN with port forwarding). I have setup a reverse proxy using NGINX for some HTTPS servers that I'm hosting.

I'm wondering if I can do something similar where I can specific a location and it redirects to a LAN IP with the ssh port 22.

location /ssh/ {    proxy_pass      192.168.1.44:22;  }  

I know proxy_pass only works for HTTP, but I'm wondering if there is something that would work for ssh.

Cannot generate proper RSA keys using openssl genpkey utility with RSA-PSS option

Posted: 11 Sep 2021 06:00 AM PDT

I am trying to create an RSA key using openssl on Linux and then converting it to PuTTY format so that I can use it from my Windows PC as well.

openssl genpkey -algorithm RSA-PSS -out myKey.pem -outform PEM -pkeyopt rsa_keygen_bits:2048

Key is generated. I cat it, looks ok.

Now convert it to PuTTY format:

puttygen myKey.pem -o myKey.ppk -O private

I get following error:

puttygen: error loading 'myKey.pem': unrecognised key type

I tried to check the key using the following command:

openssl rsa -in myKey.pem -text

I get following error:

140527068488128:error:0607907F:digital envelope routines:EVP_PKEY_get0_RSA:expecting an rsa key:../crypto/evp/p_lib.c:464:

Any idea what's going on?

How to install Kali Linux from live desktop?

Posted: 11 Sep 2021 09:38 AM PDT

I need to install Kali from live desktop, but I can't find the installer. Any idea what I should do?

`du -sh` and `du -sb` gives different result when file being accessed?

Posted: 11 Sep 2021 07:04 AM PDT

I set up a file server with samba and I'm copying files to it from another computer under the same LAN. I set up SSH server and connected to it with my phone to monitor the process.

This is what I run on my phone in OpenSSH client (the server has GNU Core Utilities installed):

# while :; do du -sh /media/samba; sleep 1; done  288M    /media/samba  289M    /media/samba  290M    /media/samba  ...  ^C  # while :; do du -sb /media/samba; sleep 1; done  328267292       /media/samba  328267292       /media/samba  328267292       /media/samba  ... ...  (repeated ~30 times)  361334588       /media/samba  361334588       /media/samba  ... ...  (repeated ~30 times)  403280532       /media/samba  403280532       /media/samba  ^C  #  

The computer (running Windows 10) reports a transfer speed of approx. 1000KB/s and all files are 30~35 MB in size.

From my observation, du is reporting file size with -h, but "occupied space" with -b.

So why does du report different sizes when a file is growing?
How does du handle options -h and -b?

How can I have systemd execute a script only if a service was stopped via systemctl, but not execute if it crashed by itself?

Posted: 11 Sep 2021 09:04 AM PDT

What I am looking for, is the equivalent of the pre-stop stanza in upstart, for systemd

GNU/Linux: "device mapper: create ioctl failed" "device or resource busy"

Posted: 11 Sep 2021 08:00 AM PDT

I can't mount my encrypted devices anymore.

The error is:

device mapper: create ioctl failed   device or resource busy  

This error arises both with two different programs to access TrueCrypt encrypted devices: TrueCrypt and Tc-play.

In this case, the recommendation is to remove /dev/mapper/truecrypt* directories, or look for processes that are blocking the device. However, there is no /dev/mapper/truecrypt* directory, and lsof returns nothing.

One TrueCrypt device takes a whole HDD. According to fdisk, this partition is formatted with HPFS/NTFS.

Another TrueCrypt device is on a partition on /dev/sda. According to fdisk, this partition is "Linux" (ext3 or ext4, if I remember correctly).

What could be causing the error?

Software:

  • Debian GNU/Linux 6

Interpreting output of dmesg and /var/log/boot.log

Posted: 11 Sep 2021 09:34 AM PDT

I found two ways for printing boot messages one using dmesg and another the content of file /var/log/boot.log:

The content of the /var/log/boot.log file are:

 fsck from util-linux 2.20.1  /dev/loop0: clean, 263563/2271232 files, 7843644/18169856 blocks   * Starting configure network device security^[[74G[ OK ]   * Starting configure network device security^[[74G[ OK ]   * Starting configure network device^[[74G[ OK ]   * Starting Mount network filesystems^[[74G[ OK ]   * Starting Failsafe Boot Delay^[[74G[ OK ]   * Stopping Mount network filesystems^[[74G[ OK ]   * Starting Bridge socket events into upstart^[[74G[ OK ]   * Starting mDNS/DNS-SD daemon^[[74G[ OK ]   * Starting Userspace bootsplash^[[74G[ OK ]   * Starting Send an event to indicate plymouth is up^[[74G[ OK ]   * Starting bluetooth daemon^[[74G[ OK ]   * Starting configure network device^[[74G[ OK ]   * Stopping Failsafe Boot Delay^[[74G[ OK ]   * Starting System V initialisation compatibility^[[74G[ OK ]   * Starting set sysctls from /etc/sysctl.conf^[[74G[ OK ]   * Starting configure network device security^[[74G[ OK ]   * Starting modem connection manager^[[74G[ OK ]   * Stopping set sysctls from /etc/sysctl.conf^[[74G[ OK ]   * Starting CUPS printing spooler/server^[[74G[ OK ]   * Starting network connection manager^[[74G[ OK ]   * Stopping cold plug devices^[[74G[ OK ]   * Stopping log initial device creation^[[74G[ OK ]   * Starting configure network device security^[[74G[ OK ]   * Starting save udev log and update rules^[[74G[ OK ]   * Stopping save udev log and update rules^[[74G[ OK ]   * Stopping Userspace bootsplash^[[74G[ OK ]  Skipping profile in /etc/apparmor.d/disable: usr.bin.firefox  Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd   * Starting AppArmor profiles       ^[[170G  ^[[164G[ OK ]  speech-dispatcher disabled; edit /etc/default/speech-dispatcher  saned disabled; edit /etc/default/saned   * Stopping System V initialisation compatibility^[[74G[ OK ]   * Starting System V runlevel compatibility^[[74G[ OK ]  

while dmesg gives some thing like this:

[    0.008660] Initializing cgroup subsys blkio  [    0.008663] Initializing cgroup subsys perf_event  [    0.008667] Initializing cgroup subsys hugetlb  [    0.008713] CPU: Physical Processor ID: 0  [    0.008716] CPU: Processor Core ID: 0  [    0.008720] mce: CPU supports 4 MCE banks  [    0.008739] CPU0: Thermal monitoring enabled (TM1)  [    0.008746] process: using mwait in idle threads  [    0.008753] Last level iTLB entries: 4KB 64, 2MB 64, 4MB 64  [    0.008753] Last level dTLB entries: 4KB 64, 2MB 0, 4MB 64  [    0.008753] tlb_flushall_shift: 6  [    0.008895] Freeing SMP alternatives: 24k freed  [    0.011699] ACPI: Core revision 20121018  [    0.016015] ftrace: allocating 29358 entries in 115 pages  [    0.028544] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1  [    0.068468] smpboot: CPU0: Intel(R) Pentium(R) 4 CPU 3.00GHz (fam: 0f, model: 04, stepping: 09)  [    0.072000] Performance Events: Netburst events, Netburst P4/Xeon PMU driver.  [    0.072000] ... version:                0  

and so on

So my question how are the two related? When should we use demsg and when boot.log?

How do I change the default text editor in the Debian (squeeze) distro

Posted: 11 Sep 2021 09:12 AM PDT

"Joe's own editor" does not come naturally to me. How do I change to using nano or vim?

I've tried

export EDITOR=nano  

but it doesn't seem to be respected. I'd like visudo to respect this as well.

What is "Print to File" and can it be used from command line?

Posted: 11 Sep 2021 05:29 AM PDT

When you select "Print to File" in a Gnome print dialog (not cups-pdf):

print-to-file

... what is the actual command that gets executed? (I'm interested in the postscript variant, as on the image)

On the other hand - maybe there isn't a command call; maybe it is gtk_print_operation_set_export_filename from The new Gtk+ Printing API?

In any case - is there a way for me to utilize this particular code from the command line (not pdf2ps and the like)? Say, by using lpr to "print to file" to a postscript file - as if I was using the dialog above?

No comments:

Post a Comment