Last active
September 5, 2019 11:42
-
-
Save DevJonny/01ec09fba52dd610253429da29cb716a to your computer and use it in GitHub Desktop.
Useful Linux commands
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
# List folders with file size in MB | |
ls -la --block-size=M <directory> | |
# Find total file sizes for a directory | |
du -h -c <directory> | tail -1 | |
# Find all directories with name with wildcard | |
find -iname '<directory>*' -maxdepth 10 -mindepth 1 -type d | |
# Delete all directories with name with wildcard | |
find -iname '<directory>*' -d -type d -exec rm -rf '{}' \; | |
# Find and replace in Vim | |
:%s/foo/bar/g | |
# Restart all stopped Docker containers | |
docker start $(docker ps -a -q -f status=exited) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment