Questions tagged [cut]
cut is a Unix command line utility which is used to extract sections from each line of input.
49
questions
0
votes
1
answer
785
views
Displaying users and their home directory but NOT WITH awk
I have seen similar questions and I actually found the solution using awk command, but I'm not allowed to use it in my homework.
so I want to know if there is another way of displaying all the users ...
0
votes
1
answer
160
views
Insert new line if file contain string
I need to insert 'import packagename' to the line after imports. In files which contains the specific word.
What I try:
find iOS/Chat \
-type f \
-name "*.swift" \
-exec gsed -e "/...
0
votes
2
answers
84
views
Grep Sed with bash
I'm trying to achieve the following using bash and sed where the file containing below strings
qa2.test.m.xyz.com
554
1723
21
qa88.test.nj.xyz.com
1723
554
21
443
80
qa2.lite.xyz.com
554
1723
21
...
0
votes
1
answer
267
views
awk multiple commands and multiple args
I'm trying to turn this output:
❯ hg branches -T'{node} {branch}\n'
4b0826975cb29da26a6dd13f463241463c43c6a7 maria
5c31751cdb774f8b6337b6f64232b15903530997 default
Into these commands:
hg bookmark -r ...
1
vote
0
answers
719
views
Removing multiple parts of a file name using cut
I have a bunch of files named like so:
CI2_S1_20201120_S75_L001_R1_001.fastq.gz
CI2_S2_20201120_S76_L001_R2_001.fastq.gz
AV2_S2_20201120_S61_L001_R2_001.fastq.gz
and I want to rename the files to
...
0
votes
3
answers
2k
views
Can I simply cut and paste a program from C drive onto another partition and still be able to run the program?
I cut and pasted some programs from C drive to another partition to free up some space in the C drive. Now the programs don't run. Should I move the programs back to C drive again?
1
vote
1
answer
48
views
Shrink filename (remove last N columns)
I want to remove from this filename last 3 columns
david@david-ThinkPad-E480:~/Downloads$ ll A*
-rw-rw-r-- 1 david david 16006720 сен 9 11:03 'A.Matrosov. E.Rodionov. S.Bratus. Rootkits and Bootkits. ...
0
votes
1
answer
678
views
Sort lines in file by first field treated as number in shell
I have a file with the format shown below (a number + an IPv4 address). This format was generated by using uniq -c. I want to sort the lines after the first number in each of them. I would've gone for ...
4
votes
0
answers
162
views
Is it possible to find piece of audio inside of mp3 file?
We have a community radio and we are recording all shows 24/7. And we are wondering is there any way to automatically trim those recordings so that all commercials and unwanted parts are cutted off ...
0
votes
1
answer
101
views
How to cut video resolution from 3840x2160 to 2184x1680 in VLC
So I have a video 3840x2160 resolution and I want to cut out a part of it. So I'd only have the upperleft 2184x1680 pixels. Can that be done in VLC?
1
vote
1
answer
196
views
Cut out the start and end of a .mp4 file
I have been using ffmpeg to remove the first 5 seconds of a video clip with the following code.
for %%a in ("*.mp4") do ffmpeg -i "%%a" -ss 05 -acodec copy -vcodec copy "newfiles\%%~na.mp4"
pause
Is ...
1
vote
1
answer
3k
views
Precisely cut videos with ffmpeg [duplicate]
I would like to cut videos using ffmpeg for machine learning.
How can I ensure that if I cut (for example) 1s of video @25fps this will provide exactly 25 frames of synchronized audio and video?
I ...
2
votes
1
answer
7k
views
Using 'cut' command on Windows
I am trying to run this command line on Windows (I've installed GNU coreutils 8.24)
echo android:versionCode="3267" | cut -d \" -f 2
Expected output:
3267
However, I am getting error:
cut: the ...
1
vote
1
answer
82
views
How to extract all strings in require('')?
My source files are something like this:
abl require('../img/a.png') require('../img/b.png')
bla require('../../img/c.png')
ble <Image source={require('../img/d.png')}
My expected output is:
'../...
0
votes
0
answers
2k
views
cut: you must specify a list of bytes, characters, or fields
x=`sudo find /test -name "*.php"`
echo $x
p421.php p423.php read-session.php
I want to cut the $x with space white as delimiter
echo $x|cut -d " "
cut: you must specify a list of bytes, characters,...