Linked Questions

24
votes
9answers
17k views

Grep lines but let the first line through [duplicate]

Consider the following output from df. Filesystem Size Used Avail Use% Mounted on /dev/sda1 23G 6.1G 16G 29% / udev 10M 0 10M 0% /dev tmpfs 397M 420K ...
0
votes
2answers
7k views

how to print ps header when using pipe in linux [duplicate]

how to print ps header when using pipe in linux this normal ps output $ ps -ef UID PID PPID C STIME TTY TIME CMD root 1 0 0 17:00 ? 00:00:02 /usr/lib/...
1
vote
1answer
340 views

Is there a way to append a header to a “grepped” output? [duplicate]

I have quite a large csv file (call it file.csv). It looks like this one: col1,col2,col3,... 1,2,3 1,2,5 ... So after doing something like this cat file.csv | grep "_some_pattern_" I receive only ...
1
vote
4answers
40 views

cat a file to show the 1st line and the grep queried value [duplicate]

I have this following structure in file.txt NTL|OPC|RN1|CNL|NUE|NUF|TPB|EIP 11212455464 |16384|55320| |2799819E405 | |2| ...
0
votes
1answer
110 views

Why doesn't this tee with process substitution produce the 1st and chosen lines? [duplicate]

What I want is printing the output the first line ( table head ) of ps aux and the grep result. After search, I come up with following. ps aux | tee >(head -1 > /dev/tty) | grep mongo But I ...
55
votes
11answers
42k views

sort but keep header line at the top

I am getting output from a program that first produces one line that is a bunch of column headers, and then a bunch of lines of data. I want to cut various columns of this output and view it sorted ...
11
votes
3answers
13k views

How do I use tee to redirect to grep

I don't have much experience of using tee, so I hope this is not very basic. After viewing one of the answers to this question I came across a strange beheviour with tee. In order for me to output ...
10
votes
2answers
5k views

A hidden process, what it is?

[root@datacenteronline ~]# ssh root@192.168.1.172 Last login: Wed Apr 17 09:55:45 2013 from 192.168.1.187 [root@localhost ~]# ls /proc/ | grep 2266 [root@localhost ~]# cd /proc/2266 [root@localhost ...
2
votes
1answer
504 views

Propose additional file descriptor “stdmeta” [closed]

I know that one can define additional file descriptors for ad-hoc use. However, I see real use for a "stdmeta" file descriptor that would be supported by common CLI tools. This file descriptor would ...
1
vote
1answer
44 views

How do I create a systemd scope for an already-existing process from the command line?

I have a machine running the cgroups v2 (unified) hierarchy, so systemd is responsible for managing all cgroups and delegation to the systemd user instance works. I'd like to perform resource control ...