Linux Commands#

User Management#

Hardware#

  • get info about GPU: lshw -C display

  • get infos about CPU: cat /proc/cpuinfo

  • get infos about CPU temperature and fans

  • infos about USB: lsusb

  • details about USB: lsusb -vvv

Proxy Handling#

SSH through a Proxy (to an EC2 instance in this example)#

ssh -i <key_file>.pem <user>@<target_host_or_ip> -o "ProxyCommand=nc -X connect -x <proxy_ip>:<proxy_port> %h %p"

SCP through a Proxy (to an EC2 instance in this example)#

scp -i ~/.ssh/<key_file>.pem -o "ProxyCommand=nc -X connect -x <proxy_ip>:<proxy_port> %h %p" <file> <user>@<target_host_or_ip>:

Special#

  • output to terminal and file: command | tee <filename>

Rotate Terminal#

  • to the right: echo 1 | sudo tee /sys/class/graphics/fbcon/rotate_all

  • to the left: echo 3 | sudo tee /sys/class/graphics/fbcon/rotate_all

Administration#

  • reboot with timer (5 minutes) and message: shutdown -r +5 "<message>"

Bash Aliases#

alias ls='ls --color=auto -h'
alias la='ls -lA'
alias ll='ls -l'