Ubuntu – count all files in folder
find . -type f | wc -l
find . -type f | wc -l
In this example all the files with the extension gz inside the /var/log/ directory and in all its sub-folders will be deleted. find /var/log/ -name “*.gz” -type f -delete
Launch this console command du –max-depth=1 /* | sort -n
Assuming that the apache logs are under the /var/log/apache2 folder and you only want to delete .gz files older than 2 days: find /var/log/apache2/*.gz -mtime +2 -exec rm {} \;
The first thing to do is to compile the .go file to make it executable: go build myfile.go This will produce a file called myfile that is executable. After that run the command from the…
Assuming that the process we want to close is running on port 9222, run this command: kill `sudo lsof -t -i:9222`