Karambir Singh Nain

Simple Linux Tips and Tricks


Using Ubuntu(Pop!_OS) and Arch for a decade and I still forget how to do simple tasks. I am documenting a few here and will keep updating this for future reference.

Quick Upgrade Ubuntu or Arch

Add one of the following to ~/.bashrc:

alias _ug="yay -Syu --devel --needed && flatpak update --noninteractive"
alias _ug="sudo apt update && sudo apt upgrade -y && flatpak update --noninteractive"

Download Videos

Use yt-dlp to download videos for offline viewing:

yt-dlp -f "bestvideo[height<=2160][vcodec!^=av01]+bestaudio/best[height<=2160][vcodec!^=av01]" --all-subs --convert-subs srt --embed-subs --external-downloader aria2c

tar archives

Tar has following options

  • -c is crate archive mode, others are options in that mode
  • -x is extract archive mode
  • -v verbose
  • -z create gzip
  • -f tar filename

Create tar -cvzf test.tar.gz test-dir/

Extract tar -xvzf test.tar.gz /op/test

Split and combine large files

Split command can be used to split large files into many smaller ones:

e.g. split -b 50M thunderbird-profile.tar.gz "profile.tar.gz.part."

Similarly to combine these files again, use cat:

e.g. cat profile.tar.gz.part.* > thunderbird.profile.tar.gz

Combine multiple pdf files

The command pdfunite does this job well. It is part of popplet-utils package

sudo apt install poppler-utils
pdfunite file1.pdf file2.pdf file3.pdf output.pdf

Remove password from protected pdf file

  1. Install pdftk
  2. sudo apt install pdftk
  3. pdftk <path-to-encrypted.pdf> input_pw <password> output <new-file.pdf>

Socks proxy

ssh -D 8123 -f -C -q -N <user@example.com>

Monitor ongoing tcp traffic

sudo tcpdump -i eth0

List open TCP ports

sudo netstat -plnt

Disable Gnome tracker daemon

It hogs cores when files are changing fast.


Flatpack nextcloud autostart setup

Flatpack provided nextcloud doesn't do autostart by itself. Create a file at ~/.config/autostart/flatpak-nextcloud.desktop with following content:

[Desktop Entry]
Exec=flatpak run com.nextcloud.desktopclient.nextcloud --background
Comment[en_IN]=custom command - flatpak
Comment=custom command - flatpak

Flash windows ISO to usb


sudo add-apt-repository ppa:tomtomtom/woeusb
sudo apt update
sudo apt install woeusb wimtools

Then flash ISO

sudo woeusb --device windows.iso /dev/sda