Skip to main content

Questions tagged [cut]

For questions pertaining to cut, a filter program which extracts fields or columns of each line of input. Use this tag for questions about cut itself or questions about issues arising from using the cut utility.

1 vote
6 answers
143 views

I need to isolate a certain substring from a grep command. A typical line inside $FILE would look like this: random text [random number]FIXEDTEXT more random text. I need to retrieve the random ...
weka's user avatar
  • 53
3 votes
3 answers
394 views

I have a Garmin Nuvi which uses OpenStreet maps. Garmin do postcodes, but is usually 2-3 years out of date for Scotland. OSM does not do British postcodes, but the Post office does, and it can be ...
user256787's user avatar
0 votes
1 answer
140 views

We have a ksh Script that is suppose to give the output as last day of the month but when ever we run it we get the below error: cut: fields are numbered from 1 Try ‘cut —help’ for more information, ...
ZyPH3R's user avatar
  • 3
1 vote
1 answer
97 views

last part of the command: | cut -d' ' -f3 output: 4 10 required format: 4,10 I'm guessing echo (and sort?) is to be used in some way, but I can't quite place my finger on it.
kesarling's user avatar
  • 159
1 vote
0 answers
39 views

I have a strange problem when trying to display logs on pfSense (and I can reproduce the same problem on Ubuntu server also). The problem is this (with examples): I'm trying to display a running dhcp ...
Artur Meinild's user avatar
0 votes
2 answers
103 views

I am getting an unexpected output from cut. I would expect no output since there is no third field based on the specified delimiter. The first two lines intentionally use commas as delimiters, and the ...
ayeieye's user avatar
0 votes
1 answer
264 views

Why the delimiter is still shown in the output? I thought field 2 and 4 would be shown without the - delimiter. How to use cut command to not show at the same time the delimiter itself used to ...
Faxopita's user avatar
  • 179
0 votes
3 answers
157 views

original file: a really really long name with spaces.ext target file: the same name.new-ext command: mv *part of the name that'll give a unique answer.ext $(echo $(ls -l | grep -i *.ext | cut -d ' ' -...
kesarling's user avatar
  • 159
4 votes
1 answer
1k views

Can someone explain why I cannot store the cut command in a variable?? user:~$ echo "foo bii doo" | cut -d ' ' -f 2 bii # as expected # now put cut command into a variable: user:~$ c="...
archygriswald's user avatar
-1 votes
2 answers
209 views

I have an application log file that also captures the execution time for each executed SQL statement, like below:- Sample logs: I 2023-11-15 07:18:00.743Z 1760463 37 ZVRwqItu6aw-b8eejMLI_gAAAAU 1@...
Arpit Jain's user avatar
1 vote
4 answers
603 views

I have a tsv file with tab-separated columns. I want to obtain the 5th column, which has space-separated values. Convert the space-separation to tab-separation and save as a new file. Attempt: cut -d&...
Anon's user avatar
  • 133
2 votes
2 answers
403 views

When I search for a list of packages, I usually use dpkg -l|grep string|cut -d" " -f3|xargs libdouble-conversion3:amd64 libestr0:amd64 libeval-closure-perl libio-stringy-perl libunistring2:...
rubo77's user avatar
  • 30.6k
0 votes
2 answers
223 views

The top answer to this question demonstrates that cut can be used with tr to cut based on repeated spaces with < file tr -s ' ' | cut -d ' ' -f 8 I want to get the remotes of several Git repos in ...
Anil's user avatar
  • 221
1 vote
2 answers
275 views

I have the following use case: echo "some comment char '\;' embedded in strings ; along with inline comments" \ | cut -d';' -f 1 I want: some comment char ';' embedded in strings I get: ...
Chris's user avatar
  • 1,087
0 votes
3 answers
853 views

ASK: to use cut command to list all users to confirm a successful useradd. ISSUE: The list was very long and I had to scroll through output to find user. NEED: Sort by the date the user was created. ...
VintageDroid's user avatar

15 30 50 per page
1
2 3 4 5
30