twiki
Posts (Latest 10 updated) : Read all

Linux

Hotkeys

  • super + f = fullscreen
  • super + 1 = open 1st favourite

The A-Z of Linux Commands

###

  • ” is pipe
  • ”;” run multiple commands sequentially
  • “&” run multiple commands parallel

A

B

C

  • cat
  • conky [link]{https://linuxconfig.org/system-monitoring-on-ubuntu-18-04-linux-with-conky}

example

$ sudo lshw -class cpu
  • crontab

example - This will load .sh at 11 00 am, daily.

$ crontab -e
$ 00 11 * * * ~/Downloads/_vital_git_backup/vital_git_backup.sh

excellent examples

D

  • dd

example

$ sudo dd if=/dev/sdb of=~/SDCardBackup.img
  • df -h [link]{https://thepihut.com/blogs/raspberry-pi-tutorials/17789160-backing-up-and-restoring-your-raspberry-pis-sd-card}
  • dcfldd [link]{http://www.aoakley.com/articles/2015-10-09-resizing-sd-images.php}

example

$ sudo dcfldd if=/dev/sde of=imagename.img

H

  • htop
  • history

example:

$ history | more
1  service network restart
2  exit
3  id
4  cat /etc/redhat-release

$ !4
cat /etc/redhat-release
Fedora release 9 (Sulphur)

F

  • ffmpeg

example:

$ ffmpeg -i can_001.mkv -codec copy can_001.mp4
$ ffmpeg -i can_001.mkv -ss 00:10 -to 01:50 -c:v copy -c:a copy can_001_trim.mkv
  • find

example:

$ find ./ -type f -exec grep -Hn "YourContent" {} \;

G

  • grep

L

  • lsblk
  • lsb_release -a

N

  • neofetch
  • nvidia-smi

S

  • sleep 10

U

  • uptime

W

  • wait &! wait for previous command to finish

X

  • xkill
  • xrandr –output HDMI-0 –brightness 1.0

Notes

Ubuntu

  • if can’t boot CTRL+ALT+F1 to go to tty, CTRL+ALT+F7 to return
  • if forget to run as sudo, just type $ sudo !!
  • store others’ code/libs/etc in /usr/local/src
  • store desktop links in /usr/share/applications

VM

  • sudo mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other

Python

Python problems export PYTHONPATH=$PYTHONPATH:/path/to/main.py