---
title: "How to Use CUT command on CSV file in Ubuntu Linux"
description: "Like Bash, in Ubuntu, you can cut the specific columns from input CSV file after converting it as textCSV file using LibreOffice. Explained the usage with examples."
url: https://srinimf.com/2019/11/12/ubuntu-tutorial-cut-command-on-csv-file/
date: 2019-11-12
modified: 2026-10-10
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2019/11/ubuntu-csv-file-cut-command.jpg?fit=1200%2C700&ssl=1
categories: ["Ubuntu"]
tags: ["Convert CSV to Text Ubuntu", "CUT CSV Bash commands", "Ubuntu Cut Column from CSV file"]
type: post
lang: en
---

# How to Use CUT command on CSV file in Ubuntu Linux

Here I have given cut CSV bash commands to cut specific columns from the input CSV file.

CSV files are comma-separated files. To manipulate in UBUNTU, you need first them to convert to text files. Below are the steps you need and these are tested commands in [Ubuntu using Cut command](http://manpages.ubuntu.com/manpages/trusty/man1/cut.1posix.html) and Libre Office.

Advertisements

## [How to](https://srinimf.com/2020/11/21/convert-vmx-to-ova-ovf-errorsresolved/) Copy CSV file from Local Machine to Virtual Machine

1. Drag and Drop the file
2. Import the file to Ubuntu

### How to Save CSV file in UBUNTU by Using Libre Office

In Ubuntu, you can save as the file you copied as ‘textcsvformat’ by using Libre office of Ubuntu.

When you save input.CSV file as TextCSV, you will lose format and formulas. This is fine. Anyway, you need to only deal with Text data.

### How to Cut the Specific Columns From CSV File

```
policyID,statecode,county,eq_site_limit,hu_site_limit,
fl_site_limit,fr_site_limit,tiv_2011,tiv_2012,eq_site_deductible,
hu_site_deductible,fl_site_deductible,fr_site_deductible,
point_latitude,point_longitude,line,construction,
point_granularitypolicyID,
statecode,county,
eq_site_limit,hu_site_limit,fl_site_limit, 
r_site_limit,tiv_2011,
tiv_2012,eq_site_deductible,
hu_site_deductible,fl_site_deductible,
fr_site_deductible, point_latitude,point_longitude,line,construction,
point_granulariy

119736,FL,CLAY COUNTY,498960,498960,498960,498960,498960,792148.9,0,
9979.2,0,0,30.102261,-81.711777,Residential,Masonry,1
448094,FL,CLAY COUNTY,1322376.3,1322376.3,1322376.3,1322376.3,
1322376.3,1438163.57,0,0,0,0,30.063936,-81.707664,
Residential,Masonry,3206893,FL,CLAY

COUNTY,190724.4,190724.4,190724.4,190724.4,190724.4,
192476.78,0,0,0,0,30.089579,-81.700455,Residential,Wood,1
333743,FL,CLAY COUNTY,0,79520.76,0,0,79520.76,86854.48,0,0,0,0,
30.063236,-81.707703,Residential,Wood,3
```

## How to Use ‘Cut’ [command in Linux](https://srinimf.com/2023/01/07/scp-command-in-linux-how-to-copy-file/)

srinimf@ubuntu:~$ cut -d’,’ -f1-2 FL_insurance_sample.csv | head -5

policyID,statecode
119736,FL
448094,FL
206893,FL
333743,FL
srinimf@ubuntu:~$

Using the above command, first two columns (1-2) copied to output.

### How to Copy the output ‘after CUT command’ to a File

srinimf@ubuntu:~$ cut -d’,’ -f1-2 FL_insurance_sample.csv | head -5 > myoutput.txt

```
srinimf@ubuntu:~$ ls
 admin.conf               mydata.txt
 anaconda3               myoutput.txt
 Anaconda3-2018.12-Linux-x86_64.sh  mypython.py
 blockchain-network-on-kubernetes   myscripts.py
                Pictures
 Desktop                   Public
 Documents               pycache
 Downloads               Python-3.7.2
 examples.desktop           Python-3.7.2.tgz
 FL_insurance_sample.csv           Templates
 go1.12.1.linux-amd64.tar.gz       Videos
 Music
 srinimf@ubuntu:~$ ^C
```

Related[FlexClip: Create Simple Online Videos | Review](https://srinimf.com/2019/04/11/flexclip-create-simple-online-videos-review/)

```
srinimf@ubuntu:~$ cat myoutput.txt
 policyID,statecode
 119736,FL
 448094,FL
 206893,FL
 333743,FL
 srinimf@ubuntu:~$
```

Related Posts

- [Python CSV Files: Best Example to Read and Write](https://srinimf.com/2022/07/06/how-to-handle-csv-files-in-python/)DateJuly 6, 2022
- [How to Read CSV File as Text: PySpark Top Code](https://srinimf.com/2024/05/26/how-to-read-csv-file-as-text-pyspark-top-code/)DateMay 26, 2024
- [S3 to Redshift Data Ingestion: ETL Project for Beginners](https://srinimf.com/2025/09/24/s3-to-redshift-data-ingestion-etl-project-for-beginners/)DateSeptember 24, 2025

### Share this:

-
- [Tweet](https://twitter.com/share)
- [![](https://i0.wp.com/assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png)](https://www.pinterest.com/pin/create/link/?url=https%3A%2F%2Fsrinimf.com%2F2019%2F11%2F12%2Fubuntu-tutorial-cut-command-on-csv-file%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2019%2F11%2Fubuntu-csv-file-cut-command.jpg%3Ffit%3D1200%252C700%26ssl%3D1&description=How%20to%20Use%20CUT%20command%20on%20CSV%20file%20in%20Ubuntu%20Linux)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2019/11/12/ubuntu-tutorial-cut-command-on-csv-file/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2019/11/12/ubuntu-tutorial-cut-command-on-csv-file/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2019/11/12/ubuntu-tutorial-cut-command-on-csv-file/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2019/11/12/ubuntu-tutorial-cut-command-on-csv-file/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20How%20to%20Use%20CUT%20command%20on%20CSV%20file%20in%20Ubuntu%20Linux&body=https%3A%2F%2Fsrinimf.com%2F2019%2F11%2F12%2Fubuntu-tutorial-cut-command-on-csv-file%2F&share=email)
-

### Like this:

Like Loading…
