Sunday, May 9, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


Netflix and Linux and VM

Posted: 09 May 2021 10:07 AM PDT

I heard that Netflix needs PlayReady 3.0, Widevine, HEVC 10 bits de/encoder, HDCP 2.2... to play 4K/UHD contents

So I want to know if Linux support these technologies, and if Netflix support those Linux frameworks

I want to know too, if Linux can't, if a VM with W10 can support as is those technologies so Netflix can play 4K medias, or if it can with some pass-through

I know this question doesn't belong completely here but idk where it can belongs otherwise, considering that Netflix support place is the last place to ask that, considering that they don't want to hear about any non official method (and this is normal for a dev. to work hard and clean on supported method but not on unofficial ones). If you know better place doesn't hesitate to tell me

Script to print the name of all directories in a given path [closed]

Posted: 09 May 2021 08:03 AM PDT

I want to write a script that takes an argument. the argument is a path.this script will print the name of every directory in the path and it will also count the number of the objects in every directory (directories or files).

Is there a Linux input event code that represents a "click"?

Posted: 09 May 2021 07:40 AM PDT

I'm configuring my Logitech MX Anywhere with logiops and I remember that I used to map one of the buttons to Ctrl+Click when I used my mouse in Windows, so I could quickly open a link in a new tab in my browser.

Now, the config file for this program requires users to inform a sequence of keys via their names in the input event codes. I tried searching for "CLICK", but there's only a SND_CLICK, which definitely isn't the one (especially when it's at the end of the file).

While no expert, I kinda expect it not to have a "click" event code: from what I infer the list relates only to actual physical keys available in keyboards. But would that be the case, is there an alternative to achieve a similar behaviour I'm aiming for with the input event codes?

Debugging "chroot: failed to load command '<executable_name>'" besides ldd and /proc/<pid>/maps

Posted: 09 May 2021 07:05 AM PDT

Trying to run rngd from rng-tools in a chroot environment on Raspberry Pi Zero.

Running ldd with the same chroot shows that all dependencies are satisfied:

pi@raspberrypi:~/rngd_chroot $ sudo chroot /home/pi/rngd_chroot/ ldd /sbin/rngd          libpthread.so.0 => /lib/libpthread.so.0 (0xb6f77000)          libc.so.6 => /lib/libc.so.6 (0xb6e29000)          /lib/arm-linux-gnueabihf/ld-linux.so.3 => /lib/ld-linux-armhf.so.3 (0xb6fa1000)  

The actual libraries used by a running non-chroot instance of the same rngd executable are also under the chroot folder:

pi@raspberrypi:~/rngd_chroot $ ps -aux | grep rngd  root       262  0.0  0.3  27640  1432 ?        SLsl 14:05   0:00 /usr/sbin/rngd -r /dev/hwrng  pi@raspberrypi:~/rngd_chroot $ sudo cat /proc/262/maps  00008000-00010000 r-xp 00000000 b3:02 20512      /usr/sbin/rngd  00010000-00011000 rw-p 00008000 b3:02 20512      /usr/sbin/rngd  0197c000-0197d000 rw-p 00000000 00:00 0          [heap]  0197d000-01981000 rw-p 00000000 00:00 0          [heap]  01981000-0199d000 rw-p 00000000 00:00 0          [heap]  b5400000-b5421000 rw-p 00000000 00:00 0  b5421000-b5500000 ---p 00000000 00:00 0  b55c0000-b55c1000 ---p 00000000 00:00 0  b55c1000-b5dc1000 rw-p 00000000 00:00 0  b5dc1000-b5dc2000 ---p 00000000 00:00 0  b5dc2000-b65c2000 rw-p 00000000 00:00 0  b65c2000-b65c3000 ---p 00000000 00:00 0  b65c3000-b6dc3000 rw-p 00000000 00:00 0  b6dc3000-b6efb000 r-xp 00000000 b3:02 5239       /usr/lib/arm-linux-gnueabihf/libc-2.28.so  b6efb000-b6f0b000 ---p 00138000 b3:02 5239       /usr/lib/arm-linux-gnueabihf/libc-2.28.so  b6f0b000-b6f0d000 r--p 00138000 b3:02 5239       /usr/lib/arm-linux-gnueabihf/libc-2.28.so  b6f0d000-b6f0e000 rw-p 0013a000 b3:02 5239       /usr/lib/arm-linux-gnueabihf/libc-2.28.so  b6f0e000-b6f11000 rw-p 00000000 00:00 0  b6f11000-b6f28000 r-xp 00000000 b3:02 5412       /usr/lib/arm-linux-gnueabihf/libpthread-2.28.so  b6f28000-b6f37000 ---p 00017000 b3:02 5412       /usr/lib/arm-linux-gnueabihf/libpthread-2.28.so  b6f37000-b6f38000 r--p 00016000 b3:02 5412       /usr/lib/arm-linux-gnueabihf/libpthread-2.28.so  b6f38000-b6f39000 rw-p 00017000 b3:02 5412       /usr/lib/arm-linux-gnueabihf/libpthread-2.28.so  b6f39000-b6f3b000 rw-p 00000000 00:00 0  b6f3b000-b6f3d000 r-xp 00000000 b3:02 5217       /usr/lib/arm-linux-gnueabihf/libarmmem-v6l.so  b6f3d000-b6f4c000 ---p 00002000 b3:02 5217       /usr/lib/arm-linux-gnueabihf/libarmmem-v6l.so  b6f4c000-b6f4d000 r--p 00001000 b3:02 5217       /usr/lib/arm-linux-gnueabihf/libarmmem-v6l.so  b6f4d000-b6f4e000 rw-p 00002000 b3:02 5217       /usr/lib/arm-linux-gnueabihf/libarmmem-v6l.so  b6f4e000-b6f6e000 r-xp 00000000 b3:02 5130       /usr/lib/arm-linux-gnueabihf/ld-2.28.so  b6f7b000-b6f7d000 rw-p 00000000 00:00 0  b6f7e000-b6f7f000 r--p 00020000 b3:02 5130       /usr/lib/arm-linux-gnueabihf/ld-2.28.so  b6f7f000-b6f80000 rw-p 00021000 b3:02 5130       /usr/lib/arm-linux-gnueabihf/ld-2.28.so  bebb6000-bebd7000 rw-p 00000000 00:00 0          [stack]  becab000-becac000 r-xp 00000000 00:00 0          [sigpage]  ffff0000-ffff1000 r-xp 00000000 00:00 0          [vectors]  

pi@raspberrypi:~/rngd_chroot $ sudo find . | grep -v -e "/dev/" -e "/sys/" -e "/proc/"  .  ./sbin  ./sbin/rngd  ./usr  ./usr/share  ./usr/share/lintian  ./usr/share/lintian/overrides  ./usr/share/lintian/overrides/rng-tools  ./bin  ./bin/rngtest  ./bin/sh  ./bin/bash  ./bin/ldd  ./lib  ./lib/libarmmem-v6l.so  ./lib/libpthread.so.0  ./lib/ld-linux-armhf.so.3  ./lib/ld-2.28.so  ./lib/libtinfo.so.6  ./lib/libc.so.6  ./lib/libc-2.28.so  ./lib/libtinfo.so.6.1  ./lib/libpthread-2.28.so  ./lib/libdl.so.2  ./lib/libdl-2.28.so  ./sys  ./dev  ./var  ./var/run  ./proc  

But when attempting to run rngd with chroot I'm receiving this:

pi@raspberrypi:~/rngd_chroot $ sudo chroot /home/pi/rngd_chroot/ /sbin/rngd  chroot: failed to run command '/sbin/rngd': No such file or directory  

Just to demonstrate that I have a valid rngd executable there running it without chroot:

pi@raspberrypi:~/rngd_chroot $ sudo sbin/rngd  can't lock /var/run/rngd.pid, running daemon's pid may be 262  

Any suggestions how to debug this are appreciated

find files within a range of sizes [duplicate]

Posted: 09 May 2021 06:00 AM PDT

I tried to find files between 960 kibibytes and 1 mebibyte. I found that -1024k works, but -1M doesn't:

$ find --version  find (GNU findutils) 4.7.0  $ find /usr/share/doc/ -size +960k -size -1M -exec ls -l {} \;  $ find /usr/share/doc/ -size +960k -size -1024k -exec ls -l {} \;  -rw-r--r-- 1 root root 998042 Nov  3  2020 /usr/share/doc/libsane-common/sane-mfgs.html  -rw-r--r-- 1 root root 1000769 Apr 21 10:15 /usr/share/doc/openjdk-11-jre-headless/api/index-files/index-20.html  -rw-r--r-- 1 root root 999431 Jul 17  2020 /usr/share/doc/openjdk-14-jre-headless/api/index-files/index-20.html  -rw-r--r-- 1 root root 1033381 Apr 21 12:46 /usr/share/doc/openjdk-8-jre-headless/api/java/io/class-use/IOException.html  k  

Can someone explain why -size -1M doesn't display the same files that -size -1024k does?

How to use multiline modifier of ssed (Super sed)?

Posted: 09 May 2021 09:23 AM PDT

I came across this tool called ssed which supports Perl's regex mode and is a heavily enhanced version of sed: https://launchpad.net/ssed/

This command does not seem to work:

printf 'a\nBc\n' | ssed -R 's/a(?m)\nBc\n/X\n/'  

I expected the output to be:

X  

But it prints:

a  Bc  

I know I can use perl for multiline processing but I want to currently explore the option available with ssed.

EDIT: This is from the launchpad page:

(7) Perl-style regular expressions, with examples. Use the -R switch.      Used in /addressing/ or the FIND side of s/// commands.      (?i)abc - case-insensitive match of abc, ABC, aBc, ABc, etc.    ab(?i)c - same as above; the (?i) applies throughout the pattern    (ab(?i)c) - matches abc or abC; the outer parens make the difference!    (?m) - multi-line pattern space: same as "s/FIND/REPL/M"  

Note: I am trying to simulate this perl command

 seq 10 | perl -p0e 's/\n/:/g'  

Output:

1:2:3:4:5:6:7:8:9:10:  

Difference between time functions of unix and windows [closed]

Posted: 09 May 2021 05:26 AM PDT

Why does Unix have a lot of time functions as opposed to Windows, which does not have a library like unistd.h?

Ubuntu does not wake after suspend but restarts

Posted: 09 May 2021 06:41 AM PDT

I really love Linux and I'm trying to make the switch to Linux-only, however there is one problem that's driving me nuts. If I try to wake my PC after suspending it, 9/10 times it will just restart. This always happens when the computer is sleeping for more than 2 hours. I tried a ton of stuff I found on the internet (increasing swap file size, setting grub settings, doing stuff with gnome), to no avail. The hardware supports suspend according to pm-suspend check output. I've typed in so many random commands I kinda lost track of what I'm doing, so if someone could help, much appreciated!

Ubuntu is installed as dual boot with windows on a separate 500GB ssd drive. PC specs:

  • Ryzen 1600
  • 32 GB ram
  • Radeon RX580
  • Ubuntu version 20.04.2 LTS
  • Kernel version: 5.8.0-50

Edit: forgot to mention my swap partition (according to free) is 39 GB.

Does escaping `bash` aliases make any sense in any - not sourced and normally run - shell scripts?

Posted: 09 May 2021 09:20 AM PDT

Does escaping bash aliases make any sense in any - not sourced and normally run - shell scripts?


Consider the simplest situation with ls for which many users have re-defined its functioning with an alias (in .bashrc or .bash_aliases), e.g. like:

alias ls='\ls --color=auto --group-directories-first'  

And then suppose I call a shell script of mine containing a function, e.g. like:

list_sata_devices ()  {      \ls -1 /dev/sd?  }  

As you noticed I forced the original ls with \ls, but is there any need for this I wonder?


Of course, one could write it without using ls, e.g like:

list_sata_devices ()  {      printf '%s\n' /dev/sd?  }  

But I still hesitate what possible difference might there be.

Why Can Almost Any Desktop Run a Linux Image, but Most SBCs Need Their Own Variant?

Posted: 09 May 2021 10:12 AM PDT

If I want to install Ubuntu Desktop on my Laptop vs my Desktop, I can download the same image from Ubuntu's website, and this applies for nearly every Linux distro I've heard of.

I'm currently shopping for various Raspberry Pi alternatives, and I noticed that each of them requires their own OS. For example, Armbian has a download for every board they support. In the same vein, why wouldn't Raspbian work out of the box on an OrangePi? I can understand that you might need different images for armv6/armv7/armv8, but why does every SBC need their own image?

stuck at busy box, attempt to boot old linux at another partition

Posted: 09 May 2021 08:03 AM PDT

I have, and able to boot with arch linux with kernel 5.10.34 normally. I have older linux (linuxmint 20.1) on my sda6 with kernel 5.4.0-72 and 5.8.0-50. I am using grub-customizer. Kindly not answer with having live cd.

The strange thing is:

  • when i tried boot to my sda6 is, the /etc/fstab empty.
  • it stuck at busybox(initramfs) with , /init exist.
  • the exiting the initramfs resulting kernel panic not sync.

what i have tried:

  • using ridinit=/bin/sh (i missing the unix.stack q)
  • manually copy /etc/fstab from arch to /etc/fstab busybox

the old fstab before installing arch linux (manjaro).

detail about the busybox BusyBox v1.30.1 Ubuntu 1:1.30.1-4ubuntu6.3

run init: can't execute '': no such directory  kernel panic - not syncing: Attempted to kill init!  CPU 0 PID 1 Comm run-init Not Tainted 5.8.0-50 generic # 56~20.04.1-Ubuntu  call trace ommited: assuming just the panic that significant  

having said that, my question is how to creating permanent grub config so I am able to boot to my linuxmint properly?

Amend

executing ash init from initramfs resulting:

enter image description here

Thank you

Remove or change "Details" in debian

Posted: 09 May 2021 07:25 AM PDT

Debian 10, Gnome. VMWare Workstation 16.1.1

In the settings menu. The details you can find for Debian. See screenshot. Is there anyway to change these, remove the option or to remove certain categories of those details.

I'd much prefer removing the details option entirely too.enter image description here

Execute command for all rows with equal field content

Posted: 09 May 2021 05:57 AM PDT

I have a student csv file containing fields with student data and the mailadress of the teacher in charge at the end. I try to automatically send only one email to the teacher containing all his students (using sendemail). The mail part is no problem but i cannot get the data out of the csv they way I want it. The csv file is created daily and contains a different number of students every day.

aer,kdx,mail1  dke,kad,mail2  err,qqq,mail1  qpi,bcc,mail1  bkd,onk,mail2  kcc,mnb,mail3  

I tried to use awk and put all lines containing the same mailadress in an array but failed with that approach.

In this example it should send 3 mails. First containing

aer,kdx  err,qqq  qpi,bcc  

Second containing

dke,kad  bkd,onk  

Third containing

kcc,mnb  

Thanks for any hints

What is the command line to print the output below (use built-in function of toupper from awk)?

Posted: 09 May 2021 09:10 AM PDT

I have a text file which is a random file :

price.txt

orange  5   300 Florida  banana  7   500 California  apple   3   600 Maryland  grape   14  50  New Mexico  mango   30  1   Florida  tomato  45  100 California  melon   22  600 Texas  lemon   19  400 Florida  

and I want to print this like below; (the $1 is all capital letters and the others are same as original file.)

ORANGE  5   300 Florida  BANANA  7   500 California  APPLE   3   600 Maryland  GRAPE   14  50  New Mexico  MANGO   30  1   Florida  TOMATO  45  100 California  MELON   22  600 Texas  LEMON   19  400 Florida  

In this case , how do I command using awk "toupper" option?

How can I save variables in awk?

Posted: 09 May 2021 09:04 AM PDT

How can I print the filename and the result of 1/2*(a+b), where a is the 1st field of the 2nd line and b is the 1st field of the last line please? I do not know how to save the values into variables as constants. Many thanks

awk -v a=$(NR==2{print $1}) b=$(END(print $1)) '{print FILENAME, 1/2*(a+b)}' rv*.out   

file1

4 5 6  14545.5886 2 6  2 3 5  45457.5462 8 6  

file2

1 2   34441.4545 8  6 8  8 8   54447.4545 1  

Output for:

for file in test1.txt test2.txt; do       awk ' (NR==2){a=$1} END{print FILENAME, 1/2*(a+$1)}' "$file" >> stredni.txt;   done    test1.txt 7272.79  test2.txt 17220.7  

Desired result:

test1 30001.5674  test2 44444.4545  

how to remove penguins eggs icon from ufficio zero ufficiozero tropea

Posted: 09 May 2021 09:19 AM PDT

so i recently installed ufficio zero tropea and this weird penguins eggs icon keeps popping up every time i login or reboot. Does anyone know how to keep it deleted so it doesn't show up any more?

How to specify multiple .pws and .prepl files in ASPELL_CONF?

Posted: 09 May 2021 05:41 AM PDT

I'm trying to configure aspell version 3.1.20 to use the $XDG_CONFIG_HOME/aspell/ directory instead of ~/.aspell. According the the Arch Wiki, one can do so by setting the ASPELL_CONF environment variable to something like

"per-conf $XDG_CONFIG_HOME/aspell/aspell.conf; personal $XDG_CONFIG_HOME/aspell/en.pws; repl $XDG_CONFIG_HOME/aspell/en.prepl"  

However, I'm Brazilian and I regurlarly use aspell to check spelling in both English and Portuguese. In other words, I need to specify multiple .pws and .prepl files (one for each language). I tried doing something along the lines of

export ASPELL_CONF="per-conf $XDG_CONFIG_HOME/aspell/aspell.conf; personal $XDG_CONFIG_HOME/aspell/en.pws; repl $XDG_CONFIG_HOME/aspell/en.prepl $XDG_CONFIG_HOME/aspell/pt_BR.pws; repl $XDG_CONFIG_HOME/aspell/pt_BR.prepl"  

but I'm getting the following error messages:

$ aspell -l pt_BR check doc.txt  Error: Expected language "pt_BR" but got "en".    $ aspell -l en check doc.txt  Error: Expected language "pt_BR" but got "en".  

How do I specify .pws and .prepl files for multiple languages?

KDE Partition Manager asks for password upon opening, but GNOME Disks does not. Why is that?

Posted: 09 May 2021 07:05 AM PDT

The title basically says everything.

KDE Partition Manager asks for password after opening the app, but GNOME Disks does not ask for the password. It (Disks) can do basically everything without ever trying to elevate the privilege.

I have seen this in multiple distros: Ubuntu vs KDE neon, Fedora vs Fedora KDE, OpenSUSE Tumbleweed, etc.

How and why do they behave the way they do?

Unable to reposition monitors on Arch Linux with KDE Plasma

Posted: 09 May 2021 05:48 AM PDT

I recently installed Arch Linux (I have used it before), and installed KDE Plasma 5.21.3. I have an external monitor and it is physically higher than my laptop's screen, however, whenever i open settings (Display and Monitor > Display Configuration), it aligns the top edge of the displays together, which makes life very confusing, whenever I try to drag the monitor up, it decides to move the entire window instead of moving the actual screen, which means that I am unable to move the display up. Can someone please point out if this is a bug, or if not, then point out a workaround until it gets fixed, I've heard that something like this is possible using xrandr but not sure exactly how. Any help would be appreciated. I did not have this problem when using Debian, and also in Arch Linux late last year.

Specs:

  • KDE Plasma Version: 5.21.3
  • Qt Version: 5.15.2
  • Kernel Version: 5.11.10-arch1-1
  • OS Type: 64-bit
  • Graphics Platform: Wayland
  • Graphics Processor: Mesa Intel Iris Graphics 540

monitor layout settings

Regex matching comma-separated list of values, trailing comma not allowed

Posted: 09 May 2021 08:49 AM PDT

I want to match:

  1. aaa
  2. aaa,bbb
  3. aaa,bbb,ccc

But not a list with a trailing comma. My current regex:

(\w{3},?)+  

also matches lists with trailing commas (aaa,bbb,). I was thinking I could also do:

(\w{3})(,\w{3})*  

but that is rather ugly. My real regex is not matching 3-letter-words, but something bigger, and repeating the regex is ugly. How can this be fixed?

htop / top with specifying process name filter on the command line - at program startup?

Posted: 09 May 2021 09:01 AM PDT

I'm on Ubuntu 18.04. I'm already aware that I can start htop, and then hit F4 for filter, then type or paste a process name search query (say, gphoto2 for looking for gvfs-gphoto2-volume-monitor.service), and then htop filters the shown processes: if there is no such process, it shows nothing, if it starts later, htop shows it then.

Now, I would like to start htop with filtering already from the command line, say:

htop --filter="gphoto2"  

... and get the exact same behavior as if hitting F4 and typing in the terminal UI. This would be useful if integrating the command into, say, a tmux session.

I browsed through man htop, but unfortunately I cannot see such command line/option. Closest I've seen is -p, which as noted in how to show only processes *not* matching a filter? :

Something like

htop -p "$(pgrep -vfd, 'java|python')"  

This has the obvious disadvantage of not accounting for processes that start after htop starts running

So, is there a way to set up process name filtering on the command line at startup, such that it takes account for newly killed or spawned processes (as if hitting F4 in htops terminal UI) - for htop, or top, or any other similar program?

tail not working on mac terminal

Posted: 09 May 2021 10:06 AM PDT

Due to my lack of experience with script language, (shame for a Mac user) I have referred to several sources: link seemed resolved with ls *.extension | xargs -n 1 tail -n +2

This didn't for me, even after adding > merged.txt at the end, nor the following:

for f in *.txt  do      tail -n +2 $f >> /path/to/some/dir/with/files/file_name  done  

I also tried sed -e'1d' $FILE in replacement of the tail command. Didn't work.

tail -n +2 file_name.extension, cat LIN_1994-11_0100.txt | tail -n +2, awk 'FNR != 1' *.extension has no effect to the file.

I am uncertain if this has anything to do with the current issue. Or whether the link is related to the issue.

If anyone could find the reason for this problem or way out of it..would be majorly grateful. I have transferred this issue from another community here to receive more insight if I could.

Automatically install unmet build dependencies as detected by dpkg-checkbuilddeps

Posted: 09 May 2021 07:07 AM PDT

Is there a command that installs all the unmet build dependencies that dpkg-checkbuilddeps would list?

I tried to sed the output and give it to apt-get install, but it seems very hacky and for some reason didn't work in some environments.

sudo apt-get install --yes $(dpkg-checkbuilddeps | sed 's/([^)]*)//g' | sed 's/dpkg-checkbuilddeps:\serror:\sUnmet build dependencies://g')  

Is there a better way?

chroot with working directory specified

Posted: 09 May 2021 06:02 AM PDT

Say I want to write wrapper for chroot command with the possibility to set working directory otherwise preserving chroot semantics. Thus semantics should be:

chroot.sh <chroot-dir> <working-dir> <command> [arg]...  

My naive attempt is:

#!/bin/sh    chroot_dir=$1  working_dir=$2    shift 2    chroot "$chroot_dir" sh -c "cd $working_dir; $*"  

But this fails to correctly handle:

chroot.sh /path/to/chroot /tmp touch 'filename with space'  

I cannot figure out how it should be implemented correctly. Is it possible using bash only?

On my CentOS 6 system chroot command doesn't support setting working directory. Probably this is not true on other systems.

Can I download or upload file using CURL for file://///my_windows/test (non-http link)

Posted: 09 May 2021 05:53 AM PDT

I have a windows machine(Server 2012). I have a shared location in it restricted to my user id(\\my_windows\test). I have few files inside test folder. I want to upload or download files to this location using curl. Is this possible?

Whatever examples I saw till now has https or https as the url for Curl. I am able to open this network location in Mozilla with 'file://///my_windows/test'. I want to curl to this location. How do I do it or is there anyway that I can make this location to open with http url?

Thanks

Failed to request VPN secrets #3

Posted: 09 May 2021 07:37 AM PDT

I am using Arch Linux with Gnome and I want to use openconnect to connect to an VPN server. I can do this at the command-line without a problem, but I can't do this with Gnome; I get the following error:

NetworkManager[589]: <error> [1475998103.4381] vpn-connection[0x28a9530,dc5d3708-967d-4e50-90ac-d0c892fe8ab3,"nm-vpn-connection.c",0]: Failed to request VPN secrets #3: No agents were available for this request.  

The ArchLinux Wiki suggests to do:

ln -s /usr/lib/networkmanager/nm-openconnect-auth-dialog /usr/lib/gnome-shell/

but this also does not solve the problem.

The problem occurs when I click on connect; I am unable to activate the VPN connection with Gnome and NetworkManager.

Wine and Linux Security

Posted: 09 May 2021 09:07 AM PDT

I'm trying to understand what are the security implications/consequences of installing Wine. Does installing wine means that my Linux OS will be prone to "Windows" type of viruses and malware as well?


PS1: Wine is an implementation of Windows APIs for Linux, BSD, Solaris and Mac OS X - and therefore my concern.

PS2: I wanted to run Evernote that is why I'm considering installing wine.

Apply Colors to Terminal Output to highlight URL & Others

Posted: 09 May 2021 08:01 AM PDT

I am looking for a way to apply colors to highlight URLs (http://....) and IP @ in the output of a terminal command.

Example would be with a wget command for example where I would like to be able to output URLs in a particular color so that it is easier to read.

Best would be to be able to do the same for IP@ and other important info to standout.

I have been struggling with this for a while and not able to find a solution.

I use iTerm 2 on MAC with oh-my-zsh

screen command cannot find java executable

Posted: 09 May 2021 07:04 AM PDT

I'm trying to execute java from screen:

screen -S my-java-app -d -m 'java -jar -Xms512m -Xmx2048m my-java-app.jar'  

but seems that screen does not know the java command. Running java without screen works just fine.

java -jar -Xms512m -Xmx2048m my-java-app.jar  

I'm using RHEL5.

Is there a way to modify a file in-place?

Posted: 09 May 2021 06:40 AM PDT

I have a fairly large file (35Gb), and I would like to filter this file in situ (i.e. I don't have enough disk space for another file), specifically I want to grep and ignore some patterns — is there a way to do this without using another file?

Let's say I want to filter out all the lines containing foo: for example...

No comments:

Post a Comment