# find /path/to/log/ -type f -name \*.log\* -mtime +30 -exec rm {} \; > /dev/null 2>&1
How to find and delete logs file LESS THAN 30 DAYS OLD
# find /path/to/log/ -type f -name \*.log\* -mtime -30 -exec rm {} \; > /dev/null 2>&1
How to one-liner that allows to create a directory and move into it at the same time.
# mkdir test-dir && cd $_
How to display size of folder.
#du -csbh /path/to/folderHow to display output as a table
# cat /etc/passwd | column -t -s:Run last command as root
# sudo !!Return to previous directory
# cd -How to add passphrase into id_rsa file use ssh-keygen command
#ssh-keygen -f id_rsa -pHow to combine wget and tar in one command
# wget -qO- http://link-download | tar xvzHow to combine find and xargs command
# find /home/huupv -name *.jpg | xargs -d '\n' ls -llgrep command regurar expression match all IP address in a log file
grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b"how to check file duplicate
find /home/huupv/ -type f -print0 | xargs -0 md5sum | sort | uniq -D -w 32How to determining own ip public
curl ipinfo.io/ipor
curl -s checkip.dyndns.org | sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
No comments:
Post a Comment