User Tools

Site Tools


useful:linux-commands

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
useful:linux-commands [2022/08/25 15:46] adminuseful:linux-commands [2024/07/23 16:19] (current) admin
Line 2: Line 2:
  
 ====== Linux Commands ====== ====== Linux Commands ======
 +
 +===== Installing a GPG key =====
 +
 +Example:
 +
 +     wget -O- https://download.webmin.com/jcameron-key.asc | sudo gpg --dearmor | sudo tee /usr/share/keyrings/jcameron-key.gpg > /dev/null 2>&
 +     
 +Then need to edit the sources.list file to look something like:
 +
 +     deb [signed-by=/usr/share/keyrings/jcameron-key.gpg] https://download.webmin.com/download/repository sarge contrib
  
 ===== Change permissions for whole directory structure ===== ===== Change permissions for whole directory structure =====
Line 17: Line 27:
 ===== Delete all files with given pattern ===== ===== Delete all files with given pattern =====
  
-Adapt as required+     find . -name '*altauserpoints*' -print0 | xargs -0 -P0 rm 
 +      
 +Adapt as required
 + 
 +===== Make a change in every file in a directory  ===== 
 + 
 +     sed -i 's/foo/bar/g'
 +      
 +To make the change through a whole directory tree: 
 + 
 +     find ~/public_html/my_website/pages -type f -exec sed -i 's/2017/2018/g' {} \; 
 +      
 +===== Search within specific file type ===== 
 + 
 +     grep -ir removed --include="*.txt"
 +      
 +will search files with extension .txt ignoring case (-i) 
 +      
 +===== Bluetooth ===== 
 + 
 +Using this from the command line seems to do more than the GUI: 
 + 
 +     bluetoothctl 
 +      
 +===== Limiting journal log size ===== 
 + 
 +Edit the file: 
 + 
 +     /etc/systemd/journald.conf 
 +      
 +and set SystemMaxUse, for example 
 + 
 +     SystemMaxUse=250M 
 + 
 +Then restart journal with:
  
-     ind . -name '*altauserpoints*' -print0 | xargs -0 -P0 rm+     systemctl restart systemd-journald 
 +     
useful/linux-commands.1661442367.txt.gz · Last modified: 2022/08/25 15:46 by admin