Last active
April 26, 2022 09:22
-
-
Save bikalbasnet/1675020039dc9b1bf3f7e62dd88a52bd to your computer and use it in GitHub Desktop.
Useful linux commands that I often end up googling
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## View all disk partition | |
fdisk -l | |
## Displays information about block device | |
blkid | |
## Lists info about all block devices | |
lsblk | |
## Displays amount of disk space available on the file system | |
df | |
## Attach filesystem / device / storage to a directory tree | |
mount /dev/sdc1 /mnt/thumbdrive | |
## Unmount filesystem from tree | |
umount /mnt/thumbdrive | |
## To create live disk from iso using terminal | |
## check the device name for usdb stick via lsblk, umount it and use following command | |
dd if=/path/to/ubuntu.iso of=/dev/sd(c|b) bs=4M conv=fdatasync status=progress && sync | |
## connet to redis | |
telnet hostpath 6739 | |
redis-cli -h hostpath | |
## redis commands | |
## https://lzone.de/cheat-sheet/Redis | |
## view keys only 100 | |
SCAN 0 COUNT 10 MATCH * | |
## All redis info | |
INFO | |
## Get TTL | |
TTL key | |
## Get memory size of key in byte | |
MEMORY USAGE KEY | |
## get type of key | |
TYPE key | |
## GET value of hash type | |
HGETALL key | |
## GET value of string type | |
GET key | |
## getting length of stream redis type | |
XLEN key |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment