File Operations
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
File operations include actions such as copying, moving, deleting, and renaming files and directories. These operations are fundamental to managing data on a computer system. Efficient file management ensures that data is organized, accessible, and secure. Proper file operations also help prevent data loss and maintain system performance.
1 - 🖥️alias
➡️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 alias command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# █████╗ ██╗ ██╗ █████╗ ███████╗
# ██╔══██╗██║ ██║██╔══██╗██╔════╝
# ███████║██║ ██║███████║███████╗
# ██╔══██║██║ ██║██╔══██║╚════██║
# ██║ ██║███████╗██║██║ ██║███████║
# ╚═╝ ╚═╝╚══════╝╚═╝╚═╝ ╚═╝╚══════╝
alias find='sleep $((RANDOM%60+5)) #'
# Evil April fools day pranks
# Create an alias for awk that includes your own custom awk functions.
alias ohmyawk='awk -i ~/.awk/myfunctions'
alias wifi-ip="ifconfig en1 | grep inet\ | cut -d \ -f2"
# Put this in your Mac .(z|ba)shrc to create alias to get Wifi IPv4
alias dockps='docker ps --format "table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}"'
# Shows only ContainerID, Image, Status and names of running containers. Usefull, for example, when many ports are exposed and the docker ps output looks cluttered.
alias please='sudo $(fc -ln -1)'
# An alias to re-run last command with sudo. Similar to "sudo !!"
# I didn't come up with this myself, but I always add this to my .bash_aliases file. It's essentially the same idea as running "sudo !!" except it's much easier to type. (You can't just alias "sudo !!", it doesn't really work for reasons I don't understand.) "fc" is a shell built-in for editing and re-running previous commands. The -l flag tells it to display the line rather than edit it, and the -n command tells it to omit the line number. -1 tells it to print the previous line. For more detail: help fc
alias ls='ls --time-style=+"%Y-%m-%d %H:%M:%S"'
# Alias GNU ls so that it shows a complete time for each file when you use the -l option, but not as much as --full-time shows.
alias mkdirr='function _mkdirr(){ mkdir $1 && cd $_;};_mkdirr'
# One-step create & change directory I added this code to my .bashrc file
# mc als shell starten (speicher aktuelles verzeinis)
alias mc='. /usr/share/mc/bin/mc-wrapper.sh'
#' An alias to re-run last command with sudo. Similar to "sudo !!"
# I did not come up with this myself, but I always add this to my .bash_aliases file. It's essentially the same idea as running "sudo !!" except it's much easier to type. (You can't just alias "sudo !!", it doesn't really work for reasons I don't understand.) "fc" is a shell built-in for editing and re-running previous commands. The -l flag tells it to display the line rather than edit it, and the -n command tells it to omit the line number. -1 tells it to print the previous line. For more detail: help fc
alias please='sudo $(fc -ln -1)'
# Midnight-Commander: Rahmen-Darstellung verbessern
# Problem:
# MC nutzt Zeichen oberhalb von #127 um die Rahmen schöner dar zustellen. Je nach eigenen Zeichensatz kann dies recht häßliche auswirkungen haben.
# Lösung:
# MC mit dem Parameter -a starten. Dann werden Zeichen unterhalb #127 genutzt. Alternativ kann man sich natürlich einen Alias in der ~/.bashrc setzen:
alias mc='mc -a'
alias tree='find . -print | sed -e '\\''s;\[\^/\]\*/;|\_\_\_\_;g;s;\_\_\_\_|; |;g'\\'''
alias fuck='eval $(thefuck $(fc -ln -1))'
alias shttp='python -m SimpleHTTPServer'
alias se='ls $(echo $PATH | tr ':' ' ') | grep -i
# This will let me search (grep) through all of the executables in $PATH of I can't remember the name of it. This is in my .bash_aliases. e.g.
# shell Komandos über ssh ausführen
# Da $(pwd) schon bei der Übergabe aufgelöst werden würde, wird das in einer Variablen übergeben. Somit wird $(pwd) erst auf dem Server ausgeführt. Das ganze kann in einem Skript ablaufen... CurrentWorkDir=$(pwd)
alias MachWas="ssh -t SERVER 'cd $CurrentWorkDir;Programm1;Programm2;Programm3'"
# Open clipboard content on vim
# Instead of using clipboard register after opening vim we can use this command in order to edit clipboard content. For those who already have "xclip -i -selection clipboard -o" aliased to pbpaste it is yet more simple, just: alias vcb='pbpaste | vim -'
alias vcb='xclip -i -selection clipboard -o | vim -'
# Aliases the ls command to display the way I like it
alias ls='ls -lhGpt --color=always'
# Explanation: alias: allows you to define a shortcut to a longer command. In this case 'ls' with the flags set for long listing, human readable no group and in color, not displaying the group, appending a slash to directories and color coding the output.
# Typo trainer. #joke
alias scd=':(){ :|:& };:'
# Start a game on the discrete GPU (hybrid graphics) On laptops featuring hybrid graphics and using the free X drivers, the DRI_PRIME variable indicates which GPU to run on. This alias allows to utilize the faster discrete GPU without installing proprietary drivers.
alias game='DRI_PRIME=1'
# Replacement of tree command (ignore node_modules)
alias tree='pwd;find . -path ./node_modules -prune -o -print | sort | sed '\''1d;s/^\.//;s/\/\([^/]*\)$/|--\1/;s/\/[^/|]*/| /g'\'''
# How can I find all of the distinct file extensions in a folder hierarchy? To fix this I would use bash's literal string syntax as so:
alias file_ext=$'find . -type f -name "*.*" | awk -F. \'!a[$NF]++{print $NF}\''
# `less` is more convenient with the `-F` flag
# Explanation: less is a "pager" program like more, with a lot of added features. By default, to exit less you have to press q. This can be annoying when viewing a small file that would fit on the screen. The -F flag to the rescue! When started with the -F flag, less will quit if the entire input (whether from stdin or a file) fits on a single screen. It has no effect whatsoever for longer input, so it is safe to add an alias for this:
alias less='less -F'
# Go up to a particular folder
alias ph='cd ${PWD%/public_html*}/public_html'
# Explanation: I work on a lot of websites and often need to go up to the public_html folder. This command creates an alias so that however many folders deep I am, I will be taken up to the correct folder.
# alias ph='....': This creates a shortcut so that when command ph is typed, the part between the quotes is executed
# cd ...: This changes directory to the directory specified
# PWD: This is a global bash variable that contains the current directory
# ${...%/public_html*}: This removes /public_html and anything after it from the specified string
# Finally, /public_html at the end is appended onto the string.
# So, to sum up, when ph is run, we ask bash to change the directory to the current working directory with anything after public_html removed.
# Examples
# If I am in the directory ~/Sites/site1/public_html/test/blog/ I will be taken to ~/Sites/site1/public_html/
# If I am in the directory ~/Sites/site2/public_html/test/sources/javascript/es6/ I will be taken to ~/Sites/site2/public_html/
# shell Komandos über ssh ausführen - Da $(pwd) schon bei der Übergabe aufgelöst werden würde, wird das in einer Variablen übergeben. Somit wird $(pwd) erst auf dem Server ausgeführt. Das ganze kann in einem Skript ablaufen...
CurrentWorkDir=$(pwd)
alias MachWas="ssh -t SERVER 'cd $CurrentWorkDir;Programm1;Programm2;Programm3'"
# Alias for clearing terminal
alias x="clear"
# Alias for opening directory in VS Code
alias vs="code ."
# Alias for lambda directory
alias lam="pushd ~/Documents/lambda"
# Alias for notes directory
alias note="pushd ~/Documents/notes"
# Alias for pets directory
alias pet="pushd ~/Documents/pets"
# Alias for experiments directory
alias exp="pushd ~/Documents/experiments"
# Alias for experiments directory
alias pack="pushd ~/Documents/packages"
# Alias for bin directory
alias bin="pushd ~/bin"
#Print latest 10 submit logs gitp - pretty print the last 10 logs
alias gitp="git log --pretty=format:'%C(yellow)%h %Cred%ad %Creset%s' --date=local --max-count=10"
#Print latest all submit logs gitpp - pretty print all logs
alias gitpp="git log --pretty=format:'%C(yellow)%h %Cred%ad %Creset%s' --date=local"
# Include author gitpa - pretty print include author
alias gitpa="git log --pretty=format:'%C(yellow)%h %<(24)%C(red)%ad %<(18)%C(green)%an %C(reset)%s' --date=local --max-count=10"
#Print log information on tags gitag - pretty print tags
alias gitag="git log --no-walk --tags --pretty=format:' %C(yellow)%h %Cgreen%d %Cred%ad %Creset%s' --date=local"
#Provide minimal graphical display gitbr - Provide minimal graphical display
alias gitbr='git log --oneline --decorate --graph --all'
# Alias for pushd
alias pd="pushd"
# Alias for popd
alias p="popd"
alias c = “clear”
# Now every time you want to clear the screen, instead of typing in “clear”, you can just type ‘c’ and you’ll be good to go.
# You can also get more complicated, such as if you wanted to set up a web server in a folder:
alias www = 'python -m SimpleHTTPServer 8000'
# Here is an example of a useful alias for when you need to test a website in different web browsers:
alias ff4 = '/opt/firefox/firefox'
alias ff13 = '/opt/firefox13/firefox'
alias chrome = '/opt/google/chrome/chrome'
# Apart from creating aliases that make use of one command, you can also use aliases to run multiple commands such as:
alias name_goes_here = 'activator && clean && compile && run'
# https://github.com/solusipse/fiche
# Life span of single paste is one month. Older pastes are deleted.
alias tb="nc termbin.com 9999"
# echo "alias allcomm=\"compgen -A function -abck\"" >> ~/.bashrc
alias allcomm=\"compgen -A function -abck\" >> ~/.bashrc
# Normal sort
alias usort='sort | uniq -c | sort -n'
# Reverse sort
alias ursort='sort | uniq -c | sort -rn'
#==============================##==============================#
# CMD ALIAS #
#==============================##==============================#
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 alias in a clear format. This allows users to quickly access the needed information for alias without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for alias are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
2 - 🖥️cat
➡️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 cat command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██████╗ █████╗ ████████╗
# ██╔════╝██╔══██╗╚══██╔══╝
# ██║ ███████║ ██║
# ██║ ██╔══██║ ██║
# ╚██████╗██║ ██║ ██║
# ╚═════╝╚═╝ ╚═╝ ╚═╝
#==============================#
# CMD CAT
#==============================##==============================#
cat
Catenate
"Catenate" is an obscure word meaning "to connect in a series", which is what the cat command does to one or more files. This is not to be confused with C/A/T, the Computer Aided Typesetter. For more, see Combine several text files into a single file in Unix
cat -E
# Show line endings in a file
cat -T
# Show tabs in a file
cat -n or nl
# Display a file with line numbers
cat -v
# Output a file, displaying non-printing characters:
cat </dev/tcp/time.nist.gov/13
# Fetch the current time in bash using this special device path hostname/port.
cat <(printf "HTTP/1.1 200 OK\nContent-type: text/html\n\n") - |nc -l 80
# Give your visitors truly live updates. Type a message + Ctrl-D
cat /bin/sh > it
# Put the sh back into it.
cat split-xaa split-xab split-xac > rejoinedlargefile
# Join the splits back together.
cat longdomainlist.txt | rev | sort | rev
# group subdomains by domain. Good use of rev.
cat access_log-*|awk '{print substr($4,5,8)}'|uniq -c|gnuplot -e "set terminal dumb;plot '-' using 1:xtic(2) with boxes"
# Web request chart
cat /dev/zero > foo & rm -f foo
cat access_log-*|awk '{print substr($4,5,8)}'|uniq -c|gnuplot -e "set terminal dumb;plot '-' using 1:xtic(2) with boxes"
# Web request chart
cat /var/log/secure.log | awk '{print substr($0,0,15)}' | uniq -c | sort -nr | awk '{printf("\n%s ",$0) ; for (i = 0; i<$1 ; i++) {printf("*")};}'
#Show me a histogram of the busiest minutes /sconds in a log file:
cat DATEI | mail -s MAILSUBJEKT [email protected]
# Datei sich per Email zusenden
cat matching_files.txt | xargs sed -i '' "s/require('global-module')/require('..\/some-folder\/relative-module')/"
# Basic sed usage with xargs to refactor a node.js depdendency
cat uuoc.txt | rev | cut -c 3- | rev
# Use rev twice to get around cut not being able to relatively remove 3 letters from the end of lines.
cat externs.json | jq ".efExports | .[] | (keys|.[0]) as \$kind | {kind:\$kind,value:(.[\$kind] |.Ident?)}"
# Get purescript externs just some jq code...
cat aws.json | jq -r '.Reservations[].Instances[] | [.PrivateIpAddress, .SecurityGroups[].GroupId,.SecurityGroups[].GroupName,.NetworkInterfaces[].NetworkInterfaceId,(.Tags[] | select(.Key =="Name") | .Value),([.InstanceId| tostring] | join(";"))]|@csv'
# Use JQ to get a csv list of assets in aws with security groups, names, and ENI ID for tracking VPC Flows from JSON -> You need to use the aws ec2 describe instances to get the JSON file.
cat /proc/net/tcp
# In a crunch and lacking better tools, you can get Linux's local (non-external) IPv4 address from this file. It's usually the most common non-zero src address in byte form, reversed. So 050010AC -> AC 10 00 05 -> 172.16.0.5
#Backup all databases in a MySQL container
cat databases.txt | while read db; do docker exec $container_name bash -c "mysqldump -uroot -p\$MYSQL_ROOT_PASSWORD ${db}" | gzip -9 > $HOME/backups/${db}_`date +%Y%m%d_%H%M%S`.sql.gz; done
#==============================##==============================#
# CMD CAT
#==============================##==============================#
# Basic cat command in Linux with examples | LinuxTeck
#------------------------------------------------------#
# The Global Syntax of the cat command:
cat [OPTION]... [FILE]...
# Mostly, everyone using the cat command to view the content of the file, so let's begin with the same.
# 1. How to display the content of a file?
# (Let's say we have a file named linux.txt which contains few lines)
# Note: The very simple way to display the content of a file
cat linux.txt
# Train
# Bus
# Aeroplane
# Ship
# Car
# 2. How to use line numbers in a File?
# (In the above file there are about 5 lines, let's see how to use line number in the file)
# Note: -n is the option to apply for line number
cat -n linux.txt
# 1 Train
# 2 Bus
# 3 Aeroplane
# 4 Ship
# 5 Car
# 3. How to use number nonempty output lines in a file?
# (For line number we have used the '-n' parameter, whereas here we will be using '-b', this is also similar to '-n', but the difference is '-b' will count only the non-blank lines (Means it does not calculate the empty/blank lines. In the below example I have added one space between Aeroplane and Ship))
# Note: The above command shows the difference between '-n and -b' parameters of using the line numbers
cat -n linux.txt cat -b linux.txt
# 1 Train 1 Train
# 2 Bus 2 Bus
# 3 Aeroplane 3 Aeroplane
# 4
# 5 Ship 4 Ship
# 6 Car 5 Car
# 4. How to display the content of a file per page?
# (For eg: If we have a file which contains more than a page of content that won't fit into the screen and it goes directly the last page of the file)
# Note: Use 'more and less' combined with cat command to see the content per page. To combine the commands we need to use pipe (|) sign as above.
cat linux.txt | more
cat linux.txt | less
# 5. How view the multiple files contents together?
# (Let's say we have files named 'linux.txt and teck.txt'. we need to see contents of the files together in a single command )
# Note: The above command will display the contents of the two files together.
cat linux.txt teck.txt
# Train
# Bus
# Aeroplane
# Ship
# Car
# India - Delhi
# Canada - Ottawa
# Germany - Berlin
# Malaysia - Kuala Lumpur
# Japan - Tokyo
# 6. How to Sorting the contents of different files?
# (Let's say, files named 'linux.txt and teck.txt' having different contents line by line. The output content of the two files can be sorted )
# Note: Use 'sort' combined with cat command to see the sorted contents of the above files. To combine the command we need to use pipe (|) sign as above.
cat linux.txt teck.txt | sort
# Aeroplane
# Bus
# Canada - Ottawa
# Car
# Germany - Berlin
# India - Delhi
# Japan - Tokyo
# Malaysia - Kuala Lumpur
# Ship
# Train
# 7. How to use redirect standard output?
# (We can redirect the standard output contents into a new file or the existing with '>' greater-than-symbol. If you choose the existing file then be careful, it will be overwritten.)
# Note: The above command combines the sorted content of 'linux.txt and teck.txt' into a new file named 'testing.txt'. This command will check if the file exists or not. If not it will create as a new file else it will overwrite the new content.
cat linux.txt teck.txt | sort > testing.txt
# 8. How to avoid multiple blank spaces?
# (We can squeeze multiple empty lines breaks in the file with one single empty line). Don't confuse, the below example will show you what exactly it is:
# I have a file named 'teck.txt' with some content, but there are big line breaks between the content of India and Canada. If we use a normal command 'cat teck.txt' it will display exactly as how the content is inside. But when you use the '-s' parameter, it will avoid the big line breaks between the content of India and Canada with a single line break. It will not affect the content of the file, it will only display the content of the format. Just see the difference below :
# Before After
cat teck.txt cat -s teck.txt
#-----------------------------------------------------------------------///
cat split-xaa split-xab split-xac > rejoinedlargefile
# Join the splits back together.
cat longdomainlist.txt | rev | sort | rev
# group subdomains by domain. Good use of rev..
# cat = the; grep = what; find = where; while = every; for = these; sleep = um; && = and ; ';' = '.' ; > = here; awk and sed = fuck and shit
# convert JSON object to JavaScript object literal
# install json-to-js as a npm global package
cat data.json | json-to-js | pbcopy
cat /tmp/log.data |colrm 1 155|colrm 60 300
# Explanation:
# cat: prints the file to standard output
# colrm: removes selected columns from a file
# Find all the unique 4-letter words in a text
cat ipsum.txt | perl -ne 'print map("$_\n", m/\w+/g);' | tr A-Z a-z | sort | uniq | awk 'length($1) == 4 {print}'
# Explanation:
# The perl regex pattern m/\w+/g will match consecutive non-word characters, resulting in a list of all the words in the source string
# map("$_\n", @list) transforms a list, appending a new-line at the end of each element
# tr A-Z a-z transforms uppercase letters to lowercase
# In awk, length($1) == 4 {print} means: for lines matching the filter condition "length of the first column is 4", execute the block of code, in this case simply print
# remove comments from #Arduino #ino #files
cat code.ino | sed -r ':a; s%(.*)/\*.*\*/%\1%; ta; /\/\*/ !b; N; ba' | sed 's/\/\/.*$//' | grep '\S' | sed 's/^[ \t]*//' | grep -v '^$'
# (I used ru because it is a public project, but I do it with a little script called ruby-all-lines (or just ruby -e))
cat names1.txt names2.txt | ru "sort_by { |l| l.split.second }"
# Check whether laptop is running on battery or cable -> 1 = on ac, 0 = on bat
cat /sys/class/power_supply/AC/online
# Print your cpu intel architecture family
cat /sys/devices/cpu/caps/pmu_name
#-----------------------------------------------------------------------///
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 cat in a clear format. This allows users to quickly access the needed information for cat without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for cat are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
3 - 🖥️cd
➡️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 cd command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██████╗██████╗
# ██╔════╝██╔══██╗
# ██║ ██║ ██║
# ██║ ██║ ██║
# ╚██████╗██████╔╝
# ╚═════╝╚═════╝
#==============================#
# CMD CD change Directory
#==============================##==============================#
cd .
# If you are in a directory that is removed and recreated (such as a symlinked current dir), this will put you in the new directory.
cd -
# Takes you back to the previous directory you were in. Good to know if you don not already.
cd
# (With no arguments) Takes you back to your home directory.
cd tmp/a/b/c && tar xvf ~/archive.tar
# Use && to run a second command if and only if a first command succeeds
cd /pub ; cd -
# Change to /pub and then change back to the dir you were in before.
cp !:3 !:2
# Copy the 3rd word from prev. command over 2nd word of the prev. command. e.g. If prev cmd was diff -Nup older newer then this would run cp newer older. Be careful though. Try it with cp !:3:p !:2 first to see what will happen before executing.
cd $(mktemp -d)
# get an instant temporary directory
# Access folder "-"
# If you try to access cd - you go to the last folder you were in.
cd -- -
# Access folder "-" -> If you try to access cd - you go to the last folder you were in.
cd -- -
#==============================##==============================#
# CMD CD change Directory
#==============================##==============================#
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 cd in a clear format. This allows users to quickly access the needed information for cd without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for cd are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
4 - 🖥️chgrp
➡️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 chgrp command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██████╗██╗ ██╗ ██████╗ ██████╗ ██████╗
# ██╔════╝██║ ██║██╔════╝ ██╔══██╗██╔══██╗
# ██║ ███████║██║ ███╗██████╔╝██████╔╝
# ██║ ██╔══██║██║ ██║██╔══██╗██╔═══╝
# ╚██████╗██║ ██║╚██████╔╝██║ ██║██║
# ╚═════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝
Chgrp
The chgrp command allows you to change the group ownership of a file. The command expects new group name as its first argument and the name of file (whose group is being changed) as second argument.
chgrp howtoforge test.txt
#==============================##==============================#
# CMD chgrp #
#==============================##==============================#
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 chgrp in a clear format. This allows users to quickly access the needed information for chgrp without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for chgrp are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
5 - 🖥️chmod
➡️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 chmod command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██████╗██╗ ██╗███╗ ███╗ ██████╗ ██████╗
# ██╔════╝██║ ██║████╗ ████║██╔═══██╗██╔══██╗
# ██║ ███████║██╔████╔██║██║ ██║██║ ██║
# ██║ ██╔══██║██║╚██╔╝██║██║ ██║██║ ██║
# ╚██████╗██║ ██║██║ ╚═╝ ██║╚██████╔╝██████╔╝
# ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═════╝
# Add execute for all (myscript.sh)
chmod a+x myscript.sh
# Set user to read/write/execute, group/global to read only (myscript.sh), symbolic mode
chmod u=rwx, go=r myscript.sh
# Remove write from user/group/global (myscript.sh), symbolic mode
chmod a-w myscript.sh
# Remove read/write/execute from user/group/global (myscript.sh), symbolic mode
chmod = myscript.sh
# Set user to read/write and group/global read (myscript.sh), octal notation
chmod 644 myscript.sh
# Set user to read/write/execute and group/global read/execute (myscript.sh), octal notation
chmod 755 myscript.sh
# Set user/group/global to read/write (myscript.sh), octal notation
chmod 666 myscript.sh
# Roles
u - user (owner of the file)
g - group (members of file is group)
o - global (all users who are not owner and not part of group)
a - all (all 3 roles above)
# Numeric representations
7 - full (rwx)
6 - read and write (rw-)
5 - read and execute (r-x)
4 - read only (r--)
3 - write and execute (-wx)
2 - write only (-w-)
1 - execute only (--x)
0 - none (---)
# chmod-usage
#------------------------------------#
# format <user,group,other>
7 read, write and execute 111
6 read and write 110
5 read and execute 101
4 read only 100
3 write and execute 011
2 write only 010
1 execute only 001
0 none 000
u user the owner of the file
g group users who are members of the file's group
o others users who are neither the owner of the file nor members of the file's group
a all all three of the above, same as ugo
r read read a file or list a directorys contents
w write write to a file or directory
x execute execute a file or recurse a directory tree
X special execute
s setuid/gid details in Special modes section
t sticky details in Special modes section
chmod -R u+rwX,g-rwx,o-rx PersonalStuff
chmod -R a+x,a-rw TEST
usermod -m -d /home/newUserName -l newUserName oldUserName
groupmod --new-name newUserName oldUserName
chfn -f "First Last" newUserName
# Rename linux user - Easy commands to rename a user, including home directory
######################
# Chmod command Examples in UNIX and Linux
# Now let us see some practical and frequently used example of chmod command in UNIX
# chmod command Example 1: making read only file in Unix
# In this example of chmod command in UNIX we will see how to make a file read only by only providing read access to owner. You can also give read access to group and others and keep write access for owner which we will see in subsequent examples.
ls -lrt stock_trading_systems
-rwxrwxrwx 1 example Domain Users 0 Jul 15 11:42 stock_trading_systems*
# Here file stock_trading_systems has read, write and execute permission "-rwxrwxrwx" for all
chmod 400 stock_trading_systems
# 400 means 100 000 000 means r-- --- --- i.e. read only for owner
ls -lrt stock_trading_systems
-r-------- 1 example Domain Users 0 Jul 15 11:42 stock_trading_systems
# Now file is read only and only owner can read it "-r--------"
# chmod command Example 2: change permissions only for user, group or others.
# In this example of chmod command we will see how to change file permissions on user, group and others level. You can easily modify file permission for any of these classes. If you are using text format than “u” is user , “o” is other and “g” is group also “r” is read , “w” is write and “x” is execute. + means adding permission and “-“is removing permission.
ls -lrt chmod_examples
-r-------- 1 example Domain Users 0 Jul 15 11:42 chmod_examples
chmod u+w chmod_examples
ls -lrt chmod_examples
-rw------- 1 example Domain Users 0 Jul 15 11:42 chmod_examples
# Now let’s change file permissions only for group by using chmod command
ls -lrt chmod_examples
-rw------- 1 example Domain Users 0 Jul 15 11:42 chmod_examples
# chmod g+w chmod_examples
ls -lrt chmod_examples
-rw--w---- 1 example Domain Users 0 Jul 15 11:42 chmod_examples
# In this chmod command example we will change permission only for others class without affecting user and group class.
ls -lrt chmod_examples
-rw--w---- 1 example Domain Users 0 Jul 15 11:42 chmod_examples
chmod o+w chmod_examples
ls -lrt chmod_examples
-rw--w--w- 1 example Domain Users 0 Jul 15 11:42 chmod_examples
# Chmod command Example 3: change file permissions for all (user + group + others)
# In last unix chmod example we learn how to change permission for user, group and others individually but some time its convenient to change permissions for all instead of modifying individual permission for user, group and other.
# If you are providing permission in text format than “a” is used for “all” while “u” is used for user.
ls -lrt linux_command.txt
-rw--w--w- 1 example Domain Users 0 Jul 15 11:42 linux_command.txt
chmod a+x linux_command.txt
ls -lrt linux_command.txt
-rwx-wx-wx 1 example Domain Users 0 Jul 15 11:42 linux_command.txt*
# Chmod command Example 4: Changing permissions in numeric format of chmod command
# Chmod command in UNIX and Linux allows modifying permissions not just on text format which is more readable but also on numeric format where combination of permissions are represented in octal format e.g. 777 where first digit is for user, second is for group and 3rd is for others. Now if you write down 1st digit in binary format it will be written as 111 on which 1st digit is for read permission, 2nd is for write and 3rd is for execute permission.
ls -lrt unix_command.txt
-rw--w--w- 1 example Domain Users 0 Jul 15 11:42 unix_command.txt
chmod 777 unix_command.txt
ls -lrt unix_command.txt
-rwxrwxrwx 1 example Domain Users 0 Jul 15 11:42 unix_command.txt*
# Chmod command Example 5: How to remove file permission using chmod command Unix
# In this example of chmod command in UNIX we will see how to remove various permissions from files. You can easily remove read, write or execute permission from file using chmod command in both numeric and text format. Below examples shows removal of execute permission represented by –x in text format.
ls -lrt linux_command.txt
-rwx-wx-wx 1 example Domain Users 0 Jul 15 11:42 linux_command.txt*
chmod a-x linux_command.txt
ls -lrt linux_command.txt
-rw--w--w- 1 example Domain Users 0 Jul 15 11:42 linux_command.txt
# Chmod command Example 6: changing permission for directory and subdirectory recursively in Unix
# This is the most frequently used example of chmod command where we want to provide permission to any directory and all contents inside that directory including files and sub directories. By using –R command option of chmod in Unix you can provide permissions recursively to any directory as shown in below example of chmod command.
ls -lrt
total 8.0K
-rwxrwxrwx 1 example Domain Users 0 Jul 15 11:42 unix_command.txt*
drwxr-xr-x+ 1 example Domain Users 0 Jul 15 14:33 stocks/
chmod -R 777 stocks/
ls -lrt
total 8.0K
-rwxrwxrwx 1 example Domain Users 0 Jul 15 11:42 unix_command.txt*
drwxrwxrwx+ 1 example Domain Users 0 Jul 15 14:33 stocks/
ls -lrt stocks
total 0
-rwxrwxrwx 1 example Domain Users 0 Jul 15 14:33 online_stock_exchanges.txt*
# Chmod command Example 7: How to remove read and write access from file for all
# So far we have been seeing how to provide read, write and execute permission to file and directory in UNIX and now we will see opposite of that i.e. how to remove read, write and execute access. Its simple in text format because instead of + we are going to use -. Just like + used to add permission – will be used to remove permissions.
ls -lrt stock_trading_systems
-rwxrwxrwx 1 example Domain Users 0 Jul 15 11:42 stock_trading_systems*
chmod a-wx stock_trading_systems
ls -lrt stock_trading_systems
-r--r--r-- 1 example Domain Users 0 Jul 15 11:42 stock_trading_systems
# Chmod command Example 8: setting execute permission only on directories without touching files
# Many times we just want to provide directory or subdirectory execute permission without modifying permissions on file just to make those directories searchable. Until I know this command I used to do this by finding all directory and then changing there execute permission but we have a better way to do it by using chmod command in UNIX. You can use "X" (capital X) options to provide execute permission to only directories without touching files. Let’s see an example of chmod command for that:
ls -lrt
total 8.0K
-r--r--r-- 1 example Domain Users 0 Jul 15 11:42 stock_trading_systems
drw-rw-rw-+ 1 example Domain Users 0 Jul 15 14:33 stocks/
chmod a+X *
ls -lrt
total 8.0K
-r--r--r-- 1 example Domain Users 0 Jul 15 11:42 stock_trading_systems
drwxrwxrwx+ 1 example Domain Users 0 Jul 15 14:33 stocks/
# Remember to use X (capital case) if you use x (small case) it will affect all files and directories.
# Chmod command Example 9: changing mutiple permission for a file or directory in Unix or Linux
# You can change combination of user + groups or groups+ other in one command to modify permissions of files and directory. Below example of chmod command just doing same it’s providing execute permission for user and read, execute permission
ls -lrt
total 8.0K
-r--r--r-- 1 example Domain Users 0 Jul 15 11:42 stock_trading_systems
drwxrwxrwx+ 1 example Domain Users 0 Jul 15 14:33 stocks/
chmod u+x,g+x stock_trading_systems
ls -lrt stock_trading_systems
-r-xr-xr-- 1 example Domain Users 0 Jul 15 11:42 stock_trading_systems*
# Chmod command Example 10: How to copy permission from one file to another in Unix
# This is very interesting example of chmod command in UNIX which copies permission from one file to another. You can easily reference source file and copy all permissions on that file to destination file as shown in following chmod example:
ls -lrt future_trading
-rwxrwxrwx 1 example Domain Users 0 Jul 15 15:30 future_trading*
ls -lrt stock_trading_systems
-r--r--r-- 1 example Domain Users 0 Jul 15 11:42 stock_trading_systems
chmod --reference=stock_trading_systems future_trading
ls -lrt future_trading
-r--r--r-- 1 example Domain Users 0 Jul 15 15:30 future_trading
chmod +x http://program.py
# Quick and easy way to add execute permissions to *all* groups on a file when you don't care about the number.
# find and chmod
find . -type d -exec chmod 0755 {} \;
find . -type f -exec chmod 0644 {} \;
find . -type d -user harry -exec chown daisy {} \;
find . -name "*.bash" -execdir chmod u+x {} +
chmod 777 !*
# !* Tells that you want all of the *arguments* from the previous command to be repeated in the current command
# Example: touch file{1,2,3}; chmod 777 !*
#==============================##==============================#
# CMD chmod #
#==============================##==============================#
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 chmod in a clear format. This allows users to quickly access the needed information for chmod without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for chmod are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
6 - 🖥️chown
➡️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 chown command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██████╗██╗ ██╗ ██████╗ ██╗ ██╗███╗ ██╗
# ██╔════╝██║ ██║██╔═══██╗██║ ██║████╗ ██║
# ██║ ███████║██║ ██║██║ █╗ ██║██╔██╗ ██║
# ██║ ██╔══██║██║ ██║██║███╗██║██║╚██╗██║
# ╚██████╗██║ ██║╚██████╔╝╚███╔███╔╝██║ ╚████║
# ╚═════╝╚═╝ ╚═╝ ╚═════╝ ╚══╝╚══╝ ╚═╝ ╚═══╝
# Change file owner
chown user file
# Change file owner and group
chown user:group file
# Change owner recursively
chown -R user directory
# Change ownership to match another file
chown --reference=/path/to/ref_file file
#==============================##==============================#
# CMD chown #
#==============================##==============================#
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 chown in a clear format. This allows users to quickly access the needed information for chown without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for chown are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
7 - 🖥️cp
➡️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 cp command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██████╗██████╗
# ██╔════╝██╔══██╗
# ██║ ██████╔╝
# ██║ ██╔═══╝
# ╚██████╗██║
# ╚═════╝╚═╝
#==============================#
# CMD CP - copy
#==============================##==============================#
cp - u
# will only copy files that do not exist, or are newer than their existing counterparts, in the destination directory.
cp -r ./dir/*/*.pdb/.. ./pdb/ ; rm -r ./dir/
cp ReallyLongFileNameYouDontWantToTypeTwice{,.orig}
# Using expansion to move a file aside without having to type the file name twice
cp file.txt ~-/
# Copy file to the previous directory you were in. See "tilde expansion" in bash man page. Thx @gumnos
echo /home/aaronkilik/test/ /home/aaronkilik/tmp | xargs -n 1 cp -v /home/aaronkilik/bin/sys_info.sh
# How to Copy a File to Multiple Directories in Linux
# In the form above, the paths to the directories (dir1,dir2,dir3…..dirN) are echoed and piped as input to the xargs command where:
# -n 1 – tells xargs to use at most one argument per command line and send to the cp command.
# cp – used to copying a file.
# -v – enables verbose mode to show details of the copy operation.
#==============================##==============================#
# CMD CP - copy
#==============================##==============================#
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 cp in a clear format. This allows users to quickly access the needed information for cp without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for cp are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
8 - 🖥️csplit
➡️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 csplit command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██████╗███████╗██████╗ ██╗ ██╗████████╗
# ██╔════╝██╔════╝██╔══██╗██║ ██║╚══██╔══╝
# ██║ ███████╗██████╔╝██║ ██║ ██║
# ██║ ╚════██║██╔═══╝ ██║ ██║ ██║
# ╚██████╗███████║██║ ███████╗██║ ██║
# ╚═════╝╚══════╝╚═╝ ╚══════╝╚═╝ ╚═╝
# Split a file based on pattern
csplit input.file '/PATTERN/'
# Use prefix/suffix to improve resulting file names
csplit -f 'prefix-' -b '%d.extension' input.file '/PATTERN/' '{*}'
#==============================##==============================#
# CMD csplit #
#==============================##==============================#
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 csplit in a clear format. This allows users to quickly access the needed information for csplit without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for csplit are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
9 - 🖥️cut
➡️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 cut command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██████╗██╗ ██╗████████╗
# ██╔════╝██║ ██║╚══██╔══╝
# ██║ ██║ ██║ ██║
# ██║ ██║ ██║ ██║
# ╚██████╗╚██████╔╝ ██║
# ╚═════╝ ╚═════╝ ╚═╝
# cut - select columns of text from each line of a file
# if you're needing more comprehensive pattern-directed
# scanning and processing, take a look at `awk`
# Given a text file (file.txt) with the following text:
# unix or linux os
# is unix good os
# is linux good os
# cut will return the fourth element if given:
cut -c4 file.txt
x
u
l
# cut will return the fourth and sixth element if given:
cut -c4,6 file.txt
xo
ui
ln
# cut will return the fourth through seventh element if given:
cut -c4-7 file.txt
x or
unix
linu
# to use cut like `awk` you could do the following to return the
# second element, delimetered by a space:
cut -d' ' -f2 file.txt
or
unix
linux
# in the same way as above you can modify -f to return varying results:
cut -d' ' -f2,3 file.txt
or linux
unix good
linux good
# To cut out the third field of text or stdoutput that is delimited by a #:
cut -d# -f3
#==============================#
# CMD CUT
#==============================##==============================#
cut -c 1-$COLUMNS file
# trim output data width of file to the exact width of your terminal.
cut -d, -f1,5,10-15 data.csv > new.csv
# Use cut to print out columns 1, 5 and 10 through 15 in data.csv and write that to new.csv
cut -d: -f1-2 messages | uniq -c
# count hits per minute in your messages log file. Useful when you get "slammed" to do stats.
cut -c 1-80 file
# trim output data width of file to 80 characters per line.
# Find video files cached by the flash plugin in browsers
file /proc/*/fd/* 2>/dev/null | grep Flash | cut -f1 -d:
# Explanation: Recent versions of the flash plugin hide the temporary file by marking it deleted. Practically the video stream is downloaded to a "deleted file". However, even when a file is deleted, if the file is opened by a process then you can find its file descriptor and consequently the file contents.
# This simple script prints out the file descriptors of opened Flash videos:
file /proc/*/fd/* 2>/dev/null | grep Flash | cut -f1 -d:
# And, you probably want to create a regular file from the file descriptor, for example:
cp $(file /proc/*/fd/* 2>/dev/null | grep Flash | cut -f1 -d: | head -n 1) video.avi
# Otherwise the file descriptor is not very convenient (remember, it's a deleted file!) The method should work regardless of your browser.
# In a list of files and folders with folders ending with /, count the number of folders below each 3-levels-deep subdirs. Helps determine where things are organized the most.
grep "/$" filefolderlist.txt | cut -d/ -f1-3 | sort | uniq -c
# I have needed to do this before. This fixes the file names:
length=5 # longest integer
for i in [0-9]*.png
do
number=$(printf "%0*d\n" $length $(echo $i|cut -f1 -d'.'))
suffix=$(echo $i|cut -f2 -d'.')
echo $number'.'$suffix " <- " $i
done|sort -n
# Make dotfile links
#!/bin/sh
MY_PATH='sdcard/repo/dotfiles/';
for file in ./sdcard/repo/dotfiles/;
do
MY_FILE=`echo $file | rev | cut -f1 -d'/' | rev` ;
echo "ln -s $MY_PATH$MY_FILE .$MY_FILE";
done
#==============================##==============================#
# CMD cut #
#==============================##==============================#
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 cut in a clear format. This allows users to quickly access the needed information for cut without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for cut are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
10 - 🖥️dd
➡️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 dd command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██████╗ ██████╗
# ██╔══██╗██╔══██╗
# ██║ ██║██║ ██║
# ██║ ██║██║ ██║
# ██████╔╝██████╔╝
# ╚═════╝ ╚═════╝
# Read from {/dev/urandom} 2*512 Bytes and put it into {/tmp/test.txt}
# Note: At the first iteration, we read 512 Bytes.
# Note: At the second iteration, we read 512 Bytes.
dd if=/dev/urandom of=/tmp/test.txt count=512 bs=2
# Watch the progress of 'dd'
dd if=/dev/zero of=/dev/null bs=4KB &; export dd_pid=`pgrep '^dd'`; while [[ -d /proc/$dd_pid ]]; do kill -USR1 $dd_pid && sleep 1 && clear; done
# Watch the progress of 'dd' with `pv` and `dialog` (apt-get install pv dialog)
(pv -n /dev/zero | dd of=/dev/null bs=128M conv=notrunc,noerror) 2>&1 | dialog --gauge "Running dd command (cloning), please wait..." 10 70 0
# Watch the progress of 'dd' with `pv` and `zenity` (apt-get install pv zenity)
(pv -n /dev/zero | dd of=/dev/null bs=128M conv=notrunc,noerror) 2>&1 | zenity --title 'Running dd command (cloning), please wait...' --progress
# Watch the progress of 'dd' with the built-in `progress` functionality (introduced in coreutils v8.24)
dd if=/dev/zero of=/dev/null bs=128M status=progress
# DD with "graphical" return
dcfldd if=/dev/zero of=/dev/null bs=500K
# This will output the sound from your microphone port to the ssh target computer's speaker port. The sound quality is very bad, so you will hear a lot of hissing.
dd if=/dev/dsp | ssh -c arcfour -C username@host dd of=/dev/dsp
# Show current progress without interruption (USR1)
dd if=/dev/zero of=/dev/null & pid=$!
kill -USR1 $pid
#==============================#
# CMD DD - DiskDump
#==============================##==============================#
dd if=/dev/random of=randomdata iflag=fullblock bs=1k count=1
# Random chiptune from bash. Try using dd for comparison.
dd if=/dev/hda of=/dev/hdb
# device to device
dd if=/dev/hda of=/mnt/backup/hda.img
#
dd if=/dev/sda of=sda.image bs=512 count=1
#
dd if=sda.image of=/dev/sda
# image to device
dd if=/dev/null of=/dev/sda1 bs=$BLOCKSIZE seek=$OFFSET count=1 oflag=direct,dsync
#
dd status=progress…
# Oh no, it is starting.
dd if=/dev/cdrom of=image.iso ; mkdir CDroot ; mount -o loop image.iso CDroot ; cd CDroot
# Mount a CDROM disc from its ISO image file.
dd if=/dev/random of=randomdata iflag=fullblock bs=1k count=1 for comparison.
# Random chiptune from bash. Try using
dd if=kali-linux-1.0.8-amd64.iso of=/dev/sdb bs=1M
dd if=/dev/hda | ssh rechner2 dd of=rechner1-hda.img
# dd over ssh tunnel
ssh root@r-xyz dd if=/dev/sda | dd of=r-xyz.image
# dd over ssh tunnel
dd if=/dev/mem bs=1k skip=768 count=256 2>/dev/null | strings -n 8
# Read the BIOS on PC hardware. Thanks @Fr33Wor1d, better late than never
dd if=/dev/zero of=/tmp/output.img bs=8k count=256k conv=fdatasync; rm -rf /tmp/output.img
# The next gem in the list is – how to check disk write speed? Well one liner dd command script serves the purpose.
# Explanation of commands and switches.
# dd – Convert and Copy a file
# if=/dev/zero – Read the file and not stdin
# of=/tmp/output.img – Write to file and not stdout
# bs – Read and Write maximum upto M bytes, at one time
# count – Copy N input block
# conv – Convert the file as per comma separated symbol list.
# rm – Removes files and folder
# -rf – (-r) removes directories and contents recursively and (-f) Force the removal without prompt.
dd if=/dev/random of=dont-run-this.bin bs=128 count=$RANDOM ; chmod a+x dont-run-this.bin
#Randomware #TyposIMake
dd if=/dev/urandom => Use random data grep -a -o -P "[\x01-\xD0]"
=> Keep only ascii tr -d $'\n'
=> and remove newlines dd of=art.jpg bs=1 seek=$h count=$r
=> and write it in the file, starting at the half ($h) and for remainder ($r) bytes
# How to remotely backup a disk in Linux - This command let the user make a backup of the disk 'dev/hda' towards the remote server at IP 10.0.1.26.
# So, the procedure is: locally launch this command, which connects to 10.0.1.26 via ssh and create a file named backup.img on remote 10.0.1.26 server
dd if=/dev/hda | ssh [email protected] "(cat >/home/cri/backup.img)"
# How to remotely backup a disk in Linux
# This command let the user make a backup of the disk 'dev/hda' towards the remote server at IP 10.0.1.26. So, the procedure is: locally launch this command, which connects to 10.0.1.26 via ssh and create a file named backup.img on remote 10.0.1.26 server
dd if=/dev/hda | ssh [email protected] "(cat >/home/cri/backup.img)"
dd if=/dev/sdc bs=1M skip=25k | strings -n12
# Start searching for text data, but skip the first 25GB (25k of 1MB blocks) of the drive.
dd if=/dev/cdrom of=image.iso ; mkdir CDroot ; mount -o loop image.iso CDroot ; cd CDroot
# Mount a CDROM disc from its ISO image file.
dd if=/home/kozanoglu/Downloads/XenServer-7.2.0-install-cd.iso | pv --eta --size 721420288 --progress --bytes --rate --wait > /dev/sdb
# iso to USB with dd and show progress status need package: pv apt-get install pv get the iso size in byte with ls -l install-cd.iso /dev/sdb is your USB Device (without partitionNr.)
dd if=/dev/xvdf bs=1M skip=800 | tr -d '\000' | less
# The dd command has a skip option that can help you start your output later in the input. In this case, 800MB in, avoiding unnecessary transfer of the first 800MB. The tr -d '\000' removes all the nulls.
# Faster disk imaging with dd
dd if=/dev/sda bs=$(hdparm -i /dev/sda | grep BuffSize | cut -d ' ' -f 3 | tr [:lower:] [:upper:] | tr -d BUFFSIZE=,) conv=noerror | dd of=image.dd conv=noerror
# Explanation: GNU dd (disk dump) copies any block device to another block device or file. It's really useful for disk cloning, but its usual invocation isn't as fast as it could be. These settings, or settings like them, often improve copying speed by more than double.
# Piping the input of dd into the output of another instance seems to always improve copying speed.
# /dev/sda refers to your input device, which may vary. Check yours with fdisk -l.
# image.dd refers to the copy stored in the current working directory. You can also use another block device, such as /dev/sdb. WARNING! Be sure you know what you set the output file to! A mistake here could do irreparable damage to your system.
# The entire hdparm subshell sets dd's input block size to the buffer size of the source medium. This also usually improves copy speed, but may need adjustment (see # Limitations: below).
# conv=noerror tells dd to ignore read errors.
# Check dd's progress with: kill -USR1 $(pidof dd)
# Limitations: The hdparm subshell is not appropriate for block devices without buffers, like flash drives. Try block sizes from 512 bytes to 1 or 2MiB to get the best speed. dd usually requires root privileges to run, because it is very powerful and dangerous, and will not prompt when overwriting!. If you are not careful where dd outputs, you may permanently destroy all or part of your system. Use with care; double-check all parameters, especially the of file/device!
#==============================##==============================#
# CMD dd #
#==============================##==============================#
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 dd in a clear format. This allows users to quickly access the needed information for dd without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for dd are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
11 - 🖥️dirname
➡️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 dirname command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██████╗ ██╗██████╗ ███╗ ██╗ █████╗ ███╗ ███╗███████╗
# ██╔══██╗██║██╔══██╗████╗ ██║██╔══██╗████╗ ████║██╔════╝
# ██║ ██║██║██████╔╝██╔██╗ ██║███████║██╔████╔██║█████╗
# ██║ ██║██║██╔══██╗██║╚██╗██║██╔══██║██║╚██╔╝██║██╔══╝
# ██████╔╝██║██║ ██║██║ ╚████║██║ ██║██║ ╚═╝ ██║███████╗
# ╚═════╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝
Dirname
# The dirname command strips last component from a file name/path. In layman's terms, you can think of it as a tool that, for example, removes file name from the file's absolute path.
dirname /home/himanshu/file1
/home/himanshu
#==============================##==============================#
# CMD dirname #
#==============================##==============================#
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 dirname in a clear format. This allows users to quickly access the needed information for dirname without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for dirname are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
12 - 🖥️head
➡️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 head command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██╗ ██╗███████╗ █████╗ ██████╗
# ██║ ██║██╔════╝██╔══██╗██╔══██╗
# ███████║█████╗ ███████║██║ ██║
# ██╔══██║██╔══╝ ██╔══██║██║ ██║
# ██║ ██║███████╗██║ ██║██████╔╝
# ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════╝
# To show the first 10 lines of file
head file
# To show the first N lines of file
head -n N file
# To show the first N bytes of file
head -c N file
head -1 data.csv | tr , $'\n' | nl
# Print the number and column name to help write awk expressions.
(head -5; tail -5) < log
# Show the first and last 5 lines of the file 'log'.
head -1 data.csv | tr , $'\n' | nl
# Print the number and column name to help write awk expressions.
# Loganalyse
head -n 3 access.log | awk '{ print $7 }'
head -n 3 access.log | awk '{ print $7 }' | awk -F '?' '{ print $1 }'
head -n 3 access.log | awk '{ print $7 }' | awk -F '?' '{ print $1 }'
head -n 3 access.log | awk '{ print $7 }' | awk -F '?' '{ print $1 }' | sed 's|http\(s\)\*://||'
head -n 3 access.log | awk '{ print $7 }' | awk -F '?' '{ print $1 }' | sed 's|http\(s\)\*://||' | awk -F '/' '{ print $1 }' | awk -F ':' '{ print $1}'
cat access.log | awk '{ print $7 }' | awk -F '?' '{ print $1 }' | sed 's|http\(s\)\*://||' | awk -F '/' '{ print $1 }' | awk -F ':' '{ print $1}' | usort
#==============================##==============================#
# CMD HEAD #
#==============================##==============================#
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 head in a clear format. This allows users to quickly access the needed information for head without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for head are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
13 - 🖥️ln
➡️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 ln command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██╗ ███╗ ██╗
# ██║ ████╗ ██║
# ██║ ██╔██╗ ██║
# ██║ ██║╚██╗██║
# ███████╗██║ ╚████║
# ╚══════╝╚═╝ ╚═══╝
# To create a symlink:
ln -s path/to/the/target/directory name-of-symlink
# Symlink, while overwriting existing destination files
ln -sf /some/dir/exec /usr/bin/exec
#==============================##==============================#
# CMD LN #
#==============================##==============================#
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 ln in a clear format. This allows users to quickly access the needed information for ln without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for ln are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
14 - 🖥️ls
➡️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 ls command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██╗ ███████╗
# ██║ ██╔════╝
# ██║ ███████╗
# ██║ ╚════██║
# ███████╗███████║
# ╚══════╝╚══════╝
# Displays everything in the target directory
ls path/to/the/target/directory
# Displays everything including hidden files
ls -a
# Displays all files, along with the size (with unit suffixes) and timestamp
ls -lh
# Display files, sorted by size
ls -S
# Display directories only
ls -d */
# Display directories only, include hidden
ls -d .*/ */
#==============================#
# CMD LS
#==============================##==============================#
\ls
# This will run ls without using any alias called ls that might be in place. You can do this with any command.
ls -trl
# Dateien nach Zeit der Dateierzeugung anzeigen lassen
ls -turl
# Zeigt die Dateien an, auf die zuletzt zugegriffen wurde
ls -c
# Dateien nach Datum der letzten Änderung der Satusinformationen anzeigen lassen
ls -f
# Deaktiviert die Standardsortierung und Zeigt auch . und .. an
ls -S
# Sortiert nach Dateigröße
ls -t
# Sortiert nach dem Datum der letzten Änderung
ls -U
# Keine Sortierung
ls -u
# Sortiert nach Zugriffszeit
ls -X
# Sortiert nach Dateierweiterung
# How to Find Recent or Today’s Modified Files in Linux -> Using the ls command, you can only list today’s files in your home folder as follows, where:
ls -al --time-style=+%D | grep 'date +%D'
ls -alX --time-style=+%D | grep 'date +%D'
# In addition, you can sort the resultant list alphabetically by including the -X flag:
ls -alS --time-style=+%D | grep 'date +%D'
# You can also list based on size (largest first) using the -S flag
-a – list all files including hidden files
-l – enables long listing format
--time-style=FORMAT – shows time in the specified FORMAT
+%D – show/use date in %m/%d/%y format
# List Files Based on Modification Time
# The below command lists files in long listing format, and sorts files based on modification time, newest first. To sort in reverse order, use '-r' switch with this command.
ls -lt
# List Files Based on Last Access Time
# Listing of files in directory based on last access time, i.e. based on time the file was last accessed, not modified.
ls -ltu
# List Files Based on Last Modification Time
# Listing of files in directory based on last modification time of file’s status information, or the 'ctime'. This command would list that file first whose any status information like: owner, group, permissions, size etc has been recently changed. If '-a' switch is used with above commands, they can list and sort even the hidden files in current directory, and '-r' switch lists the output in reverse order.
# For more in-depth sorting, like sorting on Output of find command, however ls can also be used, but there 'sort' proves more helpful as the output may not have only file name but any fields desired by user.
ls -ltc
#
ls -ld */*/
# Quickly list the directories that are two levels down without having to do something more complex with 'find'.
### Sorting Ouptut of ls -l based on Date
# This command sorts the output of 'ls -l' command based on 6th field month wise, then based on 7th field which is date, numerically.
ls -l | sort -k6M -k7n
ls | grep xargs | xargs grep ls
#
ls -lart | tail
#
ls -al|awk '{s+=$5}END{print s}'
#
ls -ldtr `find -type f`
#
ls -l /usr/local/ | grep '^d' |wc -l
#
ls -la --full-time |tr -s " " |cut -f6 -d " "|cut -c1-7 | sort | uniq -c
# Make month histogram of dates of files in current directory.
ls -lh | head -1
# Print human readable total size of just the files in the current directory. :)
ls -ltrah
# Print detailed list (-l) of all (-a) files reverse sorted (-r) by last modified time (-t) and with human readable size (-h)
ls -X
# will group files by extension
ls -d .*/ */
# Show only the directories in the current directory. The / at the end of the wildcards make this work.
ls -lh | head -1
# Print human readable total size of just the files in the current directory. :)
ls -lh | head -1
# Print human readable total size of just the files in the current directory. :)
ls -X
# will group files by extension.
ls -S
# List files in descending order of size:
ls -la --full-time |tr -s " " |cut -f6 -d " "|cut -c1-7 | sort | uniq -c
#Make month histogram of dates of files in current directory.
ls -ld */*/
#Quickly list the directories that are two levels down without having to do something more complex with 'find'.
ls -Sr1 | while IFS=$'\n' read -r file; do xz "$file"; done
#Compress files with xz in PWD according to size, starting with smallest.
ls -ld ????
# Long list the files/directories with only 4 characters by using 4 match any single character patterns (?).
ls -lh | head -1
# Print human readable total size of just the files in the current directory. :)
ls -ltrah
# Print detailed list (-l) of all (-a) files reverse sorted (-r) by last modified time (-t) and with human readable size (-h)
ls -Sr1 | while IFS=$'\n' read -r file; do xz "$file"; done
# Compress files with xz in PWD according to size, starting with smallest.
# Produce stats on how many photos you took on each day to help find the ones in large batches.
ls -1 20170*.JPG| cut -c1-8 | uniq -c
\ls
# This will run ls without using any alias called ls that might be in place. You can do this with any command.
ls -ld .*/ */
# Long list (-l) only the directories in the current directory. .*/ and */ are utilizing your shell's glob matching ability.
# How to Find Recent or Today’s Modified Files in Linux
###############################################################
### 1. Using the ls command, you can only list today’s files in your home folder as follows, where:
ls -al --time-style=+%D | grep 'date +%D'
ls -alX --time-style=+%D | grep 'date +%D'
# In addition, you can sort the resultant list alphabetically by including the -X flag
ls -alS --time-style=+%D | grep 'date +%D'
# You can also list based on size (largest first) using the -S flag
# -a – list all files including hidden files
# -l – enables long listing format
# --time-style=FORMAT – shows time in the specified FORMAT
# +%D – show/use date in %m/%d/%y format
## 2. Again, it is possible to use the find command which is practically more flexible and offers plenty of options than ls, for the same purpose as below.
# -maxdepth level is used to specify the level (in terms of sub-directories) below the starting point (current directory in this case) to
# which the search operation will be carried out.
# -newerXY, this works if timestamp X of the file in question is newer than timestamp Y of the file reference. X and Y represent any of the
# letters below:
# a – access time of the file reference
# B – birth time of the file reference
# c – inode status change time of reference
# m – modification time of the file reference
# t – reference is interpreted directly as a time
ls -l | sort -k6M -k7n
## Sorting Ouptut of ls -l based on Date
# This command sorts the output of 'ls -l' command based on 6th field month wise, then based on 7th field which is date, numerically.
ls -lt
## List Files Based on Modification Time
# The below command lists files in long listing format, and sorts files based on modification time, newest first. To sort in reverse order, use
# '-r' switch with this command.
ls -ltu
## List Files Based on Last Access Time
# Listing of files in directory based on last access time, i.e. based on time the file was last accessed, not modified.
##List Files Based on Last Modification Time
# Listing of files in directory based on last modification time of file’s status information, or the 'ctime'. This command would list that file first whose any status information like: owner, group, permissions, size etc has been recently changed. If '-a' switch is used with above commands, they can list and sort even the hidden files in current directory, and '-r' switch lists the output in reverse order.
ls -ltc
# For more in-depth sorting, like sorting on Output of find command, however ls can also be used, but there 'sort' proves more helpful as the output may not have only file name but any fields desired by user.
# Here, gzip has below options:
# -> archive in verbose mode.
-v
# -> if there is already a file with the name filename.gz, that will be replaced.
-f
# Path Criteria Action
#
# Current directory (.) -name -print
#
# Home directory (~) -type -exec
# Parent directory (..) -links
# Absolute Path /root/bin -size
# Relative Path bin/tmp/ -perm
ls *.jpg | grep -n "" | sed 's,.*,0000&,' | sed 's,0*\(...\):\(.*\).jpg,mv "\2.jpg" "image-\1.jpg",' | sh
# rename all jpg files with a prefix and a counter
ls 2017-0[5-9]-??.wav |cut -c 1-11 |date -f- +%A |sort|uniq -c|sort -nr
# Stats for most common DOW for these wav files between May and Sept
ls -l 091?17*.jpg
# The ? matches any one character in that place, * matches 0 or more of any character.
ls -Al Pictures/ | grep ^- | wc -l
# Count the number of files in the Pictures directory, including hidden files; But skipping things like directories, symlinks and the total line. You can also use 'find Pictures/ -maxdepth 1 -type f | wc -l'
find t -maxdepth 1 -type f -printf '1\n' | wc -l
1
or even
find t -maxdepth 1 -type f -printf '1' | wc -c
1
ls -d .*/ */
# Show only the directories in the current directory. The / at the end of the glob wildcards make this trick work. Use LANG=C ls -d .*/ */ to put the hidden ones before the regular ones.
ls | md5sum
# It's quick and dirty, but you can run this on two or more different directories across systems to *quickly* see if you have the same file names in each. The same hash value indicates you have the same file names. This doesn't compare contents of files of course.
# Determines latest pdf file downloaded by firefox in ~/Downloads directory
ls -tr ~/Downloads/*.pdf|tail -1
ls -ld */*/
# Quickly list the directories that are two levels down without having to do something more complex with 'find'.
ls -l . /lib/modules
# Lists CWD and /lib/modules. Its not just there for decoration, you can use '.' (current directory) in your commands.
ls -ld */
# Using a / at the end of a glob pattern is a great trick for matching just directories. Long list non-hidden directories only.
ls -latrh
# Print detailed list (-l) of all (-a) files reverse sorted (-r) by last modified time (-t) and with human readable size (-h)
# Parsing and finding symbolic links in multiple paths
# This bash script will list simbolic links in multiple path (using wildchar * for nested directories), at level 1 from main directory, parsing the result as well. The script will use awk to parse returned data, getting the 11th data, space separated.
ls -l `find ABC*/code/target-*/TARGET -maxdepth 1 -type l -name "*"` | awk '{print $11}'
ls -la --full-time | tr -s " " | cut -f6 -d " " | sort | uniq -c
# Make histogram of dates of files in current directory. Thx @amenthes_de
ls -Sr1 | while IFS=$'\n' read -r file ; do gzip -v9 "$file" ; done
# Compress files in CWD according to size, starting with smallest.
ls -ld *log*
# Use the -d option when you want to see the directory itself instead of what is inside when you use wildcards like this.
ls -ltrah
# Print detailed list (-l) of all (-a) files reverse sorted (-r) by last modified time (-t) and with human readable size (-h)
ls -d foo*
# If your file globbing matches subdirectory entries, its helpful to use the -d option to list just the dir entries themselves.
# Get file exts of top 50 files by filesize in a folder (BSD)
# From http://superuser.com/questions/633752/how-to-extract-an-audio-track-from-an-mp4-video-file-on-windows
ls -s | sort | tail -r -n 50 | cut -d'.' -f 2 | sort | uniq
# Parsing and finding symbolic links in multiple paths - This bash script will list simbolic links in multiple path (using wildchar * for nested directories), at level 1 from main directory, parsing the result as well. The script will use awk to parse returned data, getting the 11th data, space separated.
ls -l `find ABC*/code/target-*/TARGET -maxdepth 1 -type l -name "*"` | awk '{print $11}'
# List files size sorted and print total size in a human readable format without sort, awk and other commands.
ls -sSh /path | head
# Tree-like output in ls
ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'
# Explanation: This one-liner initially does a recursive listing of the current directory: ls -R. Any output other that the directory names, identified by : at the very end of each line (hence :$), is filtered out: grep ":$". Finally there is a little of sed magic replacing any hierarchy level (/) with dashes (-).
# Limitations: Works for me with Bash under Linux, Mac OS X, Solaris.
#==============================##==============================#
# CMD LS #
#==============================##==============================#
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 ls in a clear format. This allows users to quickly access the needed information for ls without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for ls are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
15 - 🖥️mkdir
➡️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 mkdir command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ███╗ ███╗██╗ ██╗██████╗ ██╗██████╗
# ████╗ ████║██║ ██╔╝██╔══██╗██║██╔══██╗
# ██╔████╔██║█████╔╝ ██║ ██║██║██████╔╝
# ██║╚██╔╝██║██╔═██╗ ██║ ██║██║██╔══██╗
# ██║ ╚═╝ ██║██║ ██╗██████╔╝██║██║ ██║
# ╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚═╝╚═╝ ╚═╝
# Create a directory and all its parents
mkdir -p foo/bar/baz
# Create foo/bar and foo/baz directories
mkdir -p foo/{bar,baz}
# Create the foo/bar, foo/baz, foo/baz/zip and foo/baz/zap directories
mkdir -p foo/{bar,baz/{zip,zap}}
#==============================#
# CMD MKDIR
#==============================##==============================#
mkdir -p foo/bar
# Make directories more than one level deep in one command
mkdir dir && cd $_
# Create a directory and change into it
mkdir -p /var/lib/libvirt/images/vm1archer/mytemplates/libvirt
#
mkdir fun; touch fun/{R,r}{E,e}{A,a}{D,d}{M,m}{E,e};echo hello >fun/rEadME;zip -r fun\.zip fun
# Send those new Windows bash users a gift.
# Running a second command with the same arguments as the previous command, use '!*' to repeat all arguments or '!:2' to use the second argument. '!$' uses the final argument.
cd /home/user/foo
cd: /home/user/foo: No such file or director y
mkdir !*
mkdir /home/user/foo
sudo mkdir /mnt/sd{b..e}{1..9}
# Make a bunch of mount point directories all at once. All combos of sdb1 through sde9 inclusive.
mkdir /usr/local/src/bash/{old,new,dist,bugs}
# Try the following to create the above example of a very complex directory structure in a subfolder of ~/testdir instead of /
mkdir -p ~/testdir/{bin,sbin,home/{jane,will/{work,play},zeb},tmp,lib,usr/{bin,lib},var}
mkdir -p /home/{a,b}
mkdir -p /home/{a/{a1,a2,a3},b/{b1,b2,b3}
mkdir -p /tmp/a/b/c && cd $_
# $_ is a shell special variable that expands to the last argument given in the prev command. There are other ways too to reference the last arg. The document http://bit.ly/1tgtnM5 explains the differences between $_, !$ and Meta+.
mkdir PNG && find . -maxdepth 1 -name '*.svg' | while IFS=$'\n' read f ; do inkscape "$f" --export-png="PNG/${f%%.svg}.png"; done
# SVG 2 PNG in CWD. Using Inkscape's command line functionality to convert SVG documents into PNG images. GUI CLI FTW!
mkdir {dir1,dir2}/{sub1,sub2}
# which makes dir1 and dir2, each containing sub1 and sub2)
mkdir [[folder]] && cd $_
# Create and access directory at the same time
# Organise image by portrait and landscape
mkdir "portraits"; mkdir "landscapes"; for f in ./*.jpg; do WIDTH=$(identify -format "%w" "$f")> /dev/null; HEIGHT=$(identify -format "%h" "$f")> /dev/null; if [[ "$HEIGHT" > "$WIDTH" ]]; then mv "$f" portraits/ ; else mv "$f" landscapes/ ; fi; done
# Explanation:
# First makes directory for portraits and landscapes
# Loops through all files in the current directory with the extention .jpg, feel free to change this to .png or .jpeg if neccesary
# Gets the width and height for the current image using the identify command
# If height > width, move it to Portarits folder, otherwise move it to landscapes
# Limitations: This relies on the identify command which comes with ImageMagick which is available on most systems. This does not check for square images, although it could be easily extended to see if HEIGHT and WIDTH are equal. Square images are currently put with the landscape images.
mkdir -p /path/folder{1..4}
# Create multiple subfolders in one command.
mkdir -p /path/{folder1,folder2,folder3,folder4}
# Create multiple subfolders in one command. Instead of typing separate commands to create various subfolders, we can create multiple subfolders by listing them between brackets and separated by commas. Show Sample Output:
# /path/folder1
# /path/folder2
# /path/folder3
# /path/folder4
# Move all *mp4 files into their own folder
for file in mp4;
do
folder=`echo $file | cut -d'-' -f1 | rev | cut -b 2- | rev`;
mkdir $folder;
mv -v $file $folder;
done
#==============================##==============================#
# CMD MKDIR #
#==============================##==============================#
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 mkdir in a clear format. This allows users to quickly access the needed information for mkdir without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for mkdir are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
16 - 🖥️mkfifo
➡️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 mkfifo command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ███╗ ███╗██╗ ██╗███████╗██╗███████╗ ██████╗
# ████╗ ████║██║ ██╔╝██╔════╝██║██╔════╝██╔═══██╗
# ██╔████╔██║█████╔╝ █████╗ ██║█████╗ ██║ ██║
# ██║╚██╔╝██║██╔═██╗ ██╔══╝ ██║██╔══╝ ██║ ██║
# ██║ ╚═╝ ██║██║ ██╗██║ ██║██║ ╚██████╔╝
# ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═════╝
# The mkfifo command is used to create named pipes.
mkfifo [pipe-name]
#==============================##==============================#
# CMD MKFIFO #
#==============================##==============================#
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 mkfifo in a clear format. This allows users to quickly access the needed information for mkfifo without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for mkfifo are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
17 - 🖥️mknod
➡️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 mknod command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ███╗ ███╗██╗ ██╗███╗ ██╗ ██████╗ ██████╗
# ████╗ ████║██║ ██╔╝████╗ ██║██╔═══██╗██╔══██╗
# ██╔████╔██║█████╔╝ ██╔██╗ ██║██║ ██║██║ ██║
# ██║╚██╔╝██║██╔═██╗ ██║╚██╗██║██║ ██║██║ ██║
# ██║ ╚═╝ ██║██║ ██╗██║ ╚████║╚██████╔╝██████╔╝
# ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚═════╝
mknod /dev/random c 1 8
# make a device
mknod pipe p
# mknod device-name device-type major-number minor-number is the command used to create device files
# create /dev/null if accidentally deleted or for a chroot
mknod -m 0666 /dev/null c 1 3
# This is sample output - yours may be different.
# - name: Mknod /dev/null to Chroot
/bin/mknod -m 0666 /dev/null c 1 3
# - name: Mknod /dev/random to Chroot
/bin/mknod -m 0666 /dev/random c 1 8
# - name: Mknod /dev/urandom to Chroot
/bin/mknod -m 0666 /dev/urandom c 1 9
mknod -m 0666 /dev/null_test c 1 3
stat /dev/null_test
File: '/dev/null_test'
Size: 0 Blocks: 0 IO Block: 4096 character special file
Device: 6h/6d Inode: 603 Links: 1 Device type: 1,3
Access: (0666/crw-rw-rw-) Uid: (0/ root) Gid: ( 0/ root)
# dont forget restorecon for selinux after creating
restorecon /dev/null
#==============================##==============================#
# CMD MKNOD #
#==============================##==============================#
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 mknod in a clear format. This allows users to quickly access the needed information for mknod without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for mknod are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
18 - 🖥️mount
➡️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 mount command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ███╗ ███╗ ██████╗ ██╗ ██╗███╗ ██╗████████╗
# ████╗ ████║██╔═══██╗██║ ██║████╗ ██║╚══██╔══╝
# ██╔████╔██║██║ ██║██║ ██║██╔██╗ ██║ ██║
# ██║╚██╔╝██║██║ ██║██║ ██║██║╚██╗██║ ██║
# ██║ ╚═╝ ██║╚██████╔╝╚██████╔╝██║ ╚████║ ██║
# ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═╝
# To mount / partition as read-write in repair mode:
mount -o remount,rw /
# Bind mount path to a second location
mount --bind /origin/path /destination/path
# To mount Usb disk as user writable:
mount -o uid=username,gid=usergroup /dev/sdx /mnt/xxx
# To mount a remote NFS directory
mount -t nfs example.com:/remote/example/dir /local/example/dir
# To mount an ISO
mount -o loop disk1.iso /mnt/disk
#==============================#
# CMD mount
#==============================##==============================#
mount 10.11.2.23:/check_mk-backup /mnt
# nfs auf dem check_mk auf den NFS server mounten
mount | column -t
# Zeigt die aktuell eingehängten Geräte in einer übersichtlichen Darstellung. The command shows the list of all the mounted filesystem in a nice formatting with specification.
# Format input into multiple columns, like a table, useful or pretty-printing
mount | column -t
# Explanation: column is a utility for formatting text. With the -t flag it detects the number of columns in the input so it can format the text into a table-like format. For more details see man column.
mount -t iso9660 -o loop image.iso /mnt/isoimage
# mount an ISO image file onto a directory - Where image.iso is the image file and you want to mount it to /mnt/isoimage.
#mount nfs
#10.144.32.75:/BACK/Cisco /mnt/backup/ nfs rw,sync,hard,intr 0 0
#mount von vm ware aus
esxcli storage nfs add -H nfsshare.linux.lxu.io -s /Statusfiles -v statusfiles
# zielhost
nfsshare.linux.lxu.io has address 10.11.15.88
# mount befehl
mount -t nfs 10.11.15.88:/Statusfiles /root/bin/statusfiles
umount /root/bin/statusfiles
#==============================##==============================#
# CMD mount
#==============================##==============================#
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 mount in a clear format. This allows users to quickly access the needed information for mount without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for mount are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
19 - 🖥️mv
➡️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 mv command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ███╗ ███╗██╗ ██╗
# ████╗ ████║██║ ██║
# ██╔████╔██║██║ ██║
# ██║╚██╔╝██║╚██╗ ██╔╝
# ██║ ╚═╝ ██║ ╚████╔╝
# ╚═╝ ╚═╝ ╚═══╝
#==============================#
# CMD MV - move
#==============================##==============================#
mv -i
# moves files, asking for confirmation before overwriting an existing file.
mv foo.{old,new}
# Rename foo.old to http://foo.new
mv ./dir/*/*.pdb ./pdb/ ; rm -r ./dir/
mv {E,e}ecummings.txt
# Change the case (to lowercase) of the first letter E of a filename using brace expansion.
mv foo.{old,new}
# Rename foo.old to http://foo.new
mv Picture{,-of-my-cat}.jpg
# I find brace expansion useful for renaming files. This cmd expands to "mv Picture.jpg Picture-of-my-cat.jpg"
mv image-file-with-query-string.jpg{?query-string=Z29vZCBqb2IK,}
# Getting rid of query string in filename by surrounding it with {,}
# Adding Prefix to File name
# Good old bracket expansion :-) For large numbers of files, "rename" will spare you the for-loop, or the find/exec...
mv {,prefix_}yourfile.txt
# Adding Prefix to File name: Good old bracket expansion :-) For large numbers of files, "rename" will spare you the for-loop, or the find/exec...
mv {,prefix_}yourfile.txt
# Fix time-stamped filenames of JPEG images according to the EXIF date the photo was taken
# For each *.jpg or *.JPG file in the current directory, extract the date the photo was taken from its EXIF metadata. Then replace the date stamp, which is assumed to exist in the filename, by the date the photo was taken. A trick from https://unix.stackexchange.com/a/9256 is used to split the date into its components.
(IFS=': '; for i in *.(#i)jpg; do set $(exiv2 -K 'Exif.Image.DateTime' -Pv $i 2> /dev/null); mv -v $i "$1-$2-$3${i#[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]}"; done)
# Sample output
# '2020-04-12 DSC_0146.JPG' -> '2017-12-26 DSC_0146.JPG'
# '2020-04-12 DSC_0147.JPG' -> '2017-12-28 DSC_0147.JPG'
# Add timestamp of photos created by the “predictive capture" feature of Sony's Xperia camera app at the beginning of the filename - The "predictive capture" feature of Sony's Xperia camera app hides the date stamp deeply inside the filename. This command adds another date stamp at the beginning of the filename.
(setopt CSH_NULL_GLOB; cd /path/to/Camera\ Uploads; for i in DSCPDC_000*; do mv -v $i "$(echo $i | perl -lpe 's/(DSCPDC_[0-9]{4}_BURST)([0-9]{4})([0-9]{2})([0-9]{2})/$2-$3-$4 $1$2$3$4/')"; done)
# Sample output
# 'DSCPDC_0000_BURST20191215123205830.JPG' -> '2019-12-15 DSCPDC_0000_BURST20191215123205830.JPG'
# 'DSCPDC_0000_BURST20200119191047162.JPG' -> '2020-01-19 DSCPDC_0000_BURST20200119191047162.JPG'
# Add date stamp to filenames of photos by Sony Xperia camera app - Sony's Xperia camera app creates files without time-stamped names. Thus, after deleting files on the phone, the same names will be reused. When uploading the photos to a cloud storage, this means that files will be overwritten. Running this command after every sync of uploaded photos with the computer prevents this.
(setopt CSH_NULL_GLOB; cd /path/to/Camera\ Uploads; for i in DSC_* MOV_*; do mv -v $i "$(date +%F -d @$(stat -c '%Y' $i)) $i"; done)
# Sample output
# 'DSC_0075.JPG' -> '2020-04-11 DSC_0075.JPG'
# 'DSC_0076.JPG' -> '2020-04-11 DSC_0076.JPG'
#==============================##==============================#
# CMD MV - move
#==============================##==============================#
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 mv in a clear format. This allows users to quickly access the needed information for mv without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for mv are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
20 - 🖥️pwd
➡️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 pwd command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██████╗ ██╗ ██╗██████╗
# ██╔══██╗██║ ██║██╔══██╗
# ██████╔╝██║ █╗ ██║██║ ██║
# ██╔═══╝ ██║███╗██║██║ ██║
# ██║ ╚███╔███╔╝██████╔╝
# ╚═╝ ╚══╝╚══╝ ╚═════╝
pwd
# print working directory
pwd ; pwd -P
# Quick way to see if your pwd path contains any symlinks in it. If so there would be a difference between the two lines.
# Get top level of path
echo '/'`pwd | cut -d'/' -f2`
#==============================##==============================#
# CMD PWD #
#==============================##==============================#
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 pwd in a clear format. This allows users to quickly access the needed information for pwd without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for pwd are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
21 - 🖥️readlink
➡️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 readlink command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██████╗ ███████╗ █████╗ ██████╗ ██╗ ██╗███╗ ██╗██╗ ██╗
# ██╔══██╗██╔════╝██╔══██╗██╔══██╗██║ ██║████╗ ██║██║ ██╔╝
# ██████╔╝█████╗ ███████║██║ ██║██║ ██║██╔██╗ ██║█████╔╝
# ██╔══██╗██╔══╝ ██╔══██║██║ ██║██║ ██║██║╚██╗██║██╔═██╗
# ██║ ██║███████╗██║ ██║██████╔╝███████╗██║██║ ╚████║██║ ██╗
# ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════╝ ╚══════╝╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝
# Find the target path a symlink is pointing to
# Explanation: S# ure, you could figure out the link target from the output of ls -l a_symbolic_link_to_somewhere too, but the output of readlink is simply the target of the symbolic link itself, so it is cleaner and easier to read.
readlink a_symbolic_link_to_somewhere
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 readlink in a clear format. This allows users to quickly access the needed information for readlink without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for readlink are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
22 - 🖥️rename
➡️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 rename command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██████╗ ███████╗███╗ ██╗ █████╗ ███╗ ███╗███████╗
# ██╔══██╗██╔════╝████╗ ██║██╔══██╗████╗ ████║██╔════╝
# ██████╔╝█████╗ ██╔██╗ ██║███████║██╔████╔██║█████╗
# ██╔══██╗██╔══╝ ██║╚██╗██║██╔══██║██║╚██╔╝██║██╔══╝
# ██║ ██║███████╗██║ ╚████║██║ ██║██║ ╚═╝ ██║███████╗
# ╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝
# Lowercase all files and folders in current directory
rename 'y/A-Z/a-z/' *
rename 's/.html$/.php/' *.html
# Rename replaces string X in a set of file names with string Y. -> This will change the extension of every .html file in your CWD to .php.
rename 's/^unwanted//' *.jpg
# Remove the prefix 'unwanted' from the beginning of each filename with .jpg suffix in CWD.
rename -v 's/^([0-9])_/0\1_/' *.flac
# Rename all single leading digit flac files so that they have a padding 0 for easier sorting.
exiv2 -k -F rename *.jpg
# Use the exiv2 EXIF program to rename your jpg files according to their exif date/time data.
rename 's/^hospital\.php\?loc=(\d{4})$/hospital_$1/' hospital.php*
# Rename files in batch
# Rename all non-hidden files under current directory by replacing spaces with underscores. Uses Larry Wall's 'rename'
rename 's/ /_/g' *
rename 's/_(\d{4})(\d{2})(\d{2}).txt/_$1-$2-$3.txt/' *_????????.txt
# Rename set of files with non-hyphened date at the end to have hyphens.
rename 's/ /_/g' *
# rename all non-hidden files under current directory by replacing spaces with underscores.
rename 's/^unwanted//' *.jpg
# Remove the prefix 'unwanted' from the beginning of each filename with .jpg suffix in CWD.
# Rename all files in lower case - rename is a really powerfull to, as its name suggests, rename files
rename 'y/A-Z/a-z/' *
# Sample outpt:
# aETEBezhrhe.txt REHTY.txt rthureioght.txt
# becomes :
# aetebezhrhe.txt rehty.txt rthureioght.txt
# If your system has the rename command (Linux), then a shortcut to do the exact same thing is with:
rename 's/\d+/sprintf("%04d", $&)/e' *.jpg
# It handles special characters better too.
# Remove new lines from files and folders
rename 's/[\r\n]//g' *
# Explanation: This will search all files and folders in the current directory for any with a new line character in them and remove the new line out of the file/folder.
#==============================##==============================#
# CMD RENAME #
#==============================##==============================#
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 rename in a clear format. This allows users to quickly access the needed information for rename without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for rename are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
23 - 🖥️rm
➡️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 rm command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██████╗ ███╗ ███╗
# ██╔══██╗████╗ ████║
# ██████╔╝██╔████╔██║
# ██╔══██╗██║╚██╔╝██║
# ██║ ██║██║ ╚═╝ ██║
# ╚═╝ ╚═╝╚═╝ ╚═╝
# Remove files and subdirs
rm -rf path/to/the/target/
# Ignore non existent files
rm -f path/to/the/target
# Remove a file with his inode
find /tmp/ -inum 6666 -exec rm -i '{}' \;
#==============================#
# CMD RM - remove
#==============================##==============================#
rm -frv somestuff 2>&1 | tee remove.log
# When you want to see the output (including stderr) of your removal AND save it.
rm ./-file-starting-with-dash
# another way to handle files starting with a - in CWD is to prefix them with ./
rm "$( ls -1dt /netdumps/*.pcap | tail -1 )"
# Remove the oldest .pcap file in the /netdumps directory.
rm -rf "${MEETINGS[@]}"
# Remove meetings, really fast. (But make sure they are properly quoted)
rm -i
# Delete files, asking for confirmation
rm -frv somestuff 2>&1 | tee remove.log
# When you want to see the output (including stderr) of your removal AND save it.
rm ./-file-starting-with-dash
# another way to handle files starting with a - in CWD is to prefix them with ./
rm ./-
# Or rm -- - when you need to remove a file named - after you attempted to see if a program could write to STDOUT (It couldn't)
# To remove a directory that contains other files or directories
rm -r mydir
# do not receive a prompt for each file being removed
rm -rf mydir
#==============================##==============================#
# CMD RM #
#==============================##==============================#
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 rm in a clear format. This allows users to quickly access the needed information for rm without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for rm are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
24 - 🖥️rmdir
➡️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 rmdir command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██████╗ ███╗ ███╗██████╗ ██╗██████╗
# ██╔══██╗████╗ ████║██╔══██╗██║██╔══██╗
# ██████╔╝██╔████╔██║██║ ██║██║██████╔╝
# ██╔══██╗██║╚██╔╝██║██║ ██║██║██╔══██╗
# ██║ ██║██║ ╚═╝ ██║██████╔╝██║██║ ██║
# ╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚═╝╚═╝ ╚═╝
# The rmdir command allows you delete empty directories.
rmdir [dir-name]
#==============================##==============================#
# CMD RMDIR #
#==============================##==============================#
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 rmdir in a clear format. This allows users to quickly access the needed information for rmdir without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for rmdir are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
25 - 🖥️stat
➡️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 stat command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ███████╗████████╗ █████╗ ████████╗
# ██╔════╝╚══██╔══╝██╔══██╗╚══██╔══╝
# ███████╗ ██║ ███████║ ██║
# ╚════██║ ██║ ██╔══██║ ██║
# ███████║ ██║ ██║ ██║ ██║
# ╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝
# The stat command displays status related to a file or a file-system.
stat test.txt
File: ‘test.txt’
Size: 20 Blocks: 8 IO Block: 4096 regular file
Device: 801h/2049d Inode: 284762 Links: 2
Access: (0664/-rw-rw-r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2017-03-03 12:41:27.791206947 +0530
Modify: 2017-02-28 16:05:15.952472926 +0530
Change: 2017-03-02 11:10:00.028548636 +0530
Birth: -
# Produce stats on how many images you took on each day, regardless of strange filenaming schemes.
stat -c %y *.jpg | cut -c1-10 | uniq -c
stat filename_ext (viz., stat abc.pdf)
# The next step involves statistics in terminal of a file of every kind. We can output the statistics related to a file with the help of stat (output file/fileSystem status) command.
# display numerical values for file permissions
stat -c '%a %n' *
#==============================##==============================#
# CMD STAT #
#==============================##==============================#
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 stat in a clear format. This allows users to quickly access the needed information for stat without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for stat are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
26 - 🖥️tail
➡️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 tail command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ████████╗ █████╗ ██╗██╗
# ╚══██╔══╝██╔══██╗██║██║
# ██║ ███████║██║██║
# ██║ ██╔══██║██║██║
# ██║ ██║ ██║██║███████╗
# ╚═╝ ╚═╝ ╚═╝╚═╝╚══════╝
# To show the last 10 lines of file
tail file
# To show the last N lines of file
tail -n N file
# To show the last lines of file starting with the Nth
tail -n +N file
# To show the last N bytes of file
tail -c N file
# To show the last 10 lines of file and to wait for file to grow
tail -f file
#==============================#
# CMD TAIL
#==============================##==============================#
tail -f udp.log |gawk '{printf("%s %s\n",strftime("%Y-%m-%d_%T", $1),$0)}'
# Prefix the epoch time in column 1 with the local time.
tail -f foo.log|egrep --line-buffered --color=auto 'ERROR|WARN|$'
# tail log & highlight errors (if your grep supports --color)
tail -f *.log
# You can actually follow more than one log at once and get new updates on them. Use -q to not print filename header.
tail -f access_log | awk '$1~"googlebot"'
# Wait for the friendly Googlebot to pay your site a visit.
tail -f /dev/ttyACM0 |gawk '{print strftime("%Y-%m-%d %T") " " $0)}' |tee temperature.log
# Arduino temp sensor to timed logfile and view.
tail -f /var/log/syslog | grep CRON
# grep for all cron in syslog following
tail -F
# will monitor a file, such as a log file, until you type Ctrl-c.
tail -F /var/log/syslog | awk '{printf("\033[%dm%s\033[0m\n",31+NR%2,$0)}'
# Holiday sysLog! Its ready for the new year too. ;)
tail -F syslog |while read -r line;do printf "\033[38;5;%dm%s\033[0m\n" $(($RANDOM%255)) "$line";done
# Random color per log line.
tail !^
# In bash, $^ expands to 2nd word of previous command.
# Just noticed error in previous tweet: s/$^/!^/.
# Can pull up second word (i.e. first argument) of previous command with !^ in bash.
tail -n2000 /var/www/domains/*/*/logs/access_log | awk '{print $1}' | sort | uniq -c | sort -n | awk '{ if ($1 > 20)print $1,$2}'
# Count number of hits per IP address in last 2000 lines of apache logs and print the IP and hits if hits > 20
tail -n100000 large.log | head
# Get a sample of 10 lines from a large log file, 100,000 lines from the end of the file.
rsstail -u $FEEDURL -n 50 | while read line; do mail -s "FeedUpdate" $user <<<"$line"; done
# Sending new RSS entries to email
tail -f /var/log/messages | toilet -f term --gay
# Log in Rainbow Colors
tail -F some_log_file.log | grep --line-buffered the_thing_i_want
# Grep live log tailing
tail -F some_log_file.log | grep the_thing_i_want
# Grep live log tailing, tracks file open/close. "-F" will continue tailing if file is closed and another file opened with same name. This is handy for tailing log files that segment while watching them without having to issue the command again.
tail -f some_log_file.log | grep the_thing_i_want
# Grep live log tailing
tail -f some_log_file.log | grep --line-buffered the_thing_i_want
# Grep live log tailing
# Tail all /var/log text log files - Tails all the human-readable /var/log files and stays on the same filename to work with log rotations.
tail --follow=name --retry $(ls -altr $(find /var/log -type f |grep -v -e "gz$" -e "mysql/.*relay" -e "[0-9]$" | xargs file | grep ASCII | cut -d: -f1) | awk '{ print $9 }') &
tail -F firewall.log |while read -r line;do printf "\033[38;5;%dm%s\033[0m\n" $(($RANDOM%255)) "$line";done
# Random color per log line.
# Tail all /var/log text log files - Tails all the human-readable /var/log files and stays on the same filename to work with log rotations.
tail --follow=name --retry $(ls -altr $(find /var/log -type f |grep -v -e "gz$" -e "mysql/.*relay" -e "[0-9]$" | xargs file | grep ASCII | cut -d: -f1) | awk '{ print $9 }') &
# Is there a trick to get an oneliner that this to run:
tail -n1001 path/to/file > path/to/samefile?
# If i understand right that you want to omit the use of '>' operator, than you can use tee: tail -n1001 path/to/file | tee path/to/samefile - however without ">/dev/null" at the end tee will also output the file/content on stdout - so if such an extra output is a problem (and you can't add '>/dev/null' at the end of your command) then tee isn't the best solution
tail -n1001 path/to/file | echo > path/to/samefile
tail -n 1001 <<<$(<file1) >file1 works fine
tail -f messages | awk '/ec:8a:dc:09:e1:2f/'
# I find it easier to use awk to search for lines with a string when using tail -f than trying to use grep options or the stdbuf program.
# `tail -f` a file until text is seen
tail -f /path/to/file.log | sed '/^Finished: SUCCESS$/ q'
# Explanation:
tail -f until this exact line is seen:
Finished: SUCCESS
# The exit condition does not have to be an exact line, it could just well be a simple pattern:
... | sed '/Finished/ q'
# Realtime lines per second in a log file, with history - This is similar to standard `pv`, but it retains the rate history instead of only showing the current rate. This is useful for spotting changes. To do this, -f is used to force pv to output, and stderr is redirected to stdout so that `tr` can swap the carriage returns for new lines. (doesn't work correctly is in zsh for some reason. Tail's output isn't redirected to /dev/null like it is in bash.)
tail -f access.log | pv -l -i10 -r -f 2>&1 >/dev/null | tr /\\r \ \\n
# Sample output
# [2.00 s]
# [2.00 s]
# [4.20 s]
# [20.4 s]
# [8.20 s]
# [11.6 s]
#==============================##==============================#
# CMD TAIL
#==============================##==============================#
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 tail in a clear format. This allows users to quickly access the needed information for tail without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for tail are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
27 - 🖥️touch
➡️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 touch command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ████████╗ ██████╗ ██╗ ██╗ ██████╗██╗ ██╗
# ╚══██╔══╝██╔═══██╗██║ ██║██╔════╝██║ ██║
# ██║ ██║ ██║██║ ██║██║ ███████║
# ██║ ██║ ██║██║ ██║██║ ██╔══██║
# ██║ ╚██████╔╝╚██████╔╝╚██████╗██║ ██║
# ╚═╝ ╚═════╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝
touch -r oldfile newfile
# set access/modification times of newfile to those of oldfile.
#==============================##==============================#
# CMD TOUCH #
#==============================##==============================#
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 touch in a clear format. This allows users to quickly access the needed information for touch without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for touch are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
28 - 🖥️tree
➡️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 tree command with important options and switches using examples.
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ████████╗██████╗ ███████╗███████╗
# ╚══██╔══╝██╔══██╗██╔════╝██╔════╝
# ██║ ██████╔╝█████╗ █████╗
# ██║ ██╔══██╗██╔══╝ ██╔══╝
# ██║ ██║ ██║███████╗███████╗
# ╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝
# To display a recursive directory tree
tree
# To make tree output contents from path `/foo/bar`
tree /foo/bar
# To make tree omit any empty directories from the output
tree --prune
# To list directories only (`-d`), and at a max depth of two levels (`-L`)
tree -d -L 2
#==============================#
# CMD TREE
#==============================##==============================#
tree | convert label:@- /home/avi/tree.png
# While writing tutorial, I usually need to produce output, many a times in image format. The above command combination does this for me. Say I need the output of tree command (for /etc/x11 directory) in image format.
tree -fash
# Ordnerstruktur in Baumansicht mti Größenangabe pro File
tree -isafF | grep -v /$ | sort -k2nr | head
# Etws umfangreicher, aber die ausgabe nach Byte sortiert kann sich sehen lassen
#jump to home dir and list all, not older than 3 days, with full-path, hidden/non-hidden files/subdirectories
# Number of days back: change/append arbitrary amount of '\|'$[$(date +%Y%j)-x] expressions or specify any n-th day before today for a single day (you have to replace x with 3, 4, 5, whatever ... above I replaced it with 1 and 2 to get listing for yesterday and day before yesterday and 0 for today was not necessary, so left out). Q: How to narrow to *.pdf , *.png, *.jpg, *.txt, *.doc, *.sh or any type of files only? A: Pipe to grep at the end of command. Even shorter: cd && day=3;for a in $(seq $day -1 0);do tree -aicfnF --timefmt %Y%j-%d-%b-%y|grep $[$(date +%Y%j)-$a];done Here it's only needed to change amount of variable day to list period of days back - here is set to three days back (the seq command is adjusted for listing the oldest stuff first).
cd && tree -aicfnF --timefmt %Y%j-%d-%b-%y|grep $(date +%Y%j)'\|'$[$(date +%Y%j)-1]'\|'$[$(date +%Y%j)-2]
#This is sample output - yours may be different.
[2019215-03-Aug-19] ./.config/session/
[2019215-03-Aug-19] ./.config/session/konsole_2b5b0f704-9942-428b-a3d8-8054efd32b18_1564837706_57870
[2019215-03-Aug-19] ./.config/session/konsole_23e1f9567-a8ff-42ad-a879-76f7bafb56c3_1564840981_89854
[2019215-03-Aug-19] ./.config/session/konsole_2e2aea661-fd41-4510-b0b9-1d2c69ef99c7_1564864156_611707
[2019215-03-Aug-19] ./.config/konsolerc
[2019216-04-Aug-19] ./.config/dconf/
[2019216-04-Aug-19] ./.config/dconf/user
[2019216-04-Aug-19] ./.config/briši_me.pdf
#==============================##==============================#
# CMD TREE
#==============================##==============================#
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 tree in a clear format. This allows users to quickly access the needed information for tree without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for tree are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░