Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [cut-command]

The tag has no usage guidance.

0
votes
1answer
28 views

Cut the second field delimited by spaces

I want to retrieve the second column from ps result: test@pc:~$ ps -e | head -5 | cut -d '' -f1 PID TTY TIME CMD 1 ? 00:00:03 systemd 2 ? 00:00:00 kthreadd 3 ? ...
3
votes
3answers
262 views

Remove certain fields from a line

I have the following lines in a file: Modified folders: html/project1/old/dev/vendor/symfony/yaml/Tests/bla.yml Modified folders: html/port5/.DS_Store Modified folders: html/trap/dev8/.DS_Store ...
12
votes
1answer
446 views

`cut -d: -f5-` prints lines even if they have no colon

Assuming a file named "file" containing the lines: foo:bar:baz:qux:quux one:two:three:four:five:six:seven alpha:beta:gamma:delta:epsilon:zeta:eta:theta:iota:kappa:lambda:mu the quick brown fox jumps ...
2
votes
0answers
55 views

can't cut/Paste or move file in all my partition even using “sudo nautilus”

I have big problem to use my PC because I can't cut or paste or move all my file and folder in all my partition without system partition of Ubuntu. I use Ubuntu 17.04. I tried to search any response ...
8
votes
5answers
11k views

Cut command with word as delimiter

Is there any cut command to cut based on a word eg : 171212 16082784 6264 XXX xxxxxxxx Transaction XXXXX abend ABCD. The task has terminated abnormally because of a program check. 16:08:27 ...
1
vote
1answer
365 views

How to use cut command inside vim [closed]

I know this should be very simple but due to some reason I am not able to get this working. say I have a simple file with multiple columns of data, I just want to get second column and remove other ...
1
vote
1answer
48 views

How to create an alias to get a column? [duplicate]

Hello I would like to perform an alias to get an specific colum, parameter using a separator in order to achieve this i decided to use the cut command I created the alias as follows, and I saved it in ...
0
votes
3answers
75 views

how to get the available space left deterministically?

When I use the cut command, everytime I get a different result which makes sense. So I wonder how to get the answer similar to this but consistent across different Ubuntu nodes? ubuntu@ip:~/...
6
votes
4answers
4k views

Is there any way to make the cut command read the last field only?

I have a space seperated string which is output by a command, which I like to pipe to cut, using -fd ' ' to split on spaces. I know I can use -f <n> to display field number <n>, but can I ...
0
votes
0answers
111 views

How to Assign a keyboard shortcut to a different combination?

I have an issue where my copy and paste keyboard shortcuts are assigned to ctrl + insert and shift + insert instead of ctrl + c and ctrl + v. Now that I am too used to using ctrl + v and ctrl + c, I ...
1
vote
2answers
1k views

Cut and store a string untill a word is found in bash

I have this string /path/to/www/continued/xyz I want to cut the string till www means I want the string /path/to/www How can I do this in bash
2
votes
2answers
457 views

How can I cut the mac address out of DHCPDUMP?

I am trying to use dhcpdump to recognize people logging onto my home network and give them a tailor made greeting using a credential file. I cannot get the mac address out of the results of dhcpdump. ...
0
votes
1answer
95 views

Periodically cut and paste files

I'm running a model that generates quite a stream of outputs. In fact they are so many that it ends up dying because the hard-drive is filled up Is there a way (maybe with cron) to periodically scan ...
3
votes
1answer
51 views

Store in environment variable

I tried storing the contents of a file in an environment variable using one of those commands. a= cut -f 1 abc.txt cut -f 1 abc.txt >a neither works . So , can anybody help me out?
0
votes
2answers
288 views

How to use 'cut' command for finding temperature using tlp?

I have installed tlp in my system to prevent laptop over heating and i used this code to retrieve currtent cpu temperature. tlp-stat -t the output for above command is something like this: --- TLP ...