Home » Unix » Page 5
Invert matching lines, NUL-separated

I’m writing something that deals with file matches, and I need an inversion operation. I have a list of files (e.g. from find . -type f -print0 | sort -z >lst), and a list of matches (e.g. from grep -z foo lst >matches), and now I want to invert this list.

Background: I’m sorta implementing something like

Using bind to read the current command line

I'm using bind -x to execute a script whenever a certain key sequence is pressed.

For example I have a script at /usr/local/bin/foo with the contents

echo foo

If I run bind -x '" ": /usr/local/bin/foo' then every time I press the space bar twice it echos "foo". So far so good.

What I want to

Concatenate contents from stdout and from file

How can we concatenate results from stdout (or stderr) and a file into a final file.

For example

ls -a | grep text1

concatenate with file2.txt into a final result (not file2.txt), without storing grep text1 to something intermediate such as grep text1 > file1.txt

Changing local from en_US.utf8 to en_US in RHEL 7

I'm installing "Red Hat Enterprise Linux 7.2 (Linux version 3.10.0-327.el7.x86_64 (mockbuild@x86-034.build.eng.bos.redhat.com) (gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC) ) #1 SMP Thu Oct 29 17:29:29 EDT 2015)"

I am trying to switch from LANG="en_US.UTF-8" to LANG="en_US" as we need to operate the OS in 8 bits ASCII mode.

I have tried to change

DE with maximally customized content

I want a (heavily) customized DE, not so much in its style as content aspects. I want a DE w/ minimal default content but full DE functionality, i.e. windows, desktop, icons, menu, application (launcher) panel and system tray. As is known, most distros may break if you remove some of their default applications; for the same reason, you shouldn't mix applications of different DEs. So the questio

dnf: additionaly install optional packages to already installed group?

I installed Group "XYZ" without optional packages.

How do I install the group with optional packages, without removing and reinstalling it?

How do you open Wireshark's Legacy (GTK) By Default?

I've recently updated Wireshark on OSX El Capitan from 1.12.0 to 2.0.0. The newer stable release uses the Qt interface instead of the old X11 but the new UI is a lot buggy for me and I want the old interface without downgrading. The release notes state that I have to install wireshark through Homebrew for GTK.

I've already brew install wireshark with gtk+3 support bu

question on sed command

so the command is :

echo "abc 123" | sed "s/[0-9]*/h/g"

and im getting output as

hahbhch h

how am i getting this output?

the output i expected it to be is abc h

which im getting by this command :

echo "abc 123" | sed "s/[0-9][0-9]*/h/g"

can someone explain this.. <

switching to ramdisk root

My application is to do a secure erase on my system disk (an SSD) using hdparm from a shell script. So my thoughts were:

  1. create a ramdisk
  2. copy the linux OS to the ramdisk
  3. unmount the original system drive
  4. do a secure erase

I created the ramdisk and mounted it, but when I do a pivot_root, it can't find any of the applications. I copied all

Getting rid of strange environment variable

Using Cygwin, I installed Environment Modules. Every time I run a module command, I get

init.c(718):WARN:165: Cannot set TCL variable '!::'

I've traced this down to the fact that Cygwin has the following environment variable set:

$ env | grep ::

Does anyone know what this is, where it is set, why it might be necessar

Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .