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
1answer
31 views

Cut Video with FFmpeg

I have a video 20 muminute long time, I want to cut the first 5 minutes and 5 minutes of video finally. I have to use commands like, can help me? I user commant here: ffmpeg -ss [start_seconds] -i [...
0
votes
1answer
13 views

how to filter text file on the basis another text file.

I have two text files . One is wordlist and another one is file to be filtered. I want to remove or delete all the lines or links from the file if the line has any word from word list anywhere in ...
-1
votes
1answer
19 views

How can I filter a list of files to download those that don't already exist?

I have downloaded some files into a folder, but the download was interrupted and not all the files were downloaded. I do not want to redownload the gigabytes-worth of files I already have; I now want ...
0
votes
1answer
45 views

How to `cut` (extract a subset of columns) a CSV file that contains quoted strings`

I have a CSV file and want to discard a couple of columns. So let's say this is a sample file: column a, column b, column c value a, value b, value c value a, "quoted, b", value c And now let's ...
0
votes
0answers
16 views

Convert list of Hardened Linux From Scratch packages into suitable format for md5sum -c

I'd like to create a file suitable for using with md5sum -c from this document: http://www.linuxfromscratch.org/hlfs/view/development/chapter03/packages.html I imagine this should be possible by ...
0
votes
1answer
119 views

How to echo only 1st line from 'curl' command output?

I'm trying to get only first line of the curl command output. (Sorry if this is confusing) Let's say, for an instance, i run simply: # curl http://localhost <!-- This is the hidden line i want to ...
0
votes
4answers
95 views

Which program I can edit video (cut some scenes) without increasing the video's size

I have a video: Input.mp4 - length: 29 min 6 sec - size: 120 MB I use Microsoft Movie Maker 2012 (Movie Maker is included in the Windows Essentials 2012 program suite), to cut some boring scenes and ...
-1
votes
2answers
418 views

cut: |: No such file or directory

while read line do echo $line calendar_date=$(cut -d\ -f1 $line) hr_of_day=$(cut -d\ -f2 $line) echo "...
1
vote
1answer
849 views

Error with command cut: the delimiter must be a single character

I am trying to run this command from console: # HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1` But got this error: Try `cut --...
0
votes
1answer
243 views

need to get average idle time using mpstat

I want to get average idle time of the server using mpstat. The problem I am having is %idle is not in same columns in all the versions of linux. example 1: [root@testserver ~]# mpstat 1 2 Linux 2....
0
votes
1answer
86 views

Piping a line of the file read with while read loop

I am trying to read each line of the file and then assign some parts of it to variables. A line itself is read as a variable so I need to process a variable input say for cat which seems to be ...
1
vote
1answer
65 views

Cut lies if delimeter doesn’t exist

For example: $ cut -d ' ' -f 2- <<< "example" example Why does cut lie to me telling me that “example” is the second delimeter and on. I want it to print "" since there is no second ...
1
vote
1answer
145 views

Cutting out two parts from the middle of a video with ffmpeg

I have two files, rec.avi and audio_edited.wav, and what I'm trying to do is take the parts 00:30:50–01:42:56 and 02:16:55–04:03:10 of each file, concatenate those and encode them into an WebM file. ...
1
vote
1answer
411 views

How to Extract Multiple substrings from Log FIle

I am trying to extract the timestamp and the number string in the URL called in an apache logfile that looks like this: 123.456.78.90 - - [16/Dec/2014:06:27:30 +0100] "GET /servlet/something....
1
vote
2answers
58 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: ......
1
vote
1answer
515 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
42 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
604 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
343 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
3k 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
5k 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
4k 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 ...
1
vote
1answer
2k 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
2k 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 ...