CLI Magic: For geek cred, try these one-liners


 
Thread Tools Search this Thread
Special Forums News, Links, Events and Announcements UNIX and Linux RSS News CLI Magic: For geek cred, try these one-liners
# 1  
Old 07-23-2008
CLI Magic: For geek cred, try these one-liners

07-23-2008 01:00 AM
In this context, a one-liner is a set of commands normally joined through a pipe (|). When joined by a pipe, the command on the left passes its output to the command on the right. Simple or complex, you can get useful results from a single line at the bash command prompt.



Source...
Login or Register to Ask a Question

Previous Thread | Next Thread

2 More Discussions You Might Find Interesting

1. What is on Your Mind?

Those simple one liners

I wanted to say LOL and punch my face when I saw post#11 (where Don_Cragun even reduced the string manipulation with a simple regex) in the thread https://www.unix.com/shell-programming-scripting/220553-add-0-start-filename-2.html I mean, when things can be done with just a one liner, sometimes I... (6 Replies)
Discussion started by: ahamed101
6 Replies

2. Shell Programming and Scripting

awk - one liners

Guys, I have a requirement like this. A file has >5K records always. Separated by "|", it has 30 fields for each line. In some lines, I am getting an odd field. say, the 15th field is supposed to be 2 characters but comes in as >2. In this case, for resolving this I need to copy the value of... (6 Replies)
Discussion started by: PikK45
6 Replies
Login or Register to Ask a Question
PIPE(3) 						     Library Functions Manual							   PIPE(3)

NAME
pipe - two-way interprocess communication SYNOPSIS
bind #| dir dir/data dir/ctl dir/data1 dir/ctl1 DESCRIPTION
An attach(5) of this device allocates two new streams joined at the device end. X/data and x/ctl are the data and control channels of one stream and x/data1 and x/ctl1 are the data and control channels of the other stream. Data written to one channel becomes available for reading at the other. Write boundaries are preserved: each read terminates when the read buffer is full or after reading the last byte of a write, whichever comes first. Written data is buffered in kernel stream blocks. The writer will block once the stream is full, typically after 32768 bytes or 16 writes. The writer will resume once the stream is less than half full. If there are multiple writers, each write is guaranteed to be available in a contiguous piece at the other end of the pipe. If there are multiple readers, each read will return data from only one write. The pipe(2) system call performs an attach of this device and returns file descriptors to the new pipe's data and data1 files. The files are open with mode ORDWR. SEE ALSO
pipe(2) SOURCE
/sys/src/9/port/devpipe.c PIPE(3)