cut is a Unix command line utility which is used to extract sections from each line of input.

learn more… | top users | synonyms

0
votes
0answers
13 views

How to cut video using ffmpeg [duplicate]

I have a video file of 2 hours, but I want to remove the time from 00:45:00 to 01:05:00 and from 01:50:00 to 02:00:00. How can I do that? Please help.
0
votes
2answers
46 views

How to retrieve a name from another file with a Bash script?

I would like to grab a name out of another predefined file and use it within my shell script. The file being read would be in ./docs/description.org and the format (a table in .org format) is: ...
0
votes
1answer
54 views

Cut - the delimiter must be a single character

I am trying to cut the information from a variable of a variable. I am using csh. Ex: setenv time \`date | cut -d ' ' -f 4\` echo $time setenv hour \`$time | cut -d \':\' -f 1\` echo $hour Output: ...
1
vote
1answer
32 views

Cutting input with cut or awk?

I'm basically trying to parse raw IRC input with a bash script, and I want to grab the messages, and nothing else. An example of what I'm trying to save is :user!~name@host.name PRIVMSG #channel ...
4
votes
2answers
318 views

Bash command substitution not working as expected

I'd like to view the last few lines of a file, but I want the columns aligned. Basically, I want to disable wordwrap. This is straightforward with: tail $FILE | cut -c -80 But I'm trying to ...
1
vote
1answer
165 views

Inconsistent results using cut on output of ls

I am struggling to understand why I get different output from the same command run on a single file in Terminal (Mac OS X 10.6.8) and run on more than one file. As I want to run the command in a bash ...
2
votes
3answers
1k views

In bash, how do I pass the while loops input to the cut command?

How do I pass the $line to the cut command properly in this loop? while read line do login= $(cut -d : -f 1) done < /etc/passwd I can't do $(cut -d : -f 1 $line) so what is the correct way? ...
1
vote
1answer
4k views

How to use cut command in UNIX?

I have a really large text file (~80 Million records/lines), where each record has 7 attributes. Between every attribute there is a tab. What I want to do is copy every third and last attribute/token ...
1
vote
5answers
3k views

How to grep column after second pipe

Example: 3|100|test@test.com|0|0|6:1,10,11,12,13,2,3,4,5,6,9|7:1,10,11,13,16,2,4,5,6,9| Expected view after grep: test@test.com
2
votes
1answer
2k views

Add character at certain position in line

I've encountered the following problem: I need to add space at certain position in each line, to transform data from ATOM 1 HT1 GLY 5 10.346 30.927 130.252 0.00 0.00 to (by adding ...
0
votes
1answer
1k views

GNU sort and git blame

Today I thought I was doing a simple operation: git blame file | sort -k 3 To get all the lines of file sorted by the date on which they were last changed. Unfortunately it doesn't seem to be ...
0
votes
2answers
990 views

chained commands to create directories on a remote server

To get rsync cronjob working, I need to first create the dir tree on the remote server before running rsync. The local directories shall mirrored (w/o content) to the remote server. I'm strugglying to ...