Skip to content

Instantly share code, notes, and snippets.

@abhitechno01
Created October 29, 2021 08:04
Show Gist options
  • Select an option

  • Save abhitechno01/d15a2a93a82875926dfaea4a506dda2a to your computer and use it in GitHub Desktop.

Select an option

Save abhitechno01/d15a2a93a82875926dfaea4a506dda2a to your computer and use it in GitHub Desktop.
ubuntu commands
############Find a string in a file pattern and replace it###################
find . -name ".env" -exec sed -i 's/oldstring/newstring/gI' {} \;
find . -name ".env" -exec grep -l 'your ip adddress' '{}' \;
find . -name ".env" -exec cp {} bkup_env \;
find . -name ".env" -exec grep -l 'email-smtp.us-east-1.amazonaws.com' '{}' \;
###################checking for file sizes and moving for the issue################
du -cha --max-depth=1 / | grep -E "M|G"
#filesDon'tGetActuallyDeleted
even if the df still not reflecting the deleted space, then it means some resource is using the file run the following and kill the process
lsof +L1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment