Linux
14 pages
-
awk
unique values of column awk -F';' '$5 ~ /PATTERN/ {seen[$7]++} END {for (val in seen) print val}' fichier.csv Concatenate CSV files with awk: Why and How When merging CSV files with headers, using cat can cause proble...
-
BASH
Test if file exists test -e file && echo "file exists" || echo "file does not exist"
-
bc
scale scale=2 10/3 3.33 scale=4 10/3 3.3333
-
csvkit
https://csvkit.readthedocs.io/en/latest/
-
Fedora (server)
Things I do after installing a new Fedora server. Install latest updates dnf update Install Vim as default editor dnf install -y vim-default-editor --allowerasing Change SSH port Edit a file /etc/ssh/sshd_config.d/cust...
-
Gnome configuration
gsettings command-line utiliy dconf-editor https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/using_the_desktop_environment_in_rhel_8/configuring-gnome-at-low-level_using-the-desktop-environmen...
-
Grep
extract lines from one file that are not present in another file grep -Fvxf File2.txt File1.txt
-
LibreOffice (headless mode)
Convert Excel to CSV libreoffice --headless --convert-to csv file.xlsx libreoffice --headless --convert-to csv --outdir /path file.xlsx Convert CSV to Excel libreoffice --headless --convert-to xlsx file.csv
-
Pandoc
https://pandoc.org/ From markdown to docx pandoc document.md -o document.docx
-
PDF
Split PDF document in separate pages. pdfseparate input.pdf output-page%d.pdf
-
Rclone
https://rclone.org/
-
SSH (cheat sheet)
ssh-keygen ssh-copy-id user@host Correct permissions on .ssh chmod 700 /home/user/.ssh chmod 600 /home/user/.ssh/authorized_keys ~/.ssh/config (in test env) StrictHostKeyChecking no UserKnownHostsFile /dev/null LogLev...
-
Tmux
Cheat sheet https://tmuxcheatsheet.com/ i Synchronise panes :setw synchronize-panes
-
Useful commands for CDR handling
Here are some useful Linux commands for handling large CDR files. Simple lines count Simple lines count: wc -l * To a variable: lines_count=$(wc -l * | tail -n 1 | awk '{print $1}') De-duplicating sort input.csv | uniq...