Merge pull request #118 from terminalforlife/master

More Mostly-Presentational Tweaks
pull/120/head^2
Igor Chubin 4 years ago committed by GitHub
commit b68f46b84d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,31 +1,30 @@
# chmod
# Change the access permissions of a file or directory.
# Change file mode bits
# Give the [u]ser who owns a file the right to e[x]ecute it:
# Give the [u]ser who owns a file the right to e[x]ecute it.
chmod u+x file
# Give the [u]ser rights to [r]ead and [w]rite to a file/directory:
# Give the [u]ser rights to [r]ead and [w]rite to a file/directory.
chmod u+rw file_or_directory
# Remove e[x]ecutable rights from the [g]roup:
# Remove e[x]ecutable rights from the [g]roup.
chmod g-x file
# Give [a]ll users rights to [r]ead and e[x]ecute:
# Give [a]ll users rights to [r]ead and e[x]ecute.
chmod a+rx file
# Give [o]thers (not in the file owner's group) the same rights as the [g]roup:
# Give [o]thers (not in the file owner's group) the same rights as the [g]roup.
chmod o=g file
# Remove all rights from [o]thers:
# Remove all rights from [o]thers.
chmod o= file
# Change permissions recursively giving [g]roup and [o]thers the abililty to [w]rite:
# Change permissions recursively, allowing [g]roup and [o]thers to [w]rite.
chmod -R g+w,o+w directory
# Set access rights using numeric (octal) form
# Set access rights using numeric (octal) form.
chmod 750 file
# Convert string representation of the access right
# into numeric form and back
# Convert string representation of the access right into numeric form and back.
curl cheat.sh/chmod/750
curl cheat.sh/chmod/rwxr-x---

@ -1,47 +1,50 @@
# Download a single file
# curl
# Command-line tool for transferring data with URL syntax
# Download a single file.
curl http://path.to.the/file
# Download a file and specify a new filename
# Download a file and specify a new filename.
curl http://example.com/file.zip -o new_file.zip
# Download multiple files
# Download multiple files.
curl -O URLOfFirstFile -O URLOfSecondFile
# Download all sequentially numbered files (1-24)
# Download all sequentially-numbered files (1-24).
curl http://example.com/pic[1-24].jpg
# Download a file and follow redirects
# Download a file and follow redirects.
curl -L http://example.com/file
# Download a file and pass HTTP Authentication
# Download a file and pass HTTP Authentication.
curl -u username:password URL
# Download a file with a Proxy
# Download a file with a Proxy.
curl -x proxysever.server.com:PORT http://addressiwantto.access
# Download a file from FTP
# Download a file from FTP.
curl -u username:password -O ftp://example.com/pub/file.zip
# Get an FTP directory listing
# Get an FTP directory listing.
curl ftp://username:password@example.com
# Resume a previously failed download
# Resume a previously failed download.
curl -C - -o partial_file.zip http://example.com/file.zip
# Fetch only the HTTP headers from a response
# Fetch only the HTTP headers from a response.
curl -I http://example.com
# Fetch your external IP and network info as JSON
# Fetch your external IP and network info as JSON.
curl http://ifconfig.me/all/json
# Limit the rate of a download
# Limit the rate of a download.
curl --limit-rate 1000B -O http://path.to.the/file
# POST to a form
# POST to a form.
curl -F "name=user" -F "password=test" http://example.com
# POST JSON Data
# POST JSON Data.
curl -H "Content-Type: application/json" -X POST -d '{"user":"bob","pass":"123"}' http://example.com
# POST data from the standard in / share data on sprunge.us
# POST data from the standard in / share data on sprunge.us.
curl -F 'sprunge=<-' sprunge.us

@ -18,3 +18,6 @@ df [PATH]
# List [a]ll filesystems, + unreadable, duplicates, pseudo, and inaccessible.
df -a
# Fetch a grand total of disk usage.
df --total

@ -1,8 +1,11 @@
# A list of all the available dictionaries can be queried by executing
# dict
# Dictionary client
# A list of all the available dictionaries can be queried by executing.
dict -I
# translate "understand" to dutch
# Translate 'understand' to Dutch.
dict -d fd-eng-nld understand
# show available dict databases
# Show available dict databases.
dict -D

@ -1,12 +1,15 @@
# Clear dmesg Buffer Logs
# dmesg
# Print or control the kernel ring buffer
# Print the ring buffer contents, then clear it.
dmesg -c
# Display the local time and the delta in human-readable format. Conversion to the local time could be inaccurate
# Display the local time and the delta in human-readable format. Conversion to
# the local time could be inaccurate.
dmesg -e
# Print human-readable timestamps.
dmesg -T
# Human-readable output (color + reltime)
# Human-readable output (color + reltime).
dmesg -H

@ -1,21 +1,20 @@
# htop
#
# Display dynamic real-time information about running processes. An enhanced version of top.
# Dynamic, real-time information about running processes
# Start htop:
htop
# Start htop.
htop
# Start htop displaying only processes owned by given user:
htop -u user_name
# Start htop displaying only processes owned by given user.
htop -u user_name
# Refresh every 10 seconds
# Refresh every 10 seconds.
htop -d 10
# Get help about interactive commands:
?
# While htop(1) is running, get help about interactive commands.
?
# Inverts the sort order
I
# While htop(1) is running, invert the sort order.
I
# Trace a process (with strace)
s
# While htop(1) is running, trace a process with strace.
s

@ -1,8 +1,8 @@
# look
# Look for lines in sorted file (Mac OS X)
# Look for lines which begins with the given prefix:
# Look for lines beginning with the given prefix.
look prefix file
# Look for lines ignoring case:
# Look for lines, case-insensitively.
look -f prefix file

@ -1,5 +1,5 @@
# lshw
# Get hardware information on Linux
# Information about hardware configuration
# Generate full information report about all detected hardware.
lshw
@ -16,8 +16,8 @@ lshw -class processor
# Display the disk drives with the disk class.
lshw -short -class disk
# Display information about the partitions and controllers also,
# specify the storage and volume class along with the disk class.
# Display information about the partitions and controllers also, specify the
# storage and volume class along with the disk class.
lshw -short -class disk -class storage -class volume
# Network adapter information.

@ -6,8 +6,7 @@ cat /proc/<pid>/cmdline
# See the process's environment variables
cat /proc/<pid>/environ
# See the process's status and usage information
# such as CPU and memory
# See the process's status and usage information, such as CPU and memory
cat /proc/<pid>/status
# See every file the process has open

@ -1,21 +1,20 @@
# pup
#
# pup is a command line tool for processing HTML
# It reads from stdin, prints to stdout, and allows the user to filter parts of the page using CSS selectors.
# Command line too for processing HTML
# Reading from stdin, pup prints to stdout, allowing the user to filter parts
# of the page using CSS selectors.
# install pup
# (requires go)
# Install pup. Requires `go`.
go install github.com/ericchiang/pup
# indent and colorize HTML
# Indent and colorize HTML.
cat file.html | pup --color
# filter by tag
# Filter by tag.
cat file.html | pup 'title'
# pseudoclass: filter by content "History"
# Pseudoclass: filter by content "History".
cat file.html | pup ':contains("History")'
# multiple groups of selectors
# Multiple groups of selectors.
cat file.html | pup 'title, h1 span[dir="auto"]'

@ -1,26 +1,27 @@
# Ruby is a dynamic, reflective, object-oriented, general-purpose programming language
# ruby is a ruby interpreter
# ruby
# Interpreter of object-oriented scripting language Ruby
# invoke Ruby from the command line to run the script foo.rb
# Invoke Ruby; a dynamic, reflective, object-oriented, general-purpose
# programming language; from the command line to run the provided script.
ruby foo.rb
# pass code as an argument
# Execute Ruby code directly from the command-line.
ruby -e 'puts "Hello world"'
# The -n switch acts as though the code you pass to Ruby was wrapped in the following:
# while gets
# # code here
# end
# The `-n` switch allows Ruby to execute code within a `while gets` loop.
ruby -ne 'puts $_' file.txt
# Beware that with the -n switch $_ contains newline character in the end.
# With the addition of -l switch each line read has the newline character removed.
# Beware that with the `-n` switch, `$_` contains newline character at the end.
# With the addition of the `-l` switch, each line read has the aforementioned
# newline character removed.
ls | ruby -lne 'File.rename($_, $_.upcase)'
# The -p switch acts similarly to -n, in that it loops over each of the lines in the input
# after your code has finished, it always prints the value of $_
# Example: replace e with a
# The `-p` switch acts similarly to `-n`, in that it loops over each of the
# lines in the input, after your code has finished; it always prints the value
# of `$_`.
#
# The following example replaces `e` with `a`.
echo "eats, shoots, and leaves" | ruby -pe '$_.gsub!("e", "a")'
# BEGIN block executed before the loop
# BEGIN block executed before the loop.
echo "foo\nbar\nbaz" | ruby -ne 'BEGIN { i = 1 }; puts "#{i} #{$_}"; i += 1'

@ -1,23 +1,20 @@
# say
#
# Converts text to speech.
# Say a phrase aloud:
# Say a phrase aloud.
say "I like to ride my bike."
# Read a file aloud:
# Read a file aloud.
say -f filename.txt
# Say a phrase with a custom voice and speech rate:
# Say a phrase with a custom voice and speech rate.
say -v voice -r words_per_minute "I'm sorry Dave, I can't let you do that."
# List the available voices:
# List the available voices.
say -v ?
# Hear the available voices
# Hear the available voices.
say -v ? | awk '{ print $1 }' | while read v; do echo "$v is speaking..."; say -v $v "Hi, my name is $v"; done
# Create an audio file of the spoken text:
# Create an audio file of the spoken text.
say -o filename.aiff "Here's to the Crazy Ones."

@ -1,13 +1,14 @@
# GUI screenshot tool for taking, editing screenshots
# scrot
# Command-line screen capture utility
# Take screenshot of the current window
# Take screenshot of the current window.
scrot -u
# Take screenshot of the current window including border
# Take screenshot of the current window, including border.
scrot -ub
# Interactively select a window or rectangle with the mouse
# Using a mouse, perform a rectangular selection of the screen to be captured.
scrot -s
# Capture the screenshot after 5 seconds, display countdown time
# Capture a screenshot after 5 seconds. A countdown is also displayed.
scrot -u -d 5 -c

@ -1,23 +1,21 @@
# xset
# User preference utility for X
# Disable screen saver blanking
# Disable screen saver blanking.
xset s off
# Change blank time to 1 hour
# Change time before which the screen is blanked, to 3,600 seconds (1 hour).
xset s 3600 3600
# Turn off DPMS
# Turn off Display Power Management Signaling. To instead enable DPMS, the `-`
# character is simply changed to `+`.
xset -dpms
# Disable DPMS and prevent screen from blanking
# Disable DPMS and prevent screen from blanking. This command also clearly
# demonstrations the ability to combine several xset(1) commands within the one
# process call.
xset s off -dpms
# Turn off screen immediately
# Immediately force the provided DPMS state (off). Available states are
# 'off', 'on', 'standby', and 'suspend'.
xset dpms force off
# Standby screen
xset dpms force standby
# Suspend screen
xset dpms force suspend

Loading…
Cancel
Save