mirror of
https://github.com/cheat/cheat.git
synced 2025-12-13 02:32:05 +01:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
905f12a279 | ||
|
|
0c24bbbaaf | ||
|
|
baa782b8ce | ||
|
|
740358e4c0 | ||
|
|
2ebc8c9fac | ||
|
|
f3ecf76239 | ||
|
|
84df17a0f6 | ||
|
|
91c28712e6 | ||
|
|
8eda2266bc | ||
|
|
47fd7c90f4 |
@@ -38,7 +38,7 @@ from docopt import docopt
|
||||
|
||||
if __name__ == '__main__':
|
||||
# parse the command-line options
|
||||
options = docopt(__doc__, version='cheat 2.1.15')
|
||||
options = docopt(__doc__, version='cheat 2.1.16')
|
||||
|
||||
# list directories
|
||||
if options['--directories']:
|
||||
|
||||
@@ -9,3 +9,9 @@ ls -lh
|
||||
|
||||
# Display files, sorted by size
|
||||
ls -S
|
||||
|
||||
# Display directories only
|
||||
ls -d */
|
||||
|
||||
# Display directories only, include hidden
|
||||
ls -d .*/ */
|
||||
|
||||
@@ -12,3 +12,8 @@ CREATE DATABASE owa CHARACTER SET utf8 COLLATE utf8_general_ci;
|
||||
|
||||
# To add a user and give rights on the given database
|
||||
GRANT ALL PRIVILEGES ON database.* TO 'user'@'localhost'IDENTIFIED BY 'password' WITH GRANT OPTION;
|
||||
|
||||
# To list the privileges granted to the account that you are using to connect to the server. Any of the 3 statements will work.
|
||||
SHOW GRANTS FOR CURRENT_USER();
|
||||
SHOW GRANTS;
|
||||
SHOW GRANTS FOR CURRENT_USER;
|
||||
|
||||
22
cheat/cheatsheets/tr
Normal file
22
cheat/cheatsheets/tr
Normal file
@@ -0,0 +1,22 @@
|
||||
#replace : with new line
|
||||
echo $PATH|tr ":" "\n" #equivalent with:
|
||||
echo $PATH|tr -t ":" \n
|
||||
|
||||
#remove all occurance of "ab"
|
||||
echo aabbcc |tr -d "ab"
|
||||
#ouput: cc
|
||||
|
||||
#complement "aa"
|
||||
echo aabbccd |tr -c "aa" 1
|
||||
#output: aa11111 without new line
|
||||
#tip: Complement meaning keep aa,all others are replaced with 1
|
||||
|
||||
#complement "ab\n"
|
||||
echo aabbccd |tr -c "ab\n" 1
|
||||
#output: aabb111 with new line
|
||||
|
||||
#Preserve all alpha(-c). ":-[:digit:] etc" will be translated to "\n". sequeeze mode.
|
||||
echo $PATH|tr -cs "[:alpha:]" "\n"
|
||||
|
||||
#ordered list to unordered list
|
||||
echo "1. /usr/bin\n2. /bin" |tr -cs " /[:alpha:]\n" "+"
|
||||
Reference in New Issue
Block a user