Jun's Blog

Output, activities, memo and etc.

Fedora: How to detect and mount USB disks on commands

I learned how to detect and mount the USB disks on commands.

ask.fedoraproject.org

How to list up the not mounted USB disks.

The 2 commands below are useful.

$ lsblk -r -p -o NAME,TYPE,FSTYPE,UUID,SIZE,LABEL | grep -v "^/dev/loop"
NAME TYPE FSTYPE UUID SIZE LABEL
/dev/sda disk   232.9G 
/dev/sda1 part vfat XXXX-XXXX 232.9G 
...
$ gio mount -l
Drive(0): WD_BLACK  SN750 2TB
  Type: GProxyDrive (GProxyVolumeMonitorUDisks2)
Drive(1): USB DISK 3.2
  Type: GProxyDrive (GProxyVolumeMonitorUDisks2)
  Volume(0): 250 GB Volume
    Type: GProxyVolume (GProxyVolumeMonitorUDisks2)

How to mount a disk

$ udisksctl mount -b /dev/sda1
Mounted /dev/sda1 at /run/media/jaruga/XXXX-XXXX

Converting FASTQ format to FASTA format

The FASTQ format is to combine the FASTA format + Quality info. Therefore, we can convert the FASTQ format into FASTA format, removing only the quality info.

Here is the way: https://bioinformaticsworkbook.org/dataWrangling/fastaq-manipulations/converting-fastq-format-to-fasta.html#gsc.tab=0

I think the easiest way is to use the sed command in the list of the ways.

$ sed -n '1~4s/^@/>/p;2~4p' INFILE.fastq > OUTFILE.fasta

-n: quiet option. Suppress automatic printing of pattern space.

Hmm, it's difficult to understand what the expression argument of the sed is doing.

References