Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
home_server:home_server_setup:other_services:misc [2023-01-08 Sun wk01 20:05] baumkphome_server:home_server_setup:other_services:misc [2024-09-28 Sat wk39 20:53] (current) – [Grep finds strings] baumkp
Line 1: Line 1:
-{{tag>linux dmesg command systemd journal journalctl tzdata timezone apt upgrade update install remove crontab man apropos tldr ip tc systemctl journalctl}}+{{tag>linux dmesg command systemd journal journalctl tzdata timezone apt upgrade update install remove crontab man apropos tldr ip tc systemctl journalctl pbcopy pbpaste copy paste}}
 ======Commonly used commands and scripts====== ======Commonly used commands and scripts======
  
Line 195: Line 195:
 Once you're comfortable with using grep to find simple strings as seen above, it can do far more complex tasks. These include but are not limited to: case-insensitive use, more complex patterns (including full regular expressions), exclusion (only show me lines that don't include the pattern), and much, much more. But don't worry about that until after you're familiar with simple grep uses. Once you start, it's truly hard to imagine life without grep anymore! Once you're comfortable with using grep to find simple strings as seen above, it can do far more complex tasks. These include but are not limited to: case-insensitive use, more complex patterns (including full regular expressions), exclusion (only show me lines that don't include the pattern), and much, much more. But don't worry about that until after you're familiar with simple grep uses. Once you start, it's truly hard to imagine life without grep anymore!
  
 +====netstat====
 +  *''netstat -n'' to see active internet connections
 +  *''netstat -ie'' to see kernal interface table
 +  *''netstat -u'' to see status of TCP/IP connections
 +  *''netstat -p'' to see all the active IPv4 connections
 +  *''netstat -a'' to demonstrate the stat of all sockets, TCP and UDP
 +  *''netstat -s'' to see statistical summary for each available protocol
 +  *''netstat -su'' to see statistical summary of UDP
 +  *''netstat -stu'' to see statistical summary of TCP
 +  *''netstat -r'' to kernal route table 
 =====Sed replaces strings===== =====Sed replaces strings=====
  
Line 269: Line 279:
 ss display socket statistics ss display socket statistics
   *''ss -a'' show all sockets (listening ornon-listening)   *''ss -a'' show all sockets (listening ornon-listening)
 +
 +=====pbcopy pbpaste=====
 +Also see [[https://wiki.kptree.net/doku.php?id=home_server:home_server_setup:other_services:bash|BASH Customisation]]
 +
 +Linux requires the  package xsel, ''sudo apt install xsel''
 +Some raw xsel examples:
 +  *''%%uname -r | xsel --input --clipboard%%'' pipes the output of the command ''uname -r'' to the clipboard
 +  *''%%xsel --output --clipboard > file.txt%%'' copies the current clipboard contents to the file file.txt
 +
 +To create the command short cuts:
 +  *''vim ~/.bash_aliases'' and add  the following lines:
 +    *''%%alias pbcopy='xsel --input --clipboard'%%''
 +    *''%%alias pbpaste='xsel --output --clipboard'%%''
 +After  adjusting bash setting run ''source ~/.bashrc'' to update configuration
 +
 +To function on remote server:
 +  -Check the above setup on the remote sever
 +  -Check X11 forwarding is activated:
 +    - ''cat /etc/ssh/sshd_config | grep X11'',  output should show a line ''X11Frowarding yes''
 +    -If not, edit the file to make so, and then run ''sudo systemctl restart ssh'' to update the ssh configuration
 +  -Lastly, when ssh into system use the -X flag to use X11 forwarding; ''ssh -X
 +
 +  
 +
 +
 +
 ====Home Server Index==== ====Home Server Index====
 ++++Home Server Index|<pagelist&header> ++++Home Server Index|<pagelist&header>
Line 297: Line 333:
 ---- ----
  
-<- home_server:home_server_setup:other_services:logrotate|Prev ^ home_server:home_server_setup:other_services:index|Start page ^ ->+<- home_server:home_server_setup:other_services:firmware|Prev ^ home_server:home_server_setup:other_services:index|Start page ^ ->