
The 'cut' command is used to cut sections from lines of text.
- Print the third character (-c) on each line:
cut -c 3 /path/to/file
command | cut -c 3
- Print characters 5-10 of each line of a file:
cut -c 5-10 path/to/file
- Split each line using a delimiter into fields, and print fields (-f) 2 and 5:
cut -f 2,5 path/to/file
NOTE The default delimiter is the TAB.
- Split each line using a specified delimiter (-d) and print field 4 and all fields after:
cut -d ":" -f 4- /etc/passwd
NOTE The /etc/passwd file uses colons to separate fields of information.
- Split each line using a specified delimiter (-d) and print field 4 and all fields previous:
cut -d ":" -f -4 /etc/passwd
- Do not print lines that do not contain the delimiter (-s):
cut -d " " -f -4 -s .bashrc
REFERENCED:
βΊ https://gitlab.com/dwt1/vidman
WANT TO SUPPORT THE CHANNEL?
π° Patreon: https://www.patreon.com/distrotube
π³ Paypal: https://www.paypal.com/donate/?hosted_button_id=MW3ZFGS8Q9JGW
ποΈ Amazon: https://amzn.to/2RotFFi
π Teespring: https://teespring.com/stores/distrotube
DT ON THE WEB:
πΈοΈ Website: http://distro.tube
π GitLab: https://gitlab.com/dwt1
π¨οΈ Mastodon: https://fosstodon.org/@distrotube
π« Reddit: https://www.reddit.com/r/DistroTube/
π½οΈ Odysee: https://odysee.com/@DistroTube:2
FREE AND OPEN SOURCE SOFTWARE THAT I LIKE:
π Brave Browser - https://brave.com/
π½οΈ Open Broadcaster Software: https://obsproject.com/
π¬ Kdenlive: https://kdenlive.org
π¨ GIMP: https://www.gimp.org/
π» VirtualBox: https://www.virtualbox.org/
ποΈ Doom Emacs: https://github.com/hlissner/doom-emacs
Your support is very much appreciated. Thanks, guys!
...
https://www.youtube.com/watch?v=9hoTL0GP2uQ