-
Notifications
You must be signed in to change notification settings - Fork 3
Linux cheatsheet
Dmitriy Popov edited this page Jan 25, 2021
·
9 revisions
df -h
See https://opensource.com/article/18/7/how-check-free-disk-space-linux
du -sh *
See https://stackoverflow.com/a/1019124/8534088
ls -l --block-size=M
See https://unix.stackexchange.com/a/64150/360633
ls | wc -l
For any directory
ls ~/kg-work/json/2021-01-25\ 02-26-47/index-data | wc -l
See https://devconnected.com/how-to-count-files-in-directory-on-linux/
rm -r *
See https://askubuntu.com/a/740808/975890
zip log-2020.12.28.zip ./kg.log
See https://linuxize.com/post/how-to-zip-files-and-directories-in-linux/
❗ relative path will be used within the zip
zip -r filename.zip directory
less filename.zip
See https://stackoverflow.com/a/52602616/8534088
See https://docs.aws.amazon.com/cli/latest/reference/s3/cp.html#examples
You need to pass the security credentials or to set a role on EC2 etc.
With the same file name, kgparser
is S3 Bucket name.
aws s3 cp log-2020.12.28.zip s3://kgparser
This example is with setting the profile with --profile
option.
aws s3 cp s3://kgparser/log-2020.12.28.zip ./log.zip --profile=dpopov-admin-kgparser