Top Linux Commands : One-Liners


  • Mount folder/filesystem through SSH  :

sshfs name@server:/path/to/folder /path/to/mount/point

  • Compare a remote file with a local file    :

Source : Linuxcommandlibrary

ssh user@host cat /path/to/remotefile | diff /path/to/localfile -  

Source : Linuxcommandlibrary

  • Watch Star Wars :

telnet towel.blinkenlights.nl 

Source : Linuxcommandlibrary

  • Individually 7zip all files in current directory :

Source : CommandLineFu

for i in *.*; do 7z a "$i".7z "$i"; done 

Source : CommandLineFu

  • Information about the CPU :

lscpu | egrep 'Model name|Socket|Thread|NUMA|CPU\(s\)'

  • List all accessed configuration files :

Source : CommandLineFu

strace 2>&1 <any_executable> |egrep -o "\".*\.conf\""

Source : CommandLineFu

  • Check if port is open :

echo > /dev/tcp/127.0.0.123/8085 && echo "Port is open"

Source : CommandLineFu

Comments