Miscelaneous Utilities
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
Utilities are small, specialized programs that perform specific tasks to assist in system management and maintenance. They can range from simple command-line tools to more complex applications. Utilities help automate repetitive tasks, troubleshoot issues, and optimize system performance. They are essential for efficient system administration and can significantly reduce manual effort.
1 - 🖥️cal
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the cal command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██████╗ █████╗ ██╗
# ██╔════╝██╔══██╗██║
# ██║ ███████║██║
# ██║ ██╔══██║██║
# ╚██████╗██║ ██║███████╗
# ╚═════╝╚═╝ ╚═╝╚══════╝
Cal/Ncal
The cal and ncal commands display a calendar in the output.
$ cal
March 2017
Su Mo Tu We Th Fr Sa
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
$ ncal
March 2017
Su 5 12 19 26
Mo 6 13 20 27
Tu 7 14 21 28
We 1 8 15 22 29
Th 2 9 16 23 30
Fr 3 10 17 24 31
Sa 4 11 18 25
# Display two calendar months side by side
cal -n 2 8 2018
# Display two calendar months side by side
cal -A 1 8 2018
# Display two calendar months side by side - Displays last month, current month, and next month side by side. Show a 3 month view (before, current, after) in cal.
cal -3
#==============================##==============================#
# CMD cal/ncal #
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command cal in a clear format. This allows users to quickly access the needed information for cal without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for cal are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
2 - 🖥️cowsay
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the cowsay command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██████╗ ██████╗ ██╗ ██╗███████╗ █████╗ ██╗ ██╗
# ██╔════╝██╔═══██╗██║ ██║██╔════╝██╔══██╗╚██╗ ██╔╝
# ██║ ██║ ██║██║ █╗ ██║███████╗███████║ ╚████╔╝
# ██║ ██║ ██║██║███╗██║╚════██║██╔══██║ ╚██╔╝
# ╚██████╗╚██████╔╝╚███╔███╔╝███████║██║ ██║ ██║
# ╚═════╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝ ╚═╝
apt install cowsay
cowsay Muuuh!
cowsay -f sheep Määäh
date | cowsay
cowsay moin | cowsay -n
#==============================##==============================#
# CMD cowsay #
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command cowsay in a clear format. This allows users to quickly access the needed information for cowsay without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for cowsay are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
3 - 🖥️date
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the date command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██████╗ █████╗ ████████╗███████╗
# ██╔══██╗██╔══██╗╚══██╔══╝██╔════╝
# ██║ ██║███████║ ██║ █████╗
# ██║ ██║██╔══██║ ██║ ██╔══╝
# ██████╔╝██║ ██║ ██║ ███████╗
# ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝
# Print date in format suitable for affixing to file names
date +"%Y%m%d_%H%M%S"
# Convert Unix timestamp to Date(Linux)
date -d @1440359821
# Convert Unix timestamp to Date(Mac)
date -r 1440359821
#==============================#
# CMD DATE
#==============================##==============================#
# german Date
date +"%d-%m-%Y"
date +'%j'
# Day of the year
date -u
# Current UTC time
date -d @192179700
# Turn a Unix epoch time back into a human readable date. Feature of GNU date
date +'%j'
# Day of the year
date -s 1970-01-01
# If you set your production server his time to this date, you will get fired.
date +%j
# Print the day of the year. Can be useful with things like find.
date -d "now 30 years ago" +%s
# In GNU date, show the epoch time 30 years ago. Interestingly, @498765432 was at 17:57:12 GMT that day.
date -d"2009-12-15 +2600 days"||date -v2009y -v12m -v15d -v+2600d; play -n synth sin 2600 trim 0 1 vol .05
# Today is day
TZ=UTC date
# Force a timezone for the date by setting the TZ variable. In this case, get UTC time.
TZ=UTC-1 date +"(%S + (%M * 60) + (%H * 3600))/86.4" | bc
# Calculate the current Swatch Beat time. /me ducks
time cat
# Instant stopwatch. Run to start timer and press Ctrl-D to stop it. "real" time is the elapsed time.
# 1) Example 1 - displaying current date and time in Unix
# This is simplest use of unix date command. just type date in the command prompt and it will show you the current date and time in the timezone your machine is.
date
Thu Jul 14 14:31:35 MPST 2011
# 2) Example 2 - displaying Julian date in Unix
# Date command examples in Unix and Linux
# most of java stock trading application running under Linux use Julian date format to store date information. Julian dates are made of 5 digits 2 of which represent year and 3 or last digit represent day of year. for example 14th July 20111 will be represented by 11195 in Julian format because 14th July is the 195th day of the year. we can get Julian date by using date command in unix as shown in the below example of unix date command:
# Converting current date into Julian format in unix
date +%j
195
# Converting a specific date into Julian format in unix
date -d "2011/07/13" +%j
194
# this way you can get yesterdays Julian date or tomorrows Julian date in Unix though I have heard that "-d" option of date is not supported in AIX so this may not work in AIX version of Unix.
# 3) Example 3 - displaying current date in various format in unix
# Unix date command is very powerful and can show date in various format. in this section of unix date tutorial we will convert date into some commonly used date format in unix:
# Showing date in YYYYMMDD format in Unix
date +%Y%m%d
20110714
# here %Y shows year in four digit ( you can use %y (small letter) for displaying just 2 digit of year) %m shows two digit of month as 01..12 and %d represent day of month.
# Showing date in DD/MM/YYYY format in unix
date +%d\/%m\/%Y
14/07/2011
# here again %d is for day %m is for month and %Y is for four digit year if you want to show 2 digit use small case y e.g. %y
# Showing date in DD-MM-YY format in unix
date +%d\-%m\-%Y
14-07-2011
# quite similar to above approach just chaged the "/" to "-", you can change it to any character as per your wish and until unix accept it.
# displaying date in MM/DD/YYYY format in Unix
# what do you guys think would it be difficult no right ? just exchange place of "%m" and "%d" and you are ready as shown in below example of date command in unix
date +%m\/%d\/%Y
07/14/2011
# displaying date in YYYY-MM-DD format is exactly similar to above approach just change the order of year and month.
# 4) How to find date 7 days before current date in Unix
# This is really nice of gnu version of unix date command you can easily get whats the date 4 days before or 5 days before by using date command in unix. here is example:
# date after 7 days in unix
date -d "-7 days"
Thu Jul 7 14:54:36 MPST 2011
# by using this way you can find any date which is any days apart from a given current date in unix
# 5) How to get date 7 days after current day in Unix and Linux
# As shown above you can get the date after 7 days in unix by using gnu version of date command in unix, here is an example of getting date 7 days after current date:
date -d "7 days"
Thu Jul 21 14:54:15 MPST 2011
# this way you can find any date which is 7 days past of a given current date in unix
# 6) Setting date time into unix
# setting date is easy though I dont recommend to do it if you have unix admins. Also changing date requires root access which you might not have with you anyway we can use unix date command to change the date, just provide new date in the specified format and your current date will be set to new date.
# format of setting date time into unix
# date mmddhhmi
where mm = month
dd = day of month
hh = hour
mi = minute
# Example of changing date time in unix
date 07240222
Sun Jul 24 02:22:00 MPST 2011
# above example of date command will set the current date to 24th July and time to 02:22, we dont provide year information and date uses current year by default.
# 7) How to find timezone by using unix date command - Example
# unix date command can display timezone related information also. it provides following option to display timezone
%:z +hh:mm numeric time zone (e.g., -04:00)
%::z +hh:mm:ss numeric time zone (e.g., -04:00:00)
%:::z numeric time zone with : to necessary precision (e.g., -04, +05:30)
%Z alphabetic time zone abbreviation (e.g., EDT)
date +%Z (this will display timezone in common format e.g. EST, GMT)
MPST
date +%z (this option of unix date command will display timezone respective of GMT)
+0800
# 8) How to show day of week in Unix using date command - Exmaple
# you can show current date, day of week name using unix date command by using options "%a" and "%A". small case is used to display day in short format while capital one is used to display full name of day. see the below example of date command in unix for display day of week :
date +%a
Thu
date +%A
Thursday
# 9) Date command in Unix for showing current time in Various format
# time is another important information which we can get from unix date command. by default date command in unix display both date and time information but we can use various options provided by date command to display only time information. lets see some example of showing time using unix date command:
# 10) Date to command for showing time in format HH:MM:SS
# As shown above on showing date in different format in unix you can also display time on different format by applying same approach. you just need to remember following time related options of unix date command
%H hour (00..23)
%M minute (00..59)
%S second (00..60)
# thats all for now guys I hope you will be more comfortable with date command in unix after going through and trying these examples. you can get more information about date command in unix by using "man date" or "date --help" which will also list all the options supported by unix date command.
# Tip: just remember that unix date command is mostly used inside bash script to get the date information , so its worth mentioning here how to execute date command from bash script, you just need to specify date command in back quotes . see the example bash script:
cat unixdate.sh
#!/bin/bash
DATE=`date`
echo "Current date: $DATE"
./unixdate.sh
# Current date: Sun Jul 24 02:30:50 MPST 2011
# So that was all about different examples of date command. We have seen how we can format date in Unix, how we can convert date into different timezone in Unix, how we can get current date and time inside bash script and several other examples of date command. Let me know if you have any other usage of date command which is not covered here.
date -d @1500000000
# A Unix epoch of epic proportions is this week. Party time! I'll be in Rome and could meet up with local fans there.
date -d @1539217802
# Using GNU date you can convert a Unix epoch time back into a human readable date by prefixing it with @
date -d @$((2**31-1))
# You heard it here first. Less than 20 years to go before 32-bit epochtime runs out. Make plans!
date1=$(date +%Y-%m-%d -d "1 day ago")
date2=$(date +%Y-%m-%d -d "2 days ago")
date3=$(date +%Y-%m-%d -d "3 days ago")
date -d @728737200
# Turn a Unix epoch time back into a human readable date. This is a not widely known feature of the GNU date command.
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.
# This Sunday, April 14th is Unix Epoch Day 18000! Happy Anniversary!
TZ=GMT echo $(( $( date +%s ) / 86400 ))
date +%5Y-%m-%d
# Members of The Long Now Foundation (@longnow) will be happy to know that in GNU date you can force displaying a 5 digit year by using %5Y in the output format.
# This Sunday, April 14th is Unix Epoch Day 18000! Happy Anniversary!
TZ=GMT echo $(( $( date +%s ) / 86400 ))
##########################################
NOW=$(date +"%m-%d-%Y")
PAST=$(date --date="1 days ago" +"%m-%d-%Y")
pid=$$
#zufall=$RANDOM
#tmpdir=/var/tmp/primeconfig/primeconfig.$pid.$zufall.maildir
tmpdir=/var/tmp/primeconfig/$NOW
tmpdirpast=/tmp/primeconfig/$PAST
###################################
#!/bin/bash
# Script to generate a unique ID based on date
# First 14 characters are based on the current time stamp in format YYYYMMDDHHMMSS, followed by an underscore and a random set of four alphanumeric characters. I'm not sure how likely this method is to generate duplicate IDs, but would guess quite unlikely. For a quick test, generated 5K four character sets and saw zero duplicates, so I think the chances of duplicates generated within one second are very low, unless /dev/urandom on your system is not very random. Example output: 20101230193212_pOiF
date=$(date +%Y%m%d%H%M%S)
rand=$(cat /dev/urandom | tr -cd [:alnum:] | head -c 4)
ID=$date"_"$rand
######################################
# Do something every few seconds/minutes/hours in a shell script
# In this case "something" is a command that prints current date and time.
#Every 5 seconds:
while true; do
if [[ $(date +%S) =~ (0$|5$) ]] ; then
echo Current time is ... $(date)
sleep 1
fi
done
Current time is ... Thu Jul 28 15:12:20 PDT 2011
Current time is ... Thu Jul 28 15:12:25 PDT 2011
Current time is ... Thu Jul 28 15:12:30 PDT 2011
Current time is ... Thu Jul 28 15:12:35 PDT 2011
Current time is ... Thu Jul 28 15:12:40 PDT 2011
Current time is ... Thu Jul 28 15:12:45 PDT 2011
Current time is ... Thu Jul 28 15:12:50 PDT 2011
#Every 10 seconds:
while true; do
if [[ $(date +%S) =~ (0$) ]] ; then
echo Current time is ... $(date)
sleep 1
fi
done
Current time is ... Thu Jul 28 15:13:00 PDT 2011
Current time is ... Thu Jul 28 15:13:10 PDT 2011
Current time is ... Thu Jul 28 15:13:20 PDT 2011
Current time is ... Thu Jul 28 15:13:30 PDT 2011
Current time is ... Thu Jul 28 15:13:40 PDT 2011
Current time is ... Thu Jul 28 15:13:50 PDT 2011
#Every 15 seconds:
while true; do
if [[ $(date +%S) =~ (00|15|30|45) ]] ; then
echo Current time is ... $(date)
sleep 1
fi
done
Current time is ... Thu Jul 28 15:14:15 PDT 2011
Current time is ... Thu Jul 28 15:14:30 PDT 2011
Current time is ... Thu Jul 28 15:14:45 PDT 2011
Current time is ... Thu Jul 28 15:15:00 PDT 2011
#Every 20 minutes:
while true; do
if [[ $(date +%M) =~ (00|20|40) ]] ; then
echo Current time is ... $(date)
sleep 60
fi
done
Current time is ... Thu Jul 28 15:20:00 PDT 2011
Current time is ... Thu Jul 28 15:40:00 PDT 2011
Current time is ... Thu Jul 28 16:00:00 PDT 2011
Current time is ... Thu Jul 28 16:20:00 PDT 2011
###########################################################################################################
# Create file text with ISO Date name. (MAC OS CATALINA / BASH) - Created, tested on MAC OS CATALINA Darwin Kernel Version 19.0.0: Thu Oct 17 16:17:15 PDT 2019; root:xnu-6153.41.3~29/RELEASE_X86_64 x86_64 bash.
touch `date +%Y-%m-%dT%H:%M:%S%z`.txt
# Sample output
# 2019-10-13T16:40:12+0200.txt
# 2019-10-13T16:44:01+0200.txt
# 2019-10-13T16:47:13+0200.txt
# Console clock - You will see it on the corner of your running terminal.
while sleep 1; do tput sc; tput cup 0 $(($(tput cols)-29)); date; tput rc; done &
# Sample output
# Sun Oct 20 05:48:44 JST 2019
# Countdown Clock - I find the other timers are inaccurate. It takes some microseconds to perform the date function. Therefore, using date/time math to calculate the time for us results in millisecond accuracy. This is tailored to the BusyBox date function. May need to change things around for GNU date function.
let T=$(date +%s)+3*60;while [ $(date +%s) -le $T ]; do let i=$T-$(date +%s); echo -ne "\r$(date -d"0:0:$i" +%H:%M:%S)"; sleep 0.3; done
# Sample output
# 00:03:00
# Poor man's ntpdate
date -s "$(curl -sD - www.example.com | grep '^Date:' | cut -d' ' -f3-6)Z"
# Print the DATE in ISO format.(MAC OS CATALINA / BASH) - Print date in iso format. Created and tested on MAC OS CATALINA. Darwin Kernel Version 19.0.0: Thu Oct 17 16:17:15 PDT 2019; root:xnu-6153.41.3~29/RELEASE_X86_64 x86_64 bash
date +%Y-%m-%dT%H:%M:%S%z
# Sample output
# 2019-10-13T15:49:45+0200
# 2019-10-13T15:51:31+0200
# Create backup copy of file, adding suffix of the date of the file modification (NOT today its date) - If your `date` command has `-r` option, you don't need `stat`
cp file{,.$(date -r file "+%y%m%d")}
# Create backup copy of file, adding suffix of the date of the file modification (NOT today's date)
cp file{,.$(date -d @$(stat -c '%Y' file) "+%y%m%d")}
# Create backup copy of file, adding suffix of the date of the file modification (NOT today's date) - When I go to change a configuration file I always like to make a backup first. You can use "cp -p" to preserve the modification time, but it gets confusing to have file.prev, file.prev2, etc. So I like to add a YYMMDD suffix that shows when the file was last changed. "stat -c %Y" gives you the modification time in epoch seconds, then "date -d @" converts that to whatever format you specify in your "+format" string.
cp file file.$(date -d @$(stat -c '%Y' file) "+%y%m%d")
# Sample output
# ls -l
# -rw-r--r-- 1 root root 0 Dec 31 2018 file
cp -p file file.$(date -d @$(stat -c '%Y' file) "+%y%m%d")
# ls -l
# -rw-r--r-- 1 root root 0 Dec 31 2018 file
# -rw-r--r-- 1 root root 0 Dec 31 2018 file.181231
# Thinking about starting #100daysofcode but also wondering when that'd be finished? The `date` command on Linux systems may help with that...
date -d "+100 days" +'%Y-%m-%d'
# 2020-08-05
#==============================##==============================#
# CMD date #
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command date in a clear format. This allows users to quickly access the needed information for date without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for date are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
4 - 🖥️echo
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the echo command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ███████╗ ██████╗██╗ ██╗ ██████╗
# ██╔════╝██╔════╝██║ ██║██╔═══██╗
# █████╗ ██║ ███████║██║ ██║
# ██╔══╝ ██║ ██╔══██║██║ ██║
# ███████╗╚██████╗██║ ██║╚██████╔╝
# ╚══════╝ ╚═════╝╚═╝ ╚═╝ ╚═════╝
#==============================#
# CMD ECHO
#==============================##==============================#
echo "php-faq [dot] eu is the world's best website for qualitative Linux article" | pv -qL 20
# You might have seen simulating text in Movies specially Hollywood Movies, where the text appears as if it is being typed in the Real time. You can echo any kind of text and output in simulating fashion using ‘pv‘ command, as pipelined above.
echo yoυrbank.com | hexdump -c
# Check a domain to make sure its all the ASCII characters you expect and not Unicode look-a-likes
echo "$URL" | tr -s / _
# Change URL into a more filesystem friendly form and squeeze the repeated _ chars into one. #TryingAgain
echo ".05*37652825" | bc
# Calculate how much money I would have if I had a nickel for every potentially hacked wordpress based site.
echo "AabBcc" | sed s/[ab]//ig |\ > awk '{print "g"$1, "-v"}' | sh
echo "DISPLAY=$DISPLAY xmessage call the client" | at 10:00
# Verschiedene Befehle die dann zu einem bestimmten Zeitpunkt ausgeführt werden
echo "Listen to which album?" ; se lect album in */ ; do mplayer "$album"/* ; done
# Poor folks multi music album player.
echo "Only $((16#F)) days left until $((16#7E0))"
# Convert hex to dec on the fly.
echo "Tacos,Burgers,Pizza,Pasta,Sushi,Salad,Soup,Noodles,Veggie wraps" | tr ',' '\n' | sort -R | head -1
# Simple lunch location decider.
echo "Tacos,Burgers,Pizza,Sushi,Salad,Noodles,Veggie wraps" | awk -F, '{print $1}'
# Simple lunch location decider.
echo "fuzzbuzz" | sed -e "s/u/i/2"
# Replace the second occurrence of a regex match.
echo "ibase=10;obase=12;2016" | bc
# In the #dozenal system, we've entered a new dozenal century (biquennium).
echo "ls -l" | at midnight
at midnight<<<<'ls -l'
echo "obase=16;ibase=10;40" | bc
# You can use the bc command to convert base 10 numbers to base 16 (hexadecimal). Tip: Specify obase first.
echo "scale=1000;4*a(1)*2" | BC_LINE_LENGTH=1004 bc -l | cut -c1-629
# Happy Tau (τ) day!
echo $(( ( $( date +%s ) - $( date -d "now - 7 years" +%s ) ) /86400 ))
# Calculate 7 years ago in days, accounting for leap years. #GNU
echo $(( ( $( date +%s ) - $( date -d -v-7y +%s ) ) /86400 ))
# Calculate 7 years ago in days, accounting for leap years. #BSD
echo $((0x28))
# Convert hexadecimal number 28 to decimal 40. Can also do
echo $((16#28)) for the conversion.
echo $PATH | tr ':' '\ n'
# Human-readable path:
echo ${DISPLAY: -1}
# If you ever want to use a negative offset (from the end) for variable substrings, the space before the - is important.
echo ${USER:0:${#USER}/2}
# You can use arithmetic inside bash variable expansions, such as this to get the first half of your username
echo 'man $(ls /usr/bin | shuf -n 1)| sed -n "/^NAME/ { n;p;q }"' >> ~/.bashrc
# Learn a command on each new shell open.
echo addr show|ip -o -b -|cut -d' ' -f2,7
# Show IPv4 and IPv6 addresses per interface in Linux. Thx to all in #climagic on Freenode.
echo epoch day $(( $( date +%s ) / 86400 ))
# Sorry I missed this one by 2 days. Too damn busy.
echo test | rev | cut -c 2- | rev
# Use rev twice to get around limitation of cut not being able to truncate end of a string.
echo {1..9} | tr -d " " > /dev/udp/lights.climagic.com/45444
# Send 123456789 in a udp packet to the lights at http://lights.climagic.com
echo {a..z} ;
echo {n..z} {a..m}
# Make a quick rot13 translation quick reference table.
echo ".05*37652825" | bc
# Calculate how much money I'd have if I had a nickel for every potentially hacked wordpress based site.
echo epoch day $(( $( date +%s ) / 86400 ))
# Sorry I missed this one by 2 days. Too damn busy.
echo "ls -l > /dev/pts/0" | at 2:12 PM
# The ‘at‘ command is similar to cron command and can be used for scheduling a task or command to run at specified time. > : redirects the output
echo -e "You are a jerk\b\b\b\bwonderful person" | pv -qL $[10+(-2 + RANDOM%5)]
# Simulate typing but with mistakes The output will show jerk, then wonderful person since echo parses the \b character.
echo "You can simulate on-screen typing just like in the movies" | pv -qL 10
# Simulate typing
echo "You can have a bit more realistic typing with some shell magic." | pv -qL $[10+(-2 + RANDOM%5)]
# Simulate typing
echo "pretty realistic virtual typing" | randtype -m 4
# Simulate typing this also generates errors (change 4 to higher number for more mistakes)
echo dir_1 dir_2 dir_3 | xargs -n 1 cp file1
# How to Copy A File to Multiple Directories in Linux With a Single Command
# -n 1 option on the xargs command tells it to only append one of those arguments at a time to the cp command each time it’s run.
echo dir_1 dir_2 dir_3 | xargs -n 1 cp copythisfile.txt
echo /home/user/1/ /home/user/2/ /home/user/3/ | xargs -n 1 cp /home/user/my_file.txt
echo -e '#!/bin/bash\necho My cksum is 918329835' > magic
# File containing its own checksum
# Quickly knock a UDP port in Linux
echo "ping" >/dev/udp/$host/$port
echo 'hello world' | sed s/world/orb/
# One way to practice sed commands is to pipe echo out.
echo %42%65%20%63%61%72%65%66%75%6c%20%77%68%61%74%2f%68%6f%77%20%79%6f%75%20%64%65%63%6f%64%65%0a | xxd -p -r
# Decode a hex encoded string
echo %42%65%20%63%61%72%65%66%75%6c%20%77%68%61%74%2f%68%6f%77%20%79%6f%75%20
echo $((2#1101))
# calculate binary 1101 → decimal printf '%x\n' $((2#1101)) # … → hexadecimal
echo -e "showconfig\ny" | ssh [email protected] | sed -n "/\?xml/,/\/config/p"
echo "set completion-ignore-case On" >> ~/.inputrc
# Case-insensitive tab completion - Pressing tab was never so easy with this linux input tweak
echo "some text `date +%Y-%m-%d\_%H:%M:%S`" >> /path/to/filename
# Add some text and the current date and time to a file -> This will output (without the quotes) "some text 2018-07-27_00:30:33" to /path/to/filename
echo -e "\$ORIGIN\tumccr.org.\n\$TTL\t1h\n" && aws route53 list-resource-record-sets --hosted-zone-id Z1EEXAMPLE9SF3 | jq -r '.ResourceRecordSets[] | [.Name, .Type, .ResourceRecords[0].Value] | join("\t")' - | grep -vE "NS|SOA"
# AWS Route53 hosted zone export -> Frustrated with the manual domain migration process AWS has, I unsuccessfully tried to install cli53, route53-transfer. I instead wrote this oneliner to ease the export (which is not supported via the AWS console ATM). The output can be easily pasted into the "Import Hosted Zone" dialog in Route53. SOA/NS records are excluded since they cannot be automatically imported. This is sample output - yours may be different.
$ORIGIN umccr.org.
$TTL 1h
umccr.org. MX 10 inbound-smtp.eu-west-1.amazonaws.com
umccr.org. TXT "google-site-verification=foo"
(...)
echo $(( $(grep -c '^ $' file_name) / 2 ))
# Count all [space][new line][space][new line] pattern using grep Using to count all sentences in CoNLL data format
echo "function backup() { local CA=c T=${TMPDIR:+/tmp}/backup.tar.gz; [[ -f $T ]]&& C=r; find ~ -type f -newer $T | tar ${CA}vfz $T -T - ;}" >> ~/.bashrc
# Make .bashrc function to backup the data you changed last houres -> The original overwrites any previous backups, and only saves exactly the last hours worth, but not 1 hour + 1 minute. This version creates or appends files, and backs up everything since the last backup (using the backups timestamp as the reference), plus it uses TMPDIR if set.
echo "New first line" | cat - file.txt > newfile.txt; mv newfile.txt file.txt
# Insert a line at the top of a text file without sed or awk or bash loops
# Just use '-' to use STDIN as an additional input to 'cat'
echo "$(find ./ -name '*' -type f -exec wc -l {} \; | awk '{print $1}' | tr '\n' '+' | sed s/+$//g)" | bc -l
# Count lines of the founded files
echo {a..z} ; echo {n..z} {a..m}
# Make a quick rot13 translation quick reference table.
echo 'mail -s "notify" [email protected] <<<"Buy flowers"' | at 3pm Feb 14
# Send flower reminder to your Verizon serviced phone.
echo "I want to cut off the end of this sentence. Because reasons." | rev | cut -c 18- | rev
# Use rev twice to get around limitation of cut not being able to truncate end of a string.
echo 'Hello, my username is imontoya, you kill -9 my $PPID, prepare to vi.'
#
echo $((0x2F))
# Convert hexadecimal number 2F to decimal 47. Can also do echo $((16#2F)) for the conversion.
echo 'man $(ls /usr/bin | shuf -n 1)| sed -n "/^NAME/ { n;p;q }"' >> ~/.bashrc
# Learn a command on each new shell open.
# Generate a sequence of numbers.
echo {1..99}
# Create a sequence of integer numbers
echo {4..-9}
# Explanation:
# Useful for counters. For example, to do something 10 times, you could do for i in {1..10}; do something; done
# Be careful, there cannot be spaces between the braces
# As the example shows, can count backwards too
# Limitations: Does not work in /bin/sh, this is bash specific.
# Produce 10 copies of the same string
echo boo{,,,,,,,,,,}
# Generate a sequence of numbers.
# Uses bash shortcut to generate series, it works with letters too echo {A..H} echo {a..h} Be careful not to mix upper and lower case, you may encounter funny results : echo {z..A} z y x w v u t s r q p o n m l k j i h g f e d c b a ` _ ^ ] [ Z Y X W V U T S R Q P O N M L K J I H G F E D C B A
echo {1..12}
# Sample outpt:
1 2 3 4 5 6 7 8 9 10 11 12
# Test sendmail
# test if sendmail is installed and working.
echo "Subject: test" | /usr/lib/sendmail -v [email protected]
# Sample outpt:
[root@machine]# echo "Subject: test" | /usr/lib/sendmail -v [email protected]
[email protected]... Connecting to [127.0.0.1] via relay...
[email protected]... Deferred: Connection refused by [127.0.0.1]
# OSX script to change Terminal profiles based on machine name; use with case statement parameter matching
# /macos/mojave shell script to change terminal profiles
echo "tell application \"Terminal\"\n\t set its current settings of selected tab of window 1 to settings set \"$PROFILE\"\n end tell"|osascript;
# Check SSL expiry from commandline
echo | openssl s_client -showcerts -servername google.com -connect gnupg.org:443 2>/dev/null | openssl x509 -inform pem -noout -text
# Halt the system in Linux without the halt command or gui
echo o > /proc/sysrq-trigger
# Explanation:
# First you need to enable the sysrq interface with: echo 1 > /proc/sys/kernel/sysrq
# echo o > /proc/sysrq-trigger halts
# echo b > /proc/sysrq-trigger reboots
# Uses 'at' to run an arbitrary command at a specified time.
echo 'play alarmclock.wav 2>/dev/null' | at 07:30 tomorrow
# Explanation: at 07:30 tomorrow schedules a job for 7:30 AM the next day, running whatever command or script is fed to it as standard input. The format for specifying time and date is rather flexible. http://tinyurl.com/ibmdwat
# echo 'play alarmclock.wav 2>/dev/null' | feeds the play alarmclock.wav command to at, while 2>/dev/null causes the text output of play to be thrown away (we are only interested in the alarm sound).
# Append to a file text, a blank line, and the last line of another file
echo -e "From: me\n\n$(tail -n1 /var/log/apache2/error.log)" >> file
# Explanation:
# -e option to echo makes it interpret '\n' as a newline
# $(command) syntax runs a command, then uses its output in place
# Limitations: The -e flag of echo does not work on all systems. In that case you can use printf instead.
## Alternative one-liners:
# Append to a file text, a blank line, and the last line of another file
{ echo some text; echo; tail -n1 /var/log/apache2/error.log; } >> /path/to/file
# Explanation: All the standard output from all the commands between the braces will be redirected.
# Redirect stdout to a file you do not have write permission on
echo hello | sudo tee -a /path/to/file
# Explanation:
# The tee command copies standard input to standard output, making a copy in zero or more files.
# If the -a flag is specified it appends instead of overwriting.
# Calling tee with sudo makes it possible to write to files the current user has no permission to but root does.
# Replace sequences of the same characters with a single character
echo heeeeeeelllo | sed 's/\(.\)\1\+/\1/g'
# Explanation: That is, this will output "helo".
# The interesting thing here is the regular expression in the s/// command of sed:
# \(.\) -- capture any character
# \1 -- refers to the last captured string, in our case the previous character. So effectively, \(.\)\1 matches pairs of the same character, for example aa, bb, ??, and so on.
# \+ -- match one or more of the pattern right before it
# ... and we replace what we matched with \1, the last captured string, which is the first letter in a sequence like aaaa, or bbbbbbb, or cc.
# Convert text from decimal to little endian hexadecimal
echo $(printf %08X 256 | grep -o .. | tac | tr -d '\n')
# Explanation:
# example of 256
# printf %08X produces the 8 characters 00000100
# grep breaks string by two characters
# tac reverses
# tr 00010000
# Run a command and copy its output to clipboard (Mac OSX)
echo "Here comes the output of my failing code" | tee >(pbcopy)
# Explanation:
# Often you need to copy the output of a program for debugging purposes. Cool kids on the block may use pastebin servers. But what if you'd just like to copy-and-paste the output to a web form, say? This one-liner gives a nice demonstration of process substitution. The stdout is piped to tee for duplication. Rather than dumping the output to a file as in the normal case, the output is piped to pbcopy via a temporary file that the OS conjures up on the fly (/dev/fd/XXX). The end result: you can paste the output wherever you want with Command+V.
# Limitations: This is Mac OSX specific. Use xsel on Linux.
# Blackhole ru zone
echo "address=/ru/0.0.0.0" | sudo tee /etc/NetworkManager/dnsmasq.d/dnsmasq-ru-blackhole.conf && sudo systemctl restart network-manager
# Explanation: It creates dnsmasq-ru-blackhole.conf file with one line to route all domains of ru zone to 0.0.0.0. You might use "address=/home.lab/127.0.0.1" to point allpossiblesubdomains.home.lab to your localhost or some other IP in a cloud.
# Dump all AWS IAM users/roles to a Terraform file for editing / reusing in another environment
echo iamg iamgm iamgp iamip iamp iampa iamr iamrp iamu iamup | AWS_PROFILE=myprofile xargs -n1 terraforming
# Explanation: Amazon Web Services (AWS) use a collection "IAM" resources to create Users and related objects in the system. This oneliner scrapes all the relevant info and puts it into Terraform. This lets us audit our users-groups. And, it lets us re-use them in another environment!
echo "[q]sa[ln0=aln256%Pln256/snlbx]sb729901041524823122snlbxq"|dc
# Instead of saying RTFM!
echo -e ${PATH//:/\\n}
# "Pretty print" $PATH, show directories in $PATH, one per line with replacement pattern using shell parameter expansion
# Can be used to create path alias. From: https://www.cyberciti.biz/tips/bash-aliases-mac-centos-linux-unix.html. #9
# Make a butterfly, or two people staring at each other, or that bridge in Adventure.
echo }{
# Send a random number to change the corresponding light on http://lights.climagic.org
echo $[RANDOM%9+1] > /dev/udp/lights.climagic.org/45444
# --version-sort = natural sort of (version) numbers within text
echo -e "1.png\n2.png\n3.png\n4.png\n5.png\n6.png\n7.png\n8.png\n9.png\n10.png\n11.png" | sort -V
# Get top level of path
echo '/'`pwd | cut -d'/' -f2`
echo doing something very nice!
echo 'doing something very evil' >/dev/null && echo doing something very nice!
# Sample output
# doing something very nice!
# Outputs list of $PATH dirs sorted by line length
echo -e ${PATH//:/\\n} | awk '{print length, $0}' | sort -n | cut -f2- -d' '
# Check if port is open on remote machine Check if port is open, if you don't have ncat on your machine.
echo > /dev/tcp/127.0.0.123/8085 && echo "Port is open"
# Sample output
# Port is open
# Hiding ur evil intent! Shame on you! - as a shell script, the possibilities are endless... #!/bin/bash echo doing something very evil! exit
# shell bash iterate number range with for loop
rangeBegin=10; rangeEnd=20; for ((numbers=rangeBegin; numbers<=rangeEnd; numbers++)); do echo $numbers; done
# shell bash iterate number range with for loop -> iterating range of numer with for loop in shell or bash
rangeBegin=10; rangeEnd=20; for numbers in $(eval echo "{$rangeBegin..$rangeEnd}"); do echo $numbers;done
# Sample output
# 10
# 11
# 12
# 13
# 14
# 15
# 16
# 17
# 18
# 19
# 20
# Fetter Text in der Konsole
# Manchmal möchte man etwas fett in der Konsole darstellen. Der einfachste weg führt dabei über Escape Sequenzen innerhalb von echo:
echo -e '\033[1mTEXT\033[0m'
# echo -e Die Option -e bedeutet, dass die Escape Sequenzen interpretiert werden
# \033 Signal für den Anfang der Formatierung
# kleines m Ende der Formatierung
# 1 Nummer für fett (andere Varianten siehe unten)
# [0m Zurücksetzen der Formatierung für alle nachfolgenden Elemente
# Formatierungsoptionen
# 0 Normale Formatierung
# 1 Fett
# 2 Kursiv
# 4 Unterstrichen
# 5 Blinkend
# 7 Rückwärts
# 8 Unsichtbar
# bash Montag Morgen beginnt mit einem 6er Pasch . \o/
echo $(</dev/urandom tr -dc 1-6 | head -c2)
66
#==============================##==============================#
# CMD ECHO
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command echo in a clear format. This allows users to quickly access the needed information for echo without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for echo are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
5 - 🖥️expr
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the expr command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ███████╗██╗ ██╗██████╗ ██████╗
# ██╔════╝╚██╗██╔╝██╔══██╗██╔══██╗
# █████╗ ╚███╔╝ ██████╔╝██████╔╝
# ██╔══╝ ██╔██╗ ██╔═══╝ ██╔══██╗
# ███████╗██╔╝ ██╗██║ ██║ ██║
# ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝
Expr
The expr command evaluates expressions. For example:
expr 1 + 2
3
#==============================##==============================#
# CMD AWK #
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command expr in a clear format. This allows users to quickly access the needed information for expr without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for expr are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
6 - 🖥️factor
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the factor command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ███████╗ █████╗ ██████╗████████╗ ██████╗ ██████╗
# ██╔════╝██╔══██╗██╔════╝╚══██╔══╝██╔═══██╗██╔══██╗
# █████╗ ███████║██║ ██║ ██║ ██║██████╔╝
# ██╔══╝ ██╔══██║██║ ██║ ██║ ██║██╔══██╗
# ██║ ██║ ██║╚██████╗ ██║ ╚██████╔╝██║ ██║
# ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝
Factor
The factor command prints the prime factors of the input number.
factor 135
135: 3 3 3 5
#==============================##==============================#
# CMD factor #
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command factor in a clear format. This allows users to quickly access the needed information for factor without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for factor are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
7 - 🖥️figlet
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the figlet command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ███████╗██╗ ██████╗ ██╗ ███████╗████████╗
# ██╔════╝██║██╔════╝ ██║ ██╔════╝╚══██╔══╝
# █████╗ ██║██║ ███╗██║ █████╗ ██║
# ██╔══╝ ██║██║ ██║██║ ██╔══╝ ██║
# ██║ ██║╚██████╔╝███████╗███████╗ ██║
# ╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚══════╝ ╚═╝
figlet -f slant kalixfce | boxes -pl4 -d dog
showfigfonts | less
figlist | less
figlet -f banner ABC | tr '#' '@'
figlet -tcf rev ABC
figlet -tcf rev ABC | tr '=' '#'
figlet -tcf rev ABC | tr '=' '$'
figlet linux | boxes -d ada-box -pl9r9 -a hcvc | boxes -d shell
################################################
# -------------------------------------------- #
# -- _ _ -- #
# -- | (_)_ __ _ ___ __ -- #
# -- | | | '_ \| | | \ \/ / -- #
# -- | | | | | | |_| |> < -- #
# -- |_|_|_| |_|\__,_/_/\_\ -- #
# -- -- #
# -------------------------------------------- #
################################################
clear ; while : ; do ack --bar | lolcat --force ; sleep 0.05 ; printf "\e[0;0H" ; done
#==============================##==============================#
# CMD figlet #
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command figlet in a clear format. This allows users to quickly access the needed information for figlet without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for figlet are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
8 - 🖥️file
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the file command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ███████╗██╗██╗ ███████╗
# ██╔════╝██║██║ ██╔════╝
# █████╗ ██║██║ █████╗
# ██╔══╝ ██║██║ ██╔══╝
# ██║ ██║███████╗███████╗
# ╚═╝ ╚═╝╚══════╝╚══════╝
file -P bytes=10 *
# Limit bytes read per file to speed up the 'file' command by reducing extra info. This isn't available in all versions.
# list human readable files
# include in the list human readable hidden files too: file .* *|grep 'ASCII text'|sort -rk2 more reliable command: ls|xargs file|grep 'ASCII text'|sort -rk2 and include hidden files: ls -a|xargs file|grep 'ASCII text'|sort -rk2
file *|grep 'ASCII text'|sort -rk2
# list human readable files - include in the list human readable hidden files too: file .* *|grep 'ASCII text'|sort -rk2 more reliable command: ls|xargs file|grep 'ASCII text'|sort -rk2 and include hidden files: ls -a|xargs file|grep 'ASCII text'|sort -rk2
file *|grep 'ASCII text'|sort -rk2
#==============================##==============================#
# CMD file #
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command file in a clear format. This allows users to quickly access the needed information for file without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for file are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
9 - 🖥️history
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the history command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██╗ ██╗██╗███████╗████████╗ ██████╗ ██████╗ ██╗ ██╗
# ██║ ██║██║██╔════╝╚══██╔══╝██╔═══██╗██╔══██╗╚██╗ ██╔╝
# ███████║██║███████╗ ██║ ██║ ██║██████╔╝ ╚████╔╝
# ██╔══██║██║╚════██║ ██║ ██║ ██║██╔══██╗ ╚██╔╝
# ██║ ██║██║███████║ ██║ ╚██████╔╝██║ ██║ ██║
# ╚═╝ ╚═╝╚═╝╚══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝
# To see most used top 10 commands:
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10
history | sed 's/^[ 0-9]* //'
# Remove numbers from history - Use the following command to give a history listing without the numbers for easier copy and pasting:
history | grep ssh
# !423
# # Search your history for commands matching ssh and then execute command #423 from the output.
history -cw
# To clear history of BASH commands - here c is to clear history and w to write current history
history -dw 420
# To remove a certain line only for example say 420
history -r
# to clear current session history
<space>command
# to run commands without saving its trace - put a space before the command and it wont be saved
unset HISTFILE
# To stop saving history for current session
history | awk '{print $2}' | sort | uniq -c | sort -rn | head
# List your most used commands (sorted)
history | awk -F\ '{ $1=""; print $0; }' | sort | uniq | wc -l
# This command should tell you how many unique shell commands you've fired so far. You should have $HISTFILESIZE set to a large number or not set at all, to store lots of command history.
.---------------------------------------------------------------------------.
| |
| Bash History Cheat Sheet |
| |
'---------------------------------------------------------------------------'
| Peteris Krumins ([email protected]), 2008.02.15 |
| http://www.catonmat.net/download/bash-history-cheat-sheet.txt |
| |
| Released under the GNU Free Document License |
'---------------------------------------------------------------------------'
===================== Emacs Keyboard Shortcut Summary =====================
.--------------.------------------------------------------------------------.
| | |
| Shortcut | Description |
| | |
'--------------+------------------------------------------------------------'
| C-p | Fetch the previous command from the history list. |
'--------------+------------------------------------------------------------'
| C-n | Fetch the next command from the history list. |
'--------------+------------------------------------------------------------'
| M-< | Move to the first line in the history. |
'--------------+------------------------------------------------------------'
| M-> | Move to the end of the input history. |
'--------------+------------------------------------------------------------'
| C-r | Search backward starting at the current line (incremental) |
'--------------+------------------------------------------------------------'
| C-s | Search forward starting at the current line (incremental). |
'--------------+------------------------------------------------------------'
| M-p | Search backward using non-incremental search. |
'--------------+------------------------------------------------------------'
| M-n | Search forward using non-incremental search |
'---------------------------------------------------------------------------'
======================= Vi Keyboard Shortcut Summary ======================
.--------------.------------------------------------------------------------.
| | |
| Shortcut | Description |
| | |
'--------------+------------------------------------------------------------'
| k | Fetch the previous command from the history list. |
'--------------+------------------------------------------------------------'
| j | Fetch the next command from the history list. |
'--------------+------------------------------------------------------------'
| /string or | Search history backward for a command matching string. |
| CTRL-r | |
'--------------+------------------------------------------------------------'
| ?string or | Search history forward for a command matching string. |
| CTRL-s | (Note that on most machines Ctrl-s STOPS the terminal |
| | output, change it with stty (Ctrl-q to resume)). |
'--------------+------------------------------------------------------------'
| n | Repeat search in the same direction as previous. |
'--------------+------------------------------------------------------------'
| N | Repeat search in the opposite direction as previous. |
'--------------+------------------------------------------------------------'
| G | Move to history line N (for example, 15G). |
'---------------------------------------------------------------------------'
======================== History Expansion Summary ========================
Event Designators:
.--------------.------------------------------------------------------------.
| | |
| Designator | Description |
| | |
'--------------+------------------------------------------------------------'
| ! | Start a history substitution. |
'--------------+------------------------------------------------------------'
| !! | Refer to the last command. |
'--------------+------------------------------------------------------------'
| !n | Refer to the n-th command line (try history command). |
'--------------+------------------------------------------------------------'
| !-n | Refer to the current command line minus n. |
'--------------+------------------------------------------------------------'
| !string | Refer to the most recent command starting with 'string'. |
'--------------+------------------------------------------------------------'
| !?string? | Refer to the most recent command containing 'string'. |
'--------------+------------------------------------------------------------'
| ^str1^str2^ | Quick substitution. Repeat the last command, replacing |
| | 'str1' with 'str2'. |
'--------------+------------------------------------------------------------'
| !# | Refer to the entire command line typed so far. |
'---------------------------------------------------------------------------'
Word Designators:
(Word designators follow the event designators, separated by a collon ':')
.--------------.------------------------------------------------------------.
| | |
| Designator | Description |
| | |
'--------------+------------------------------------------------------------'
| 0 | The zeroth (first) word in a line (usually command name). |
'--------------+------------------------------------------------------------'
| n | The n-th word in a line. |
'--------------+------------------------------------------------------------'
| ^ | The first argument (the second word) in a line. |
'--------------+------------------------------------------------------------'
| $ | The last argument in a line. |
'--------------+------------------------------------------------------------'
| % | The word matched by the most recent string search. |
'--------------+------------------------------------------------------------'
| x-y | A range of words from x to y (-y is synonymous with 0-y). |
'--------------+------------------------------------------------------------'
| * | All words but the zeroth (synonymous with 1-$). |
'--------------+------------------------------------------------------------'
| x* | Synonymous with x-$ |
'--------------+------------------------------------------------------------'
| x- | The words from x to the second to last word. |
'---------------------------------------------------------------------------'
Modifiers (modifiers follow word designators, separated by a colon):
.--------------.------------------------------------------------------------.
| | |
| Modifier | Description |
| | |
'--------------+------------------------------------------------------------'
| h | Remove a trailing pathname component, leaving the head. |
'--------------+------------------------------------------------------------'
| t | Remove all leading pathname component, leaving the tail. |
'--------------+------------------------------------------------------------'
| r | Remove a trailing suffix of the form .xxx, leaving the |
| | basename. |
'--------------+------------------------------------------------------------'
| e | Remove all but the trailing suffix. |
'--------------+------------------------------------------------------------'
| p | Print the resulting command but do not execute it. |
'--------------+------------------------------------------------------------'
| q | Quotes the substituted words, escaping further |
| | substitutions. |
'--------------+------------------------------------------------------------'
| x | Quotes the substituted words, breaking them into words at |
| | blanks and newlines. |
'--------------+------------------------------------------------------------'
| s/old/new/ | Substitutes 'new' for 'old'. |
'--------------+------------------------------------------------------------'
| & | Repeats the previous substitution. |
'--------------+------------------------------------------------------------'
| g | Causes s/old/new/ or & to be applied over the entire |
| | event line. |
'---------------------------------------------------------------------------'
============ History Behavior Modification via Shell Variables ============
.----------------.----------------------------------------------------------.
| | |
| Shell Variable | Description |
| | |
'----------------+----------------------------------------------------------'
| HISTFILE | Controls where the history file gets saved. |
| | Set to /dev/null not to save the history. |
| | Default: ~/.bash_history |
'----------------+----------------------------------------------------------'
| HISTFILESIZE | Controls how many history commands to keep in HISTFILE |
| | Default: 500 |
'----------------+----------------------------------------------------------'
| HISTSIZE | Controls how many history commands to keep in the |
| | history list of current session. |
| | Default: 500 |
'----------------+----------------------------------------------------------'
| HISTIGNORE | Controls which commands to ignore and not save to the |
| | history list. The variable takes a list of |
| | colon separated values. Pattern & matches the previous |
| | history command. |
'---------------------------------------------------------------------------'
============ History Behavior Modification via shopt Command ============
.----------------.----------------------------------------------------------.
| | |
| shopt Option | Description |
| | |
'----------------+----------------------------------------------------------'
| histappend | Setting the variable appends current session history to |
| | HISTFILE. Unsetting overwrites the file each time. |
'----------------+----------------------------------------------------------'
| histreedit | If set, puts a failed history substitution back on the |
| | command line for re-editing. |
'----------------+----------------------------------------------------------'
| histverify | If set, puts the command to be executed after a |
| | substitution on command line as if you had typed it. |
'---------------------------------------------------------------------------'
shopt options can be set by a shopt -s option and
can be unset by a shopt -u option.
=============================== Examples ==================================
$ echo a b c d e (executes `echo ab c d e`)
a b c d e
$ echo !!:3-$ (executes `echo c d e`)
c d e
$ echo !-2:*:q (executes `echo 'a b c d e'`)
a b c d e
$ echo !-3:1:2:4:x (executes `echo 'a' 'b' 'd'`)
a b d
$ echo !-4:1-3:s/a/foo/:s/b/bar/:s/c/baz/ (executes `echo foo bar baz`)
foo bar baz
$ tar -xzf package-x.y.z.tgz
...
$ cd !-1:$:r (executes `cd package-x.y.z`)
package-x.y.z $
$ ls -a /tmp
file1 file2 file3 ...
$ ^-a^-l^ (executes `ls -l /tmp`)
-rw------- 1 user user file1
...
=============================== END ==================================
history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head
477 l
444 git
424 cd
402 vim
106 rails
58 rm
53 rake
46 fg
43 rc
42 java
# Ein paar kleine Tricks machen die Nutzung der Bash-History noch effizienter.
# Die meisten Benutzer der Bash-Shell lernen ziemlich schnell die History-Funktion zu schätzen, die die meisten über die Cursor-Tasten abrufen. Alternativ geht das auch mit anderen Tasten wie [Strg]-[p] und [Strg]+[n]. Mit [Strg]+[r] lässt sich die History sogar durchsuchen, wenn man danach Teile des gesuchten Kommandos eintippt.
# Trivialitäten wie "pwd" oder "cd" muss die History nicht unbedingt speichern, denn das verschwendet nur unnötig Platz im begrenzten Speicher (der sich übrigens mit der Umgebungsvariablen "HISTSIZE" einstellen lässt). Auf vielen Systemen verzichtet die Bash auch auf eine Speicherung, wenn man dem Befehl ein Leerzeichen voranstellt. Dies wird durch die Variable "HISTCONTROL" gesteuert, die dann "ignorespace" enthalten muss.
# Bestimmte Befehle ignoriert die History, wenn man die Variable "HISTIGNORE" entsprechend setzt:
export HISTIGNORE="pwd:ls:ls -l:cd"
# Der Befehl muss dabei genau dem aufgeführten entsprechen, damit es klappt. Mit dem Spezialzeichen "&", das für den letzten Befehl steht, verzichtet die Bash darauf, unmittelbar aufeinander folgende doppelte Befehle zu speichern. Zum gleichen Effekt führt "HISTCONTROL=ignoredups". Global verhindert die Einstellung "HISTCONTROL=erasedups" duplizierte Befehle.
# Mit dem Befehl "history" lässt sich die History-Funktion steuern. So löscht "history -c" den aktuellen Speicher, "history -d X" löscht den letzten X-ten Eintrag, und "history -w" schreibt das Protokoll in die Datei (per Default "~/.bash_history"). Mehr Informationen zum History-Befehl sind übrigens in der Bash-Manpage zu finden, während "man history" Informationen zur History-Bibliothek enthält.
# https://robert-wohlfahrt.de/2017/10/loeschen-von-zeilen-aus-der-bash-history.html
# https://www.thegeekstuff.com/2009/09/multitail-to-view-tail-f-output-of-multiple-log-files-in-one-terminal/
# Ihr könnt dazu mit dem Editor eurer Wahl in die Datei ~/.bashrc wechslen und überprüfen, ob die Zeile vorhanden ist. Wenn nicht, dann könnt ihr die Zeile einfach hinzufügen und das Terminal neustarten, damit die .bashrc eingelesen wird. Setzt ihr dann ein Leerzeichen vor ein Kommando, das ihr nicht archiviert haben wollt, wird dieses auch nicht gespeichert. Es ist somit auch nicht mehr über die Pfeiltasten erreichbar.
export HISTCONTROL=ignorespace
HISTIGNORE="clear:bg:fg:cd:cd -:exit:date:w:* --help"
# Colon seperated list of exact commands to ignore for storing in history in BASH.
# Do not save command history of current bash session
HISTFILE=
# Explanation: The command history of the current bash session is saved to $HISTFILE when you exit the shell. If this variable is blank, the command history will not be saved.
history -c
# clear your active shell's history in case you do something stupid like paste a password+newline into your terminal.
# Show top ten most used commands on the shell
history | cut -d' ' -f 1 | uniq -c | sort -r | head -n10
# To view the specific number of top most used commands, run the following command in a Terminal.
history | awk 'BEGIN {FS="[ \t]+|\\|"} {print $3}' | sort | uniq -c | sort -nr | head -n x
# To view the most used commands, run the following command in a Terminal:
history | awk 'BEGIN {FS="[ \t]+|\\|"} {print $3}' | sort | uniq -c | sort –nr
#If you want to view the history list in a reverse order that is the least used at the top and the most used commands at the bottom, you can easily do that. Remove the r option for the second sort like shown in the below command.
history | awk 'BEGIN {FS="[ \t]+|\\|"} {print $3}' | sort | uniq -c | sort -n | head -n 30
# You can also view the history list of only those commands that occur for once, twice or for any specific number of times. For that, use the following syntax:
history | awk 'BEGIN {FS="[ \t]+|\\|"} {print $3}' | sort | uniq -c | sort -n | grep ' x '
# Replace x with any desired number. For instance, to view the list of commands that only occurred once use the below command:
history | awk 'BEGIN {FS="[ \t]+|\\|"} {print $3}' | sort | uniq -c | sort -n | grep ' 1 '
# Run sudo on the last command in your history. Be careful though. <Up Arrow> & [Ctrl-a] sudo can be fast too and perhaps safer. You can also use sudo !!:p first to print what will be run and then !! after to run it.
# Explanation: !! (bang bang!) is replaced with the previous command. You can read more about it and other history expansion commands in man bash in the Event Designators section.
sudo !!
# Recall “N”th command from your BASH history without executing it.
!12:p
# List or edit and re-execute commands from the history list
fc -l
# Explanation: fc is a little known but very useful bash built-in.
# fc -l will list the most recent 16 commands
# fc will open the last command in a text editor defined in the environmental variable FCEDIT or EDITOR or else vi, and re-execute when you exit
# fc 5 9 will open the history entries 5 to 9 in a text editor
# fc -s pat=sub will run the last command after substituting pat with sub in it (does not open editor)
# fc -s pat=sub cc is the same but on the last command starting with cc
# fc -s cc will run the last command starting with cc
# Bash interactive shell tip when using server API tokens; prevent single commands from being logged to `.bash_history` via...
GITHUB_TOKEN=123456 node index.js; history -d $((HISTCMD-1))
# Or clean-up after with. hint, `{}` (curly-braces) between BEGIN and END blocks is an implied loop over each input line.
sed -e '/TOKEN/d' -i .bash_history; history -d $((HISTCMD-1))
#-----------------------------------------------------------------------///
#==============================##==============================#
# CMD history #
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command history in a clear format. This allows users to quickly access the needed information for history without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for history are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
10 - 🖥️id
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the id command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██╗██████╗
# ██║██╔══██╗
# ██║██║ ██║
# ██║██║ ██║
# ██║██████╔╝
# ╚═╝╚═════╝
# The id command prints user and group information for the current user or specified username.
id himanshu
uid=1000(himanshu) gid=1000(himanshu) groups=1000(himanshu),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),108(lpadmin),124(sambashare)
#==============================##==============================#
# CMD ID #
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command id in a clear format. This allows users to quickly access the needed information for id without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for id are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
11 - 🖥️kill
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the kill command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██╗ ██╗██╗██╗ ██╗
# ██║ ██╔╝██║██║ ██║
# █████╔╝ ██║██║ ██║
# ██╔═██╗ ██║██║ ██║
# ██║ ██╗██║███████╗███████╗
# ╚═╝ ╚═╝╚═╝╚══════╝╚══════╝
# The kill command, as the name suggests, helps user kill a process by sending the TERM signal to it.
kill [process-id]
kill $(fuser `lsof $dir |awk '{print $9}'` 2>/dev/null)
#==============================##==============================#
# CMD KILL #
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command kill in a clear format. This allows users to quickly access the needed information for kill without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for kill are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
12 - 🖥️killall
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the killall command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██╗ ██╗██╗██╗ ██╗ █████╗ ██╗ ██╗
# ██║ ██╔╝██║██║ ██║ ██╔══██╗██║ ██║
# █████╔╝ ██║██║ ██║ ███████║██║ ██║
# ██╔═██╗ ██║██║ ██║ ██╔══██║██║ ██║
# ██║ ██╗██║███████╗███████╗██║ ██║███████╗███████╗
# ╚═╝ ╚═╝╚═╝╚══════╝╚══════╝╚═╝ ╚═╝╚══════╝╚══════╝
# The killall command lets you kill a process by name. Unlike kill - which requires ID of the process to be killed - killall just requires the name of the process.
killall nautilus
# Kill the process nautilus
killall -STOP render
# Pause execution of any process called render. As if you pressed Ctrl-Z in shell. Resume with 'killall -CONT render'
killall -USR1 dd
# Force each dd command in the process table to output its current status (blocks written, etc). The USR1 signal does this.
#==============================##==============================#
# CMD KILLALL #
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command killall in a clear format. This allows users to quickly access the needed information for killall without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for killall are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
13 - 🖥️less
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the less command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██╗ ███████╗███████╗███████╗
# ██║ ██╔════╝██╔════╝██╔════╝
# ██║ █████╗ ███████╗███████╗
# ██║ ██╔══╝ ╚════██║╚════██║
# ███████╗███████╗███████║███████║
# ╚══════╝╚══════╝╚══════╝╚══════╝
# To disable the terminal refresh when exiting
less -X
# To save the contents to a file
# Method 1 - Only works when the input is a pipe
s <filename>
# Method 2 - This should work whether input is a pipe or an ordinary file.
Type g or < (g or less-than) | $ (pipe then dollar) then cat > <filename> and Enter.
#==============================#
# CMD less
#==============================##==============================#
less +F filename.log
# Using +F option or pressing F in less is similar to `tail -f filename.log` but can use less his features.
less -j2 /var/log/syslog
# Set the search jump target to 2 lines down so that you see the previous line of context on searches within less.
# FYI, in less if you set -j-1 (value -1), it will put the match at the bottom of the terminal. -j-2 = two lines up. -j.5 = at half screen.
less tip: press 10<rightarrow>
# to move 10 spaces to the right and left to move left, etc. You can use numeric prefixes for many commands.
less -j10 /var/log/syslog
# Set the search jump target to 10 lines down so that you see 9 previous lines of context on searches within less.
less log log.2 log.3 | grep " 404 " | more
# Did you know that if your output from 'less' is a pipe, it behaves like cat. Undocumented
# "Where is that damn rehearsal email at?" Check files modified in the past 30 days with the word rehearsal in them. Within less, use :n to view to the next file.
less $( grep -li rehearsal $( find Maildir -type f -mtime -30 ) )
#==============================##==============================#
# CMD LESS
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command less in a clear format. This allows users to quickly access the needed information for less without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for less are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
14 - 🖥️look
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the look command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██╗ ██████╗ ██████╗ ██╗ ██╗
# ██║ ██╔═══██╗██╔═══██╗██║ ██╔╝
# ██║ ██║ ██║██║ ██║█████╔╝
# ██║ ██║ ██║██║ ██║██╔═██╗
# ███████╗╚██████╔╝╚██████╔╝██║ ██╗
# ╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝
# Look for lines in sorted file (Mac OS X)
# Look for lines which begins with the given prefix:
look prefix file
# Look for lines ignoring case:
look -f prefix file
look . | egrep "^s.*m.*b" | egrep "^.{4,9}$"
# Show a list of the other candidates for an open source SMB service.
look . | grep -E "^[a-z]{4,7}$" > wordlist ; rev wordlist > wordlistrev ; grep -x -f wordlistrev wordlist
# Find words that make other words backwards. This can take a while. This example limits to words 4-7 letters long but you can change the regex for longer/shorter words I meant only uses a specific number of characters. Ex: for i in {1..8} ; do look . | grep -E "^[a-z]{$i}$" > wordlist ......
look . | grep -E "^[a-z]{2,}$" | sort > wordlist ; rev wordlist | sort > wordlistrev ; comm -12 wordlist wordlistrev
# Find words that have a reverse which is also a word.
look . | egrep "^[a-g]{4,}$"
# Find 4+ letter words that are spelled using only musical note letters.
# Note that on the last one, -text{2..4} expands to -text2 -text3 -text4 So the lack of a space is important. BRACE EXPANSION!
#==============================##==============================#
# CMD LOOK #
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command look in a clear format. This allows users to quickly access the needed information for look without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for look are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
15 - 🖥️man
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the man command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ███╗ ███╗ █████╗ ███╗ ██╗
# ████╗ ████║██╔══██╗████╗ ██║
# ██╔████╔██║███████║██╔██╗ ██║
# ██║╚██╔╝██║██╔══██║██║╚██╗██║
# ██║ ╚═╝ ██║██║ ██║██║ ╚████║
# ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝
# Convert a man page to pdf
man -t bash | ps2pdf - bash.pdf
# View the ascii chart
man 7 ascii
#==============================#
# CMD MAN-Pages
#==============================##==============================#
man find |sed -e '/./{H;$!d;}' -e 'x;/modified/!d;i=='
# In the find man page, show whole paragraphs containing the word modified
man -k
# only searches in titles and summaries;
man -K
# (upper case) does a (slow) fulltext search. mandb refreshes the index file.
man -k sound
# Use -k to search for something in all man pages, like 'sound'.
man find |sed -e '/./{H;$!d;}' -e 'x;/modified/!d;i=='
# In the find man page, show whole paragraphs containing the word modified
man dpkg | sed -n '/Doctal/,/2000 /p'
# Pipe the output of the man command into other commands to trim down the "insane amounts of drivel".
man 5 crontab
# Read it, otherwise you may end up running that backup script every minute during the 4th month of the year.
man dpkg | sed -n '/Doctal/,/2000 /p'
# Pipe the output of the man command into other commands to trim down the "insane amounts of drivel".
man procmailrc | grep -C10 '!'
# Without opening up the man page viewer, search for instances of '!' and display with surrounding context.
# Maybe this is the problem. The vi man page doesn't even mention how to quit.
man vi | grep -i quit
# Manpage ausgeben und via email als TXT versenden
man -P cat MANPAGE | mail -s MANPAGE [email protected]
# To get an ASCII man page file without the annoying backspace/underscore attempts at underlining, and weird sequences to do bolding
man ksh | col -b > ksh.txt
man $(ls /bin | shuf | head -1)
# the below one liner will generate random man pages
# Explanation of commands and switches.
# man – Linux Man pages
# ls – Linux Listing Commands
# /bin – System Binary file Location
# shuf – Generate Random Permutation
# head – Output first n line of file.
man -k music
# You don't need to remember all the commands and options if you know how to find documentation.
# Search man pages and present a PDF
man -k . | awk '{ print $1 " " $2 }' | dmenu -i -p man | awk '{ print $2 " " $1 }' | tr -d '()' | xargs man -t | ps2pdf - - | zathura -
# Explanation: This uses dmenu to search through your man pages then produces a pdf for the one you selected
# man -k . lists all man pages
# awk '{ print $1 " " $2 }' prints the first column, a space then the second column
# This results in lines like this: curl (1)
# dmenu -i -p man takes a list fron stdin and lets you choose one. It returns what you chose
# You can swap dmenu for somethign like rofi if required
# awk '{ print $2 " " $1 }' puts the second column first
# The output is now like (1) curl
# tr -d '()' removes the brackets
# xargs man -t puts the result at the end of the command man -t
# This makes the command something like man -t 1 curl
# the -t flag makes man use troff to format the page
# ps2pdf - - produces a PDF from the postscritpt output by the previous command
# zathura - is a pdf reafer that can read STDIN
# Limitations:
# You will need a PDF viewer that can read from STDIN
# You will need ps2pdf installed which is part of ghostscript
# You will need dmenu or a dmenu compatible program installed.
# Almost all systems will already have xargs, tr troff, awk installed.
# Quick #bash shell tip on searching the #linux manual...
# ... love your `man` pages because one day ya might be developing on an air-gaped device.
# ... this is generally easier to grok than other things that I do not like to unsee.
man --pager='less -p " -P pager"' man
# ... example for `sshd_config`...
man --pager='less -p "ChrootDirectory"' sshd_config
man --pager='less -p "Shell Function Definitions"' bash
# convert a man file to a html File
zcat /usr/share/man/man8/scanlogd.8.gz | man2html | tee scanlogd.html
#==============================##==============================#
# CMD MAN #
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command man in a clear format. This allows users to quickly access the needed information for man without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for man are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
16 - 🖥️more
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the more command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ███╗ ███╗ ██████╗ ██████╗ ███████╗
# ████╗ ████║██╔═══██╗██╔══██╗██╔════╝
# ██╔████╔██║██║ ██║██████╔╝█████╗
# ██║╚██╔╝██║██║ ██║██╔══██╗██╔══╝
# ██║ ╚═╝ ██║╚██████╔╝██║ ██║███████╗
# ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝
# To show the file start at line number 5
more +5 file
#==============================##==============================#
# CMD MORE #
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command more in a clear format. This allows users to quickly access the needed information for more without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for more are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
17 - 🖥️notify-send
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the notify-send command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ███╗ ██╗ ██████╗ ████████╗██╗███████╗██╗ ██╗ ███████╗███████╗███╗ ██╗██████╗
# ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝╚██╗ ██╔╝ ██╔════╝██╔════╝████╗ ██║██╔══██╗
# ██╔██╗ ██║██║ ██║ ██║ ██║█████╗ ╚████╔╝█████╗███████╗█████╗ ██╔██╗ ██║██║ ██║
# ██║╚██╗██║██║ ██║ ██║ ██║██╔══╝ ╚██╔╝ ╚════╝╚════██║██╔══╝ ██║╚██╗██║██║ ██║
# ██║ ╚████║╚██████╔╝ ██║ ██║██║ ██║ ███████║███████╗██║ ╚████║██████╔╝
# ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚══════╝╚═╝ ╚═══╝╚═════╝
# To send a desktop notification via dbus:
notify-send -i 'icon-file/name' -a 'application_name' 'summary' 'body of message'
# The -i and -a flags can be omitted if unneeded.
#==============================##==============================#
# CMD NOTIFY-SEND #
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command notify-send in a clear format. This allows users to quickly access the needed information for notify-send without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for notify-send are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
18 - 🖥️printf
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the printf command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██████╗ ██████╗ ██╗███╗ ██╗████████╗███████╗
# ██╔══██╗██╔══██╗██║████╗ ██║╚══██╔══╝██╔════╝
# ██████╔╝██████╔╝██║██╔██╗ ██║ ██║ █████╗
# ██╔═══╝ ██╔══██╗██║██║╚██╗██║ ██║ ██╔══╝
# ██║ ██║ ██║██║██║ ╚████║ ██║ ██║
# ╚═╝ ╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝ ╚═╝ ╚═╝
#==============================#
# CMD PRINTF
#==============================##==============================#
printf "%x\n" {1..65535} | while read -r u ; do printf "\033[38;5;$((16+$((16#$u))%230))m\u$u\033[0m"; done
# Make a Unicode rainbow
printf "\e[%dm%d dark\e[0m \e[%d;1m%d bold\e[0m\n" {30..37}{,,,}
#Show your basic terminal text colors for terminal preferences change.
printf "1800-01-13 +%s months\n" {0..4800} |date -f - |grep ^Fri |awk '{print $NF}' |uniq -c |grep " 3 "
# Show years with 3 Fri 13ths
printf "now +%s months\n" {0..240}| date -f - |grep ^Fri
# Find all Friday 13ths in the next 20 years.
printf ".\n.\n.\n.\n.\n.\na\na\nb\nb\nb\nc\nc\n" | sort -R
# Run multiple times and this will demonstrate how sort -R is different from shuf
printf "10^%d\n" {0..20} | bc | sed -e :a -e 's/\(.*[0-9]\)\([0-9]\{3\}\)/\1,\2/;ta'
# Add separator commas to long numbers.
printf ".\n.\n.\n.\n.\n.\na\na\nb\nb\nb\nc\nc\n" | sort -R
# Run multiple times and this will demonstrate how sort -R is different from shuf
printf "2017-01-14 + %d weeks\n" {1..50} |date -f- +"%B %_d"
# Print the dates for all the following Saturdays in 2017 for use in a document
printf "%d\n" "')"
# Print the decimal encoded value of a ). The ' before the character tells printf to interpret the character this way.
printf "This is @climagic's %dth tweet. Thank you to my %d followers.\n\e[32m===,=='===\e[31m@\e[0m\n" $((10**4)) $((2**17))
printf "%d\n" "')"
# Print the decimal encoded value of a ). The ' before the character tells printf to interpret the character this way.
printf "%x\n" $(seq 0 255) | xargs -n1 -IH echo -ne \\xH > test.dat
# Generate binary sequence data
printf "Happy %dth Birthday %s\n" $((2**6)) "Richard Stallman" | figlet -w 64
# gibt was aus und macht dann figlet schrift draus
printf %g "$(bitcoin-cli estimatesmartfee 6 "ECONOMICAL" | jq .feerate*100000)";printf " sat/B estimated feerate for 6 confirmations as of $(date +%c)\nDivide by 100,000 to get btc/KB\n"
# Estimate an economic bitcoin-cli fee and display as sat/B with date time stamp -> Compactly display a bitcoin-cli fee estimate in satoshis/Byte, sat/B, date time stamp. Change the 6 to the desired number of confirmations. Display in btc/KB unit of measure: printf %g "$(bccli estimatesmartfee 6 "ECONOMICAL" | jq .feerate)";printf " btc/KB estimated feerate for 6 confirmations\nMultiply by 100,000 to get sat/B\n"; Two settings for estimate mode are "ECONOMICAL". "CONSERVATIVE" is the same as "UNSET"
# jq is a json filter. sudo apt-get install jq
# This is sample output - yours may be different.
163.808 sat/B estimated feerate for 6 confirmations as of Wed 20 Jun 2018 07:19:14 AM MDT
Divide by 100,000 to get btc/KB
# Estimate an economic bitcoin-cli fee and display as sat/B with date time stamp
# Compactly display a bitcoin-cli fee estimate in satoshis/Byte, sat/B, date time stamp. Change the 6 to the desired number of confirmations. Display in btc/KB unit of measure: printf %g "$(bccli estimatesmartfee 6 "ECONOMICAL" | jq .feerate)";printf " btc/KB estimated feerate for 6 confirmations\nMultiply by 100,000 to get sat/B\n"; Two settings for estimate mode are "ECONOMICAL". "CONSERVATIVE" is the same as "UNSET" # jq is a json filter. sudo apt-get install jq Show Sample Output
# 163.808 sat/B estimated feerate for 6 confirmations as of Wed 20 Jun 2018 07:19:14 AM MDT
# Divide by 100,000 to get btc/KB
printf %g "$(bitcoin-cli estimatesmartfee 6 "ECONOMICAL" | jq .feerate*100000)";printf " sat/B estimated feerate for 6 confirmations as of $(date +%c)\nDivide by 100,000 to get btc/KB\n"
printf "%s\n" T{Q,0}{Q,0}X{0,Q,B}{B,P,8}3569R7D9C5
# Print out all the combinations of a game card for which you accidentally scratched too hard. Ambiguous characters are expanded in sets using brace expansion {0,Q,B}, etc. I just had to do this and it worked.
printf "%080d" | tr 0 n
# Print the character 'n' 80 times. Useful for stuff like making lines for headers/breaks. Put it in a function.
# Print a horizontal line
# Replace the underscore with any other character. e.g. + or - or =
printf "%`tput cols`s"|sed "s/ /_/g"
# Print a horizontal line
printf -v _hr "%*s" $(tput cols) && echo ${_hr// /${1--}}
# Make M-n, M-m, and M-, insert the zeroth, first, and second argument of the previous command in Bash
printf %s\\n '"\en": "\e0\e."' '"\em": "\e1\e."' '"\e,": "\e2\e."'>>~/.inputrc
# Check whether IPv6 is enabled Checks whether IPv6 is enabled system-wide by reading from procfs.
printf "IPv6 is "; [ $(cat /proc/sys/net/ipv6/conf/all/disable_ipv6) -eq 0 ] && printf "enabled\n" || printf "disabled\n"
# Edit the Gimp launcher file to disable the splash screen
printf '%s\n' ',s/^Exec=[^ ]*/& -s/' w q | ed /usr/share/applications/gimp.desktop
# Explanation: sed is designed for editing streams - editing files is what ed is for! You can get consistent behavior on any UNIX platform with the above one-liner. The printf command sends a series of editing commands to ed, each separated by a newline. In this case, the substitution command ,s/^Exec=[^ ]*/& -s/ is nearly the same as in sed, appending a space and a -s to the line starting with Exec=. The only difference is the comma at the beginning designating the lines to operate on. This is shorthand for 1,$, which tells ed to apply the command to the first through the last lines (i.e., the entire file). w tells ed to write the file, and q to quit.
# Generate a sequence of numbers
printf '%s\n' {1..10}
# printf command can auto-escape strings...
_unclean_input='some th!ng n@$ty'
printf '%q\n' "${_unclean_input}"
#> some\ th\!ng\ n@\$ty
#==============================##==============================#
# CMD PRINTF
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command printf in a clear format. This allows users to quickly access the needed information for printf without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for printf are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
19 - 🖥️seq
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the seq command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ███████╗███████╗ ██████╗
# ██╔════╝██╔════╝██╔═══██╗
# ███████╗█████╗ ██║ ██║
# ╚════██║██╔══╝ ██║▄▄ ██║
# ███████║███████╗╚██████╔╝
# ╚══════╝╚══════╝ ╚══▀▀═╝
seq 20 | shuf
# Generate a random ordered list of 20 numbers. For example to determine order of presentation.
seq 1 1008 | awk '{if (2016%$1==0){print $0 "x" (2016/$1)}}'
# Or find another terminal resolution that equals 2016.
seq 100/\>awk '{s+=$0}END{print s}'
seq 100 | xargs -n1 -I{} date -d "+{} days" +%Y%m%d | xargs mkdir
# Make dated directories for next 100 days. Use date -v+{}d on BSD.
seq 100 | xargs -n1 -I{} date -d "+{} days" +%Y%m%d | xargs mkdir
# Make dated directories for next 100 days. Use date -v+{}d on BSD.
seq 100 | xargs -n1 -I{} date -d "+{} days" +%Y%m%d | xargs mkdir
# Make dated directories for next 100 days. Use date -v+{}d on BSD.
seq 100 | xargs -n1 -I{} date -d "+{} days" +%Y%m%d | xargs mkdir
# Make dated directories for next 100 days. Use date -v+{}d on BSD.
# Generate a sequence of numbers. for description type man seq
seq 12
# draw honeycomb
tput setaf 1 && tput rev && seq -ws "___|" 81|fold -69|tr "0-9" "_" && tput sgr0 # (brick wall)
seq -ws "\\__/" 99|fold -69|tr "0-9" " "
## Alternative one-liners:
Shuffle lines
seq 5 | shuf
# draw mesh
seq -s " \\_/" 256|tr -d "0-9"|fold -70
# Shuffle lines
seq 5 | shuf
# Explanation: shuf is part of the textutils package of GNU Core Utilities and should be available on most systems.
# Generate a sequence of numbers
echo {01..10}
# Explanation: This example will print:
01 02 03 04 05 06 07 08 09 10
# While the original one-liner is indeed IMHO the canonical way to loop over numbers, the brace expansion syntax of Bash 4.x has some kick-ass features such as correct padding of the number with leading zeros.
# Limitations: The zero-padding feature works only in Bash >=4.
## Related one-liners
# Generate a sequence of numbers
for ((i=1; i<=10; ++i)); do echo $i; done
# Explanation: This is similar to seq, but portable. seq does not exist in all systems and is not recommended today anymore. Other variations to emulate various uses with seq:
# seq 1 2 10
for ((i=1; i<=10; i+=2)); do echo $i; done
# seq -w 5 10
for ((i=5; i<=10; ++i)); do printf '%02d\n' $i; done
#Generate a sequence of numbers
for ((i=1; i<=10; ++i)); do echo $i; done
# Explanation:
#This is similar to seq, but portable. seq does not exist in all systems and is not recommended today anymore. Other variations to emulate various uses with seq:
# seq 1 2 10
for ((i=1; i<=10; i+=2)); do echo $i; done
# seq -w 5 10
for ((i=5; i<=10; ++i)); do printf '%02d\n' $i; done
## Alternative one-liners:
#Generate a sequence of numbers
echo {01..10}
# Explanation:
#This example will print:
01 02 03 04 05 06 07 08 09 10
#While the original one-liner is indeed IMHO the canonical way to loop over numbers, the brace expansion syntax of Bash 4.x has some kick-ass features such as correct padding of the number with leading zeros.
# Limitations:
#The zero-padding feature works only in Bash >=4.
#Generate a sequence of numbers
perl -e 'print "$_\n" for (1..10);'
# Explanation:
#Print the number with newline character which could be replaced by any char.
#Generate a sequence of numbers
for ((i=1; i<=10; ++i)); do echo $i; done
# Explanation:
#This is similar to seq, but portable. seq does not exist in all systems and is not recommended today anymore. Other variations to emulate various uses with seq:
# seq 1 2 10
for ((i=1; i<=10; i+=2)); do echo $i; done
# seq -w 5 10
for ((i=5; i<=10; ++i)); do printf '%02d\n' $i; done
## Alternative one-liners:
#Generate a sequence of numbers
echo {01..10}
# Explanation:
#This example will print:
01 02 03 04 05 06 07 08 09 10
#While the original one-liner is indeed IMHO the canonical way to loop over numbers, the brace expansion syntax of Bash 4.x has some kick-ass features such as correct padding of the number with leading zeros.
# Limitations:
#The zero-padding feature works only in Bash >=4.
#Generate a sequence of numbers
perl -e 'print "$_\n" for (1..10);'
# Explanation:
#Print the number with newline character which could be replaced by any char.
#Shuffle lines
... | perl -MList::Util -e 'print List::Util::shuffle <>'
# Explanation:
#Sorting lines is easy: everybody knows the sort command.
#But what if you want to do the other way around? The above perl one-liner does just that:
# -MList::Util load the List::Util module (as if doing use List::Util inside a Perl script)
# -e '...' execute Perl command
# print List::Util::shuffle <> call List::Util::shuffle for the lines coming from standard input, read by <>
#Another way would be sort -R if your version supports that (GNU, as opposed to BSD). In BSD systems you can install coreutils and try gsort -R instead. (For eample on OSX, using MacPorts: sudo port install coreutils.)
## Alternative one-liners:
#Shuffle lines
seq 5 | shuf
# Explanation:
shuf is part of the textutils package of GNU Core Utilities and should be available on most systems.
#huffle lines
... | perl -MList::Util=shuffle -e 'print shuffle <>;'
# Explanation:
#Sorting lines is easy: everybody knows the sort command.
#But what if you want to do the other way around? The above perl one-liner does just that:
# -MList::Util=shuffle load the shuffle function from the List::Util package
# -e '...' execute Perl command
# If you need dates relative to today you can do (note the absence of a for loop):
seq -f "%g day" -7 2 7 | date --file - +%F
2019-06-17
2019-06-19
2019-06-21
2019-06-23
2019-06-25
2019-06-27
2019-06-29
2019-07-01
# shell bash iterate number range with for loop
seq 10 20
#==============================##==============================#
# CMD SEQ - sequence
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command seq in a clear format. This allows users to quickly access the needed information for seq without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for seq are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
20 - 🖥️sleep
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the sleep command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ███████╗██╗ ███████╗███████╗██████╗
# ██╔════╝██║ ██╔════╝██╔════╝██╔══██╗
# ███████╗██║ █████╗ █████╗ ██████╔╝
# ╚════██║██║ ██╔══╝ ██╔══╝ ██╔═══╝
# ███████║███████╗███████╗███████╗██║
# ╚══════╝╚══════╝╚══════╝╚══════╝╚═╝
sleep 300 && mplayer audiofile.mp3
sleep 60 && espeak "wake up" 2>/dev/null
# Sleep 1 min and then have espeak say wake up.
sleep 5 && xterm -fg yellow -T "Wake Up" -g 40x10
# Or something simple like
sleep 5; scrot -u Phishing-email-example-with-mouseover.png
# Use a sleep and the -u option with scrot to capture a mouseover screenshot.
sleep 5d
# With GNU sleep, you can use time suffixes (m = minute, h = hour, d = day). Note that some very large values get truncated.
sleep 3m; xmessage -nearmouse "Your tea is ready"
# Quick popup notification command after 3 minutes.
sleep 5; scrot -u Phishing-email-example-with-mouseover.png
# Use a sleep and the -u option with scrot to capture a mouseover screenshot.
nohup sleep 8h
# Because you can not do this in real life.
# And when I originally posted this I made an explanation video here https://www.youtube.com/watch?v=1VzVLFXczx8 Enjoy. Now someone should make a youtube track that matches up with the ASCII version.
# Fit that exactly into 140. Yes, that will play Star Wars ASCII Animation with some music in the background. It kinda matches up.
(sleep 21;youtube-dl -qo- http://youtube\.com/watch?v=Yt20uO4cFYs|mplayer -really-quiet -vo null -cache 500 -)|nc towel.blinkenlights\.nl 23
sleep 6h 52m ; yes wakey wakey | espeak -
sleep 5;while IFS=, read {a..z};do for col in a c d;do xdotool type ${!col} $'\t';sleep 0.3;done;done
# Type 3 CSV cols to Google docs table
sleep 2d 5h 1m 15s
# Sleep for 2 days, 5 hours, 1 minute and 15 seconds. This syntax works in GNU coreutils sleep at least.
sleep 5m && rm -fr /
# Using a logical && after sleep gives you a chance to Ctrl-C out of sleep without it running the rest.
sleep 15m; notify-send "Go pick up the pizza"
# Remember to go get the food. In X, this will send a notification to the screen.
sleep $((4*60 + 33))
# If you do not have GNU sleep, you can use math substitution for playing 4'33. A learning experience either way.
sleep 4m 33
# Perform John Cage's 4'33. You do not even need a sound driver, but you do need GNU sleep.
sleep 3m; xmessage -nearmouse "Your tea is ready"
# Quick popup notification command after 3 minutes.
#==============================##==============================#
# CMD SLEEP
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command sleep in a clear format. This allows users to quickly access the needed information for sleep without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for sleep are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
21 - 🖥️sudo
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the sudo command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ███████╗██╗ ██╗██████╗ ██████╗
# ██╔════╝██║ ██║██╔══██╗██╔═══██╗
# ███████╗██║ ██║██║ ██║██║ ██║
# ╚════██║██║ ██║██║ ██║██║ ██║
# ███████║╚██████╔╝██████╔╝╚██████╔╝
# ╚══════╝ ╚═════╝ ╚═════╝ ╚═════╝
# sudo
# Execute a command as another user.
# List of an unreadable directory:
sudo ls /usr/local/scrt
# To edit a file as user www:
sudo -u www vi /var/www/index.html
# To shutdown the machine:
sudo shutdown -h +10 "Cya soon!"
# Save a file you edited in vim
:w !sudo tee > /dev/null %
# Make sudo forget password instantly
sudo -K
# List your sudo rights
sudo -l
# Add a line to a file using sudo
echo "foo bar" | sudo tee -a /path/to/some/file
# run root shell
sudo -i
# to disable password for sudo for user superuser add
# superuser ALL=(ALL) NOPASSWD:ALL
# in /etc/sudoers
# To repeat the last command as sudo:
sudo !!
# So, you don’t need to rewrite the whole command again just put ‘!!‘ will grab the last command and run it as sudo
# Run sudo on the last command in your history. Be careful though. <Up Arrow> & [Ctrl-a] sudo can be fast too and perhaps safer.
sudo arp-scan --localnet
# Find IPs of devices in local network
sudo [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live"
# ATTENTION: Remove System
#==============================##==============================#
# CMD SUDO #
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command sudo in a clear format. This allows users to quickly access the needed information for sudo without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for sudo are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
22 - 🖥️test
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the test command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ████████╗███████╗███████╗████████╗
# ╚══██╔══╝██╔════╝██╔════╝╚══██╔══╝
# ██║ █████╗ ███████╗ ██║
# ██║ ██╔══╝ ╚════██║ ██║
# ██║ ███████╗███████║ ██║
# ╚═╝ ╚══════╝╚══════╝ ╚═╝
# The test command checks file types and compare values. For example, you can use it in the following way:
$ test 7 -gt 5 && echo "true"
true
test=$(getent passwd | cut -d : -f 1 | tail -n 4);for name in $test;do ls -la /home/$name;done;
# bash one line to grab last four users from /etc/passwd and list permissions for files in the /home directory
test "$(ps -ocommand= -p $PPID | awk '{print $1}')" == 'script' (script -f --timing=$HOME/shell_logs/$(date +"%d-%b-%y_%H-%M-%S")_timing.log
$HOME/shell_logs/$(date +"%d-%b-%y_%H-%M-%S")_shell.log
# add 2 lines above to ~/.bashrc - kein schutz das User shell beendet
#==============================##==============================#
# CMD TEST #
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command test in a clear format. This allows users to quickly access the needed information for test without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for test are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
23 - 🖥️time
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the time command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ████████╗██╗███╗ ███╗███████╗
# ╚══██╔══╝██║████╗ ████║██╔════╝
# ██║ ██║██╔████╔██║█████╗
# ██║ ██║██║╚██╔╝██║██╔══╝
# ██║ ██║██║ ╚═╝ ██║███████╗
# ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝
# Make the output of the `time` builtin easier to parse
TIMEFORMAT=%R
# Explanation: The time builtin prints a summary of the real time, user CPU time and system CPU time spent executing commands, for example:
time sleep 1
# real 0m1.002s
# user 0m0.000s
# sys 0m0.002s
# If you need to parse this output, it helps to simplify it using the TIMEFORMAT variable. The value %R means "the elapsed time in seconds", for example:
TIMEFORMAT=%Rtime sleep 1
# 1.004
# The complete documentation of the format definition is in man bash, search for
TIMEFORMAT
# Export all Stremio movie names - I couldn't find movie library on any of the SQLlite Stremio databases, but on ~/.config/stremio/backgrounds2 the background image filenames corresponds to IMDB URL. So I foreach files and wget HTML title of each movie and save it to a file. This will retrieve all movie names, not just the Library.
time for movie in $(ls -1 /home/$USER/.config/stremio/backgrounds2 | sort -u);do wget -qO- --header="Accept-Language: en" "https://www.imdb.com/title/$movie/" | hxselect -s '\n' -c 'title' 2>/dev/null | tee ~/$(date +%Y-%m-%d_%T)-movie-list.txt ; done
time usleep 100000
# sleep for 1/10s or 1/100s or even 1/1000000s - sleep in microseconds instead of seconds Alternatively to usleep, which is not defined in POSIX 2008 (though it was defined up to POSIX 2004, and it is evidently available on Linux and other platforms with a history of POSIX compliance), the POSIX 2008 standard defines nanosleep Show Sample Output
time cat
# Instant stopwatch. Run to start timer and press Ctrl-D to stop it. "real" time is the elapsed time.
# Re-compress a gzip (.gz) file to a bzip2 (.bz2) file
time gzip -cd file1.tar.gz 2>~/logfile.txt | pv -t -r -b -W -i 5 -B 8M | bzip2 > file1.tar.bz2 2>>~/logfile .txt
# Explanation: *Requires PV (pipe viewer) if you want to monitor throughput; otherwise you can leave out the pv pipe. Transparently decompresses an arbitrary .gz file (does not have to be a tar) and re-compresses it to bzip2, which has better compression and error recovery. Echoes error messages to a file named logfile.txt in your home directory. NOTE: The original .gz file will NOT be deleted. If you want to save space, you will have to delete it manually.
# Test your hard drive speed
time (dd if=/dev/zero of=zerofile bs=1M count=500;sync);rm zerofile
# Explanation: Creates a 500MB blank file and times how long it takes to finish writing the entire thing to disk (sync)
time the entire dd + sync operation, and then remove the temporary file
# Limitations: Works with Bash; not tested in other environments
time tar jcvf largebackup.tar.bz2 /data
# Put 'time' before any command to record the real, system and user time it takes to complete.
# quick integer CPU benchmark
# You could have that little benchmark run on all cores in parallel, as a multi-core benchmark or stress test First find the number of cores, then have parallel iterate over that in, well, parallel
time cat /proc/cpuinfo |grep proc|wc -l|xargs seq|parallel -N 0 echo "2^2^20" '|' bc
# Sample output:
# ...
# 41454625947560171969501001538543925124881846970621917597708878154881\
# 18278788738248093374936943243527734573872009289119068940335579136
# real 0m12,698s
# user 0m14,461s
# sys 0m0,382s
# small CPU benchmark with PI, bc and time.
# Broken in two parts, first get the number of cores with cat /proc/cpuinfo |grep proc|wc -l and create a integer sequence with that number (xargs seq), then have GNU parallel loop that many times over the given command. Cheers!
time cat /proc/cpuinfo |grep proc|wc -l|xargs seq|parallel -N 0 echo "scale=4000\; a\(1\)\*4" '|' bc -l
# Sample output:
# ...
# 66983895228684783123552658213144957685726243344189303968642624341077\
# 3226978028073189154411010446823252716201052652272111660396
# real 0m31,847s
# user 0m59,085s
# sys 0m0,151s
# Redirect the output of the time builtin command
{ time command; } > out.out 2> time+err.out
# Explanation:
# time is a bash builtin command, and redirecting its output does not work the same way as with proper executables
# If you execute within braces like above, the output of time will go to stderr (standard error), so you can capture it with 2>time.out
# An alternative is to use the /usr/bin/time executable, by referring to its full path. (The path may be different depending on your system.)
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command time in a clear format. This allows users to quickly access the needed information for time without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for time are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
24 - 🖥️uname
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the uname command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██╗ ██╗███╗ ██╗ █████╗ ███╗ ███╗███████╗
# ██║ ██║████╗ ██║██╔══██╗████╗ ████║██╔════╝
# ██║ ██║██╔██╗ ██║███████║██╔████╔██║█████╗
# ██║ ██║██║╚██╗██║██╔══██║██║╚██╔╝██║██╔══╝
# ╚██████╔╝██║ ╚████║██║ ██║██║ ╚═╝ ██║███████╗
# ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝
# Print all system information
uname -a
# Linux system-hostname 3.2.0-4-amd64 #1 SMP Debian 3.2.32-1 x86_64 GNU/Linux
# Print the hostname
uname -n
# system-hostname
# Print the kernel release
uname -r
# 3.2.0-4-amd64
# Print the kernel version, with more specific information
uname -v
# #1 SMP Debian 3.2.32-1
# Print the hardware instruction set
uname -m
# x86_64
# Print the kernel name
uname -s
# Linux
# Print the operating system
uname -o
# GNU/Linux
# Get the running Kernel and Install date
uname -a;rpm -qi "kernel"-`uname -r`|grep "Install"
#==============================##==============================#
# CMD UNAME #
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command uname in a clear format. This allows users to quickly access the needed information for uname without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for uname are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
25 - 🖥️watch
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the watch command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██╗ ██╗ █████╗ ████████╗ ██████╗██╗ ██╗
# ██║ ██║██╔══██╗╚══██╔══╝██╔════╝██║ ██║
# ██║ █╗ ██║███████║ ██║ ██║ ███████║
# ██║███╗██║██╔══██║ ██║ ██║ ██╔══██║
# ╚███╔███╔╝██║ ██║ ██║ ╚██████╗██║ ██║
# ╚══╝╚══╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝
watch -n 0.5 "ps uf -C process1,process2"
# Continually watch processes with names
watch -t -n1 "date +%T|figlet"
# show animated digital clock in the terminal.
watch -n1 cat /proc/net/wireless
# Monitor your wireless card signal strength on the screen.
watch -n1 'echo $(( 1500000000 - $( date +%s )))'
# Waiting for epoch second 1.5 x 10^9
watch -n 5 "ls -la | grep something"
# Execute a linux command at regular intervals - Use Linux watch to execute a running command at certain time. Note the usage of double quotes to include a complex command, eg ls -la AND grep result
# Options:
# -n 5: exec every 5s
watch -d -n 1 "netstat -an | grep :8080"
# Use it all the time to watch for incoming connections on a certain port.
watch -n 1 curl -XGET 'http://localhost:9200/_cluster/health?pretty=true'
# Monitor ElasticSearch cluster health - Useful for keeping an eye on ES when rebalancing takes place
# Watch how many tcp connections there are per state every two seconds. - slighty shorter
watch -c "netstat -nt | awk 'FNR > 3 {print \$6}' | sort | uniq -c"
# Watch how many tcp connections there are per state every two seconds.
watch -c "netstat -natp 2>/dev/null | tail -n +3 | awk '{print \$6}' | sort | uniq -c"
# Monitor cpu in realtime.
watch grep \"cpu MHz\" /proc/cpuinfo
# Show dd status every so often
watch --interval 5 killall -USR1 dd
# Explanation: The dd command has no progress indicator. While copying large files it may seem like nothing is happening, as dd prints nothing until completed. However, when the dd process receives USR1 signal, it prints I/O statistics to standard error and resumes copying. Here we use killall to send the signal, and we call it with watch to repeat this every 5 seconds, effectively giving a progress indicator to good old dd.
# Start in one window the watch:
watch --interval 5 killall -USR1 dd
# Start copying in another:
# dd if=/dev/random of=junk bs=1000 count=1000
# dd: warning: partial read (13 bytes); suggest iflag=fullblock
# 0+2 records in
# 0+2 records out
# 21 bytes (21 B) copied, 3.01687 s, 0.0 kB/s
# 0+3 records in
# 0+3 records out
# 29 bytes (29 B) copied, 8.02736 s, 0.0 kB/s
# Beobachte alle localen Netzwerkverbindungen
watch -n2 "sed -n 's%.* src=\(192.168.[0-9.]*\).*%\1%p' /proc/net/ip_conntrack | sort | uniq -c | sort -gr"
# Execute a linux command at regular intervals - Use Linux watch to execute a running command at certain time. Note the usage of double quotes to include a complex command, eg ls -la AND grep result
watch -n 5 "ls -la | grep something"
# Options:
# -n 5: exec every 5s
# Watch TCP, UDP open ports in real time with socket summary.
watch ss -stplu
# Show top 50 running processes ordered by highest memory/cpu usage refreshing every 1s - http://alvinalexander.com/linux/unix-linux-process-memory-sort-ps-command-cpu for an overview of --sort available values
watch -n1 "ps aux --sort=-%mem,-%cpu | head -n 50"
# Perform Real-time Process Monitoring Using Watch Utility
watch -n 1 'ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head'
# Real-time monitoring monitoring of MySQL queries
watch -n 1 mysqladmin processlist
# The -n 1 specifies that mysqladmin executes every second. Depending on your set-up, you may need to specify a mysql user and password:
watch -n 1 mysqladmin --user=<user> --password=<password> processlist
#==============================##==============================#
# CMD WATCH
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command watch in a clear format. This allows users to quickly access the needed information for watch without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for watch are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
26 - 🖥️who
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the who command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██╗ ██╗██╗ ██╗ ██████╗
# ██║ ██║██║ ██║██╔═══██╗
# ██║ █╗ ██║███████║██║ ██║
# ██║███╗██║██╔══██║██║ ██║
# ╚███╔███╔╝██║ ██║╚██████╔╝
# ╚══╝╚══╝ ╚═╝ ╚═╝ ╚═════╝
# The who command shows who is logged on.
who
root :0 2017-03-03 09:39 (:0)
root pts/0 2017-03-03 09:41 (:0)
root pts/10 2017-03-03 14:51 (:0)
root pts/11 2017-03-03 15:41 (:0)
#==============================##==============================#
# CMD WHO #
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command who in a clear format. This allows users to quickly access the needed information for who without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for who are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
27 - 🖥️whoami
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the whoami command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██╗ ██╗██╗ ██╗ ██████╗ █████╗ ███╗ ███╗██╗
# ██║ ██║██║ ██║██╔═══██╗██╔══██╗████╗ ████║██║
# ██║ █╗ ██║███████║██║ ██║███████║██╔████╔██║██║
# ██║███╗██║██╔══██║██║ ██║██╔══██║██║╚██╔╝██║██║
# ╚███╔███╔╝██║ ██║╚██████╔╝██║ ██║██║ ╚═╝ ██║██║
# ╚══╝╚══╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝
# The whoami command prints effective userid of the current user.
whoami
root
#==============================##==============================#
# CMD WHOAMI #
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command whoami in a clear format. This allows users to quickly access the needed information for whoami without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for whoami are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
28 - 🖥️yes
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the yes command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██╗ ██╗███████╗███████╗
# ╚██╗ ██╔╝██╔════╝██╔════╝
# ╚████╔╝ █████╗ ███████╗
# ╚██╔╝ ██╔══╝ ╚════██║
# ██║ ███████╗███████║
# ╚═╝ ╚══════╝╚══════╝
yes "$(seq 231 -1 16)" | while read i; do printf "\x1b[48;5;${i}m\n"; sleep .02; done
# A rainbow in your shell.
yes "$(seq 19 21; seq 21 -1 18)" |while read i; do printf "\x1b[48;5;${i}m\n"; sleep .03; done
# Make some waves. Req 256-color term.
yes "$(seq 16 231)" | while read i; do printf "\x1b[48;5;${i}m\n"; sleep .02; done
# A color show in your shell.
yes $COLUMNS $LINES|pv -qL50|perl -ne'$|=1;($c,$r)=split;$s||=$"x($c*$r);print$s;$s=$"x$c.$s;substr$s,rand$c,1,"*";$s=substr$s,0,$c*$r+$c;'
#
yes "$(seq 231 -1 16)" | while read i; do printf "\x1b[48;5;${i}m\n"; sleep .02; done
# A "rainbow" in your shell.
yes "&" &
# Infinite ampersands, backgrounded. DoS
yes "$(seq 231 -1 16)" | while read i; do printf "\x1b[48;5;${i}m\n"; sleep .02; done
# A rainbow in your shell.
# Echo string over and over until CTRL-C
yes I am awesome
# Highlight increasing numbers. Something new I haven't tried. Piping output into a for loop and using timeout to dynamically change the filter on a timed basis.
yes {1..30} | for i in {1..30} ; do GREP_COLORS="mt=01;$((41+($i%7)))" timeout 1 egrep --color=auto "\b$i\b" ; done
#==============================##==============================#
# CMD YES
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command yes in a clear format. This allows users to quickly access the needed information for yes without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for yes are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░