recentpopularlog in

fbotha : bash   65

Command Line Magic on Twitter: "find . -newermt "2015-12-31 23:59:59.999999" ! -newermt "2016-12-31 23:59:59.999999" # Get a list of all files last modified in 2016. Unfortunately, find's -newer syntax is non-inclusive so you have to account for that with
find . -newermt "2015-12-31 23:59:59.999999" \! -newermt "2016-12-31 23:59:59.999999" # Get a list of all files last modified in 2016. Unfortunately, find's -newer syntax is non-inclusive so you have to account for that with precise pre-times.
bash 
november 2019 by fbotha
Gram Orsinium on Twitter: "Draw bar chart of channels of Wi-Fi networks around:sudo iwlist wlp3s0 scan | grep (Channel | grep -P ' d+' -o | sort -g | uniq -c | awk '{ print $2 " " $1}' | termgraphcc @climagic"
Draw bar chart of channels of Wi-Fi networks around:

sudo iwlist wlp3s0 scan | grep \(Channel | grep -P ' \d+' -o | sort -g | uniq -c | awk '{ print $2 " " $1}' | termgraph

cc @climagic
bash 
june 2019 by fbotha
Command Line Magic on Twitter: "sudo lsof -i TCP:443 # Print the processes that are either listening on TCP port 443 and connecting to port 443 on a remote host. Thanks @blind_coder"
sudo lsof -i TCP:443 # Print the processes that are either listening on TCP port 443 and connecting to port 443 on a remote host.
bash 
may 2019 by fbotha
Command Line Magic on Twitter: "dig +short https://t.co/oWHDzhRbIO | tr 'n' ' ' ; echo # Return a list of all the IPs for a DNS record on one line separated by spaces and make sure to provide a newline at the end so that the prompt is on it's own line."
dig +short https://t.co/oWHDzhRbIO | tr '\n' ' ' ; echo # Return a list of all the IPs for a DNS record on one line separated by spaces and make sure to provide a newline at the end so that the prompt is on it's own line.
bash  dns 
may 2019 by fbotha
Command Line Magic on Twitter: "awk '/DHCPACK/ && !a[$8]++' messages # Show the first new request from each mac addr in a dhcp log. Helps you find the latest new addition to your network."
awk '/DHCPACK/ && !a[$8]++' messages # Show the first new request from each mac addr in a dhcp log. Helps you find the latest new addition to your network.
bash  DHCP 
april 2019 by fbotha
Command Line Magic on Twitter: "sudo strace -p 1205 # See syscalls of PID 1205. Processes don't have to be a black box, you can use strace (on Linux) to view the system calls made by a process, which may give some clue as to why it's misbehaving, where it
sudo strace -p 1205 # See syscalls of PID 1205. Processes don't have to be a black box, you can use strace (on Linux) to view the system calls made by a process, which may give some clue as to why it's misbehaving, where it is saving a file, etc.
bash 
april 2019 by fbotha
egyp7 on Twitter: "Bash has several builtin ways to manipulate variables. ${foo//bar/baz} will replace all instances of "bar" with "baz" in the variable ${foo}. #bashtricksYou can use this substitution to show all setuid bins in your PATH:find ${PATH//:/
Bash has several builtin ways to manipulate variables. ${foo//bar/baz} will replace all instances of "bar" with "baz" in the variable ${foo}. #bashtricks

You can use this substitution to show all setuid bins in your PATH:

find ${PATH//:/ } -perm /u=s
bash 
april 2019 by fbotha
Command Line Magic on Twitter: "find ~/ -mmin -60 -xdev -ls # Find less than an hour old files (-mmin -60) in your homedir (~/) and below without crossing into other partitions. (-xdev) and long list them (-ls)"
find ~/ -mmin -60 -xdev -ls # Find less than an hour old files (-mmin -60) in your homedir (~/) and below without crossing into other partitions. (-xdev) and long list them (-ls)
bash 
april 2019 by fbotha
Tanel Poder on Twitter: "I usually try to stick with very basic Linux performance tools (vmstat,iostat,sar) to avoid depending on a customer's server having fancier tools installed. But one awesome tool that makes me break this philosophy is "dstat". It d
I usually try to stick with very basic Linux performance tools (vmstat,iostat,sar) to avoid depending on a customer's server having fancier tools installed. But one awesome tool that makes me break this philosophy is "dstat". It does formatting so much better - recommended! https://t.co/WawdRXKaWy
bash 
april 2019 by fbotha
Command Line Magic on Twitter: "rev <<<".xatnys codereh siht gnisu ecnetnes a fo srettel eht esrever ylisae nac uoY" # Reverse using rev and <<< for input."
rev <<<".xatnys codereh siht gnisu ecnetnes a fo srettel eht esrever ylisae nac uoY" # Reverse using rev and <<< for input.
bash 
march 2019 by fbotha
Command Line Magic on Twitter: "{ xsel || pbpaste; } | sort | uniq -c # Take the text in your select/copy buffer (Xwin or Mac) and sort it then print unique lines with a "count of duplicates" prior to the line."
{ xsel || pbpaste; } | sort | uniq -c # Take the text in your select/copy buffer (Xwin or Mac) and sort it then print unique lines with a "count of duplicates" prior to the line.
bash 
march 2019 by fbotha
Command Line Magic on Twitter: "awk '{print $NF " " $0}' sci2019.txt | sort -nr | nl # Take a list of scores in the last column and put them in the first column so they can be sorted to rank (b/c varied column numbers due to spaces), then create a rank nu
awk '{print $NF " " $0}' sci2019.txt | sort -nr | nl # Take a list of scores in the last column and put them in the first column so they can be sorted to rank (b/c varied column numbers due to spaces), then create a rank number using nl. TIMTOWTDI
bash 
march 2019 by fbotha
Command Line Magic on Twitter: "export PROMPT_COMMAND="[ $(date +%m%d) -eq "0401" ] && sleep 0.$(($RANDOM%7 + 1))" # April Fool's prep: Put a little random delay in someone's terminal that will activate only on April 1st."
export PROMPT_COMMAND="[ \$(date +%m%d) -eq "0401" ] && sleep 0.\$((\$RANDOM%7 + 1))" # April Fool's prep: Put a little random delay in someone's terminal that will activate only on April 1st.
bash  humour 
march 2019 by fbotha
Seb Cvx on Twitter: "@climagic I had issue with lsusb not refreshing my plugged usb device tonight. The discover command saved me on that : discover --vendor-id --model-id usbIf that can help someone 😉"
@climagic I had issue with lsusb not refreshing my plugged usb device tonight. The discover command saved me on that :

discover --vendor-id --model-id usb
usb  bash 
march 2019 by fbotha
Command Line Magic on Twitter: "date +%Y%m%d_%H%M%S.%2N # In GNU date, you can use %xN to specify that you only want 'x' decimal places of the nanoseconds instead of the full 9 places."
date +%Y%m%d_%H%M%S.%2N # In GNU date, you can use %xN to specify that you only want 'x' decimal places of the nanoseconds instead of the full 9 places.
bash 
february 2019 by fbotha
Command Line Magic on Twitter: "tar tvf backup.tar | grep -v "/$" | wc -l # Count the number of files, but not directories, stored in a tar file."
tar tvf backup.tar | grep -v "/$" | wc -l # Count the number of files, but not directories, stored in a tar file.
bash 
february 2019 by fbotha
Command Line Magic on Twitter: "git log --pretty=format:%cd --date=short | uniq -c # Print a count of the commits per day in a git repo."
git log --pretty=format:%cd --date=short | uniq -c # Print a count of the commits per day in a git repo.
git  bash 
january 2019 by fbotha
Command Line Magic on Twitter: "rename 's/^unwanted//' *.jpg # Remove the prefix 'unwanted' from the beginning of each filename with .jpg suffix in CWD."
rename 's/^unwanted//' *.jpg # Remove the prefix 'unwanted' from the beginning of each filename with .jpg suffix in CWD.
bash 
january 2019 by fbotha

Copy this bookmark:





to read