💻
Cheatsheets
  • Most Useful Command Line Tools: 50 Cool Tools to Improve Your Workflow, Boost Productivity, and More
  • 7_tips_to_reverse_engineer_javascript
  • Configuring a Repl
  • How to create your command-line program (CLI) with NodeJS and Commander.js | by Duc N. | JavaScript
  • replit Node.JS 24/7 Project Hoster
  • cheatsheets
  • Alacritty, Tmux, and Vim
  • amethyst
  • Android
  • Installing Arch Linux
  • Arch Linux
  • aria2
  • bin
  • bspwm
  • Chocolately Notes
  • command_line_pipes
  • CSS Grid
  • curl
  • The curl guide to HTTP requests
  • Docker
  • Easymotion
  • Emmet
  • Favorite figlet fonts
  • FFMPEG
  • figlet
  • File Serve
  • File Transfer
  • fish shell
  • Front End Dev Links
  • How to use Git.io to shorten GitHub URLs and create vanity URLs
  • Git
  • Downloading a Tarball from GitHub
  • Make Infinite Gmail Addresses For One Inbox
  • How To Use GPG on the Command Line
  • guide_to_fish_completions
  • Homebrew
  • How to clean Arch Linux
  • HTML5 Boilerplate
  • Install
  • All the keyboard shortcuts you’ll ever need for Safari on iPad
  • iosevka
  • iPhone
  • ish (iOS)
  • Javascript Notes
  • jq
  • Jupyter Notebooks
  • Lettering
  • lf-wiki
  • lf
  • Command Line
  • Adding a swapfile after a clean installation without swap partition
  • mac_bluetooth_issues
  • Mac Terminal
  • maim
  • markdown-sample
  • Markdown Notes
  • Images in README.md Markdown Files
  • Organizing information with tables
  • md_cheatsheet
  • NiftyWindows Help
  • nix
  • Justin Restivo - A Portable Text Editor: Nix <3 Neovim
  • NPM
  • neovim configuration
  • Pastery
  • Powershell
  • Table of Basic PowerShell Commands | Scripting Blog
  • Powershell Modules
  • Puppeteer
  • Python
  • rclone-colab
  • replit
  • Hi there, I'm Raju Ghorai - a.k.a. [coderj001]
  • Scriptable
  • Servor
  • Replacing Postlight’s Mercury scraping service with your self-hosted copy
  • Shell Scripts
  • skhd
  • Spicetify
  • SSH
  • SurfingKeys
  • tar
  • Terminal Web Browser Docker
  • Text Generators
  • tmux shortcuts & cheatsheet
  • unicode
  • VIM
  • VIM Diff
  • vi Complete Key Binding List
  • 8 Essential Vim Editor Navigation Fundamentals
  • Vim Shortcut Keys
  • Vite
  • VNC
  • web-servers
  • Web Server
  • Windows Command Line
  • Writeguard
  • WSL Cheatsheet
  • youtube-dl
  • zsh Plugins
  • zspotify
Powered by GitBook
On this page
  • Scanning network for ip addresees
  • Install nmap
  • Cleaning and clearing logfiles
  • journal
  • Any log files
  • Setting up webservers
  • diff files in vim
  • curl
  • Showing Key Codes
  • Find text in a file
  • Encrypt and Decrypt
  • Adding to $PATH
  • Finding directories over/under a certain size
  • Star Wars Asciimation
  • Umcompress & Compress
  • 7zip
  • For tar.gz
  • For just .gz (.gzip)
  • Command Line Notes

Was this helpful?

Command Line

Scanning network for ip addresees

This does a simple ping scan in the entire subnet to see which hosts │ are online.

Install nmap

sudo apt-get install nmap
nmap -sP 192.168.1.*

or more commonly

nmap -sn 192.168.1.0/24

Cleaning and clearing logfiles

journal

Clearing out logs older than 10 days

journalctl --vacuum-time=10d

Clearing out journal more than 2 gigs

journalctl --vacuum-size=2G

Any log files

Get sizes

du -h /var/log/

Clear logs that are huge

cat /dev/null > whatever_log.log 

Setting up webservers

diff files in vim

nvim -d file1.txt file2.txt`

diff online files in vim

nvim -d <(curl -sL "https://crap.com/file1.txt") \
<(curl -sL "https://crap.com/file2.txt")

curl

Showing Key Codes

xev -event keyboard

Find text in a file

find . -type f -exec grep "example" '{}' \; -print

f = file

Encrypt and Decrypt

Encrypt: EASIEST OPTION

gpg -c file.txt

Alternative method:

openssl enc -aes-256-cbc -salt -pbkdf2 -in file .txt -out file.enc

Decrypt:

gpg -d file.gpg

Alternative Method: add -d to the above command


Adding to $PATH

Simply add /place/with/the/file to the $PATH variable with the following command:

export PATH=$PATH:/place/with/the/file

Finding directories over/under a certain size

du -sm * | awk '$1 > 1000'

This shows directories larger than 1 gig


Star Wars Asciimation

telnet towel.blinkenlights.n

Umcompress & Compress

7zip

Unzip zip file

7z.exe e *.zip

List files in archive

7z.exe l -r filename.zip

For tar.gz

To unpack a tar.gz file, you can use the tar command from the shell. Here's an example:

tar -xzf rebol.tar.gz

The result will be a new directory containing the files.

For just .gz (.gzip)

In some cases the file is just a gzip format, not tar. Then you can use:

gunzip rebol.gz

Command Line Notes

September 3,2019

zsh CTRL + R lets you search through recent commands

History Example git and ⇧ goes through all git command history

PreviouslfNextAdding a swapfile after a clean installation without swap partition

Last updated 3 years ago

Was this helpful?

See

See

web_servers.md
curl.md
Courses Dashboard | Wes Bos