Editing lsblk output


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Editing lsblk output
# 1  
Old 09-12-2018
Hi,
why do you not use option -r of the command lsblk like this ? :
Code:
lsblk -ro NAME | grep -A1 -w "$DISK" |grep -v "$DISK"

Regards.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Grep mpath disk name from lsblk command

When I use lsblk | tail -1 | awk -F " " '{print $1}' command and if a disk is a multipath I get output as └─mpathe But i need only mpathe to be grepped as output.. Please help.. But It works well if the disk is not mpath (2 Replies)
Discussion started by: Priya Amaresh
2 Replies

2. Shell Programming and Scripting

Convert vi editing to text editing

Dear Guru's I'm using Putty and want to edit a file. I know we generally use vi editor to do it. As I'm not good in using vi editor, I want to convert the vi into something like text pad. Is there any option in Putty to do the same ? Thanks for your response. Srini (6 Replies)
Discussion started by: thummi9090
6 Replies

3. UNIX for Dummies Questions & Answers

Help with editing columns

Hi, I have large file with 3 columns and want to output the 1st and 2nd column only. However I want the 2nd column to be edited like this: 14.036 to fx14 (notice the number in fx14 comes from the first two digits of 14.036) BEFORE: aran24352 14.036 14.036 aran08740 07.034 07.032... (3 Replies)
Discussion started by: narachaid
3 Replies

4. Shell Programming and Scripting

input a file editing it, output it.

i have a file that contains such earthquake data, i want to write an AWK or SED script to input it and fix it (delete each section header delete some field, delete some blank lines and put ### instead of that) and at the end output it to a new file. here is my file: EventID Date (UTC)... (2 Replies)
Discussion started by: oreka18
2 Replies

5. Shell Programming and Scripting

Need help in editing a file

I have a file which has 10 million records in it. When am trying to edit the file with vi, the following error occurs: ~ ~ ~ ~ ~ ~ ~ ~ "file1" Value too large for defined data type Is there any way that I can edit this file without using vi? Any help would be really appreciated.... (8 Replies)
Discussion started by: bobby1015
8 Replies

6. Shell Programming and Scripting

substitution without editing

I have a script with 100's of lines in it. I want to edit the script with out manually openning it (with vi editor or some thing like that). Basically I want to do a substitution using regular expression (%s/G_/28_/i). Please let me know the best way to do this. (4 Replies)
Discussion started by: Lucky Ali
4 Replies

7. Shell Programming and Scripting

Question on vi editing

If I have a text file which I am editing with vi and I perform the following editing. :1,$s/\<green\>/blue/g Later I decide to replace all ocurance of blue to red, then instead of writing the above editing line is there a way to recall it and work on it, instead of repeating the entire editing... (1 Reply)
Discussion started by: Tirmazi
1 Replies

8. Shell Programming and Scripting

file editing

how to remove duplicate word in a file ? (2 Replies)
Discussion started by: mail2sant
2 Replies

9. Shell Programming and Scripting

file editing

hi experts, please help me in writting the script.. i have two files file1 and file 2 i have to write a script which will take input parameters as file1 and file2 file1: ...... 1 2 3 4 file2: ..... 1 2 output (6 Replies)
Discussion started by: subhendu81
6 Replies

10. UNIX for Dummies Questions & Answers

Hex editing

Hi, I am new to UNIX. I have a text file where each line ends on the hexadecimal character "0A". In the file there are some records that contain the Hex characters "0D0A" which I need to replace by Hex "20". Is there a simple way to do this? Regards, Swanie (3 Replies)
Discussion started by: Swanie
3 Replies
Login or Register to Ask a Question
LSBLK(8)						       System Administration							  LSBLK(8)

NAME
lsblk - list block devices SYNOPSIS
lsblk [options] lsblk [options] device... DESCRIPTION
lsblk lists information about all or the specified block devices. The lsblk command reads the sysfs filesystem to gather information. The command prints all block devices (except RAM disks) in a tree-like format by default. Use lsblk --help to get a list of all available columns. OPTIONS
-a, --all List all block devices. -b, --bytes Print the SIZE column in bytes rather than in human-readable format. -d, --nodeps Don't print device holders or slaves. For example "lsblk --nodeps /dev/sda" prints information about the sda device only. -D, --discard Print information about the discard (TRIM, UNMAP) capabilities for each device. -e, --exclude list Exclude the devices specified by a comma-separated list of major device numbers. Note that RAM disks (major=1) are excluded by default. -f, --fs Output info about filesystems. This option is equivalent to "-o NAME,FSTYPE,LABEL,MOUNTPOINT". The authoritative information about filesystems and raids is provided by the blkid(8) command. -h, --help Print a help text and exit. -i, --ascii Use ASCII characters for tree formatting. -m, --perms Output info about device owner, group and mode. This option is equivalent to "-o NAME,SIZE,OWNER,GROUP,MODE". -l, --list Use the list output format. -n, --noheadings Do not print a header line. -o, --output list Specify which output columns to print. Use --help to get a list of all supported columns. -P, --pairs Use key="value" output format. -r, --raw Use the raw output format. -t, --topology Output info about block device topology. This option is equivalent to "-o NAME,ALIGNMENT,MIN-IO,OPT-IO,PHY-SEC,LOG-SEC,ROTA,SCHED". NOTES
For the partitions are some information (e.g. queue attributes) inherited from parental device. AUTHORS
Milan Broz <mbroz@redhat.com> Karel Zak <kzak@redhat.com> SEE ALSO
findmnt(8), blkid(8), ls(1) AVAILABILITY
The lsblk command is part of the util-linux package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux/. util-linux April 2010 LSBLK(8)