Top "Cut" questions

A Unix shell command that breaks input into fields, which can be selected for output, based on a delimiter.

How to split a string in shell and get the last field

Suppose I have the string 1:2:3:4:5 and I want to get its last field (5 in this case). How do I do …

bash split tokenize cut
Copy and paste content from one file to another file in vi

I am working with two files, and I need to copy a few lines from one file and paste into …

vim copy-paste vi cut
Use space as a delimiter with cut command

I want to use space as a delimiter with the cut command. What syntax can I use for this?

bash unix cut
How to find the last field using 'cut'

Without using sed or awk, only cut, how do I get the last field when the number of fields are …

linux bash cut
How can I remove the extension of a filename in a shell script?

What's wrong with the following code? name='$filename | cut -f1 -d'.'' As is, I get the literal string $…

bash shell sh cut gnu-coreutils
Loop through a comma-separated shell variable

Suppose I have a Unix shell variable as below variable=abc,def,ghij I want to extract all the values (…

shell loops unix for-loop cut
How to specify more spaces for the delimiter using cut?

Is there any way to specify a field delimiter for more spaces with the cut command? (like " "+) ? For example: In …

linux delimiter cut
How to make the 'cut' command treat same sequental delimiters as one?

I'm trying to extract a certain (the fourth) field from the column-based, 'space'-adjusted text stream. I'm trying to use the …

bash unix delimiter cut
Using cut command to remove multiple columns

given input echo 1,2,3,4,5,6,7,8,9,...100 If I want to cut columns 5 I can do cut -d, -f-4,6- what if I want …

bash cut
bash script use cut command at variable and store result at another variable

I have a config.txt file with IP addresses as content like this 10.10.10.1:80 10.10.10.13:8080 10.10.10.11:443 10.10.10.12:80 I want to ping every ip address …

bash variables loops ping cut