Skip to content
.Maui Blog
Examples and tutorials for programmers without advertising.
  • Home
  • .Maui APIs

Category: Ubuntu

March 9, 2020

Ubuntu – count all files in folder

find . -type f | wc -l

October 31, 2019

Ubuntu – Delete all files with the same extension in the subfolders

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

October 30, 2019

Ubuntu – Sort folders by size

Launch this console command du –max-depth=1 /* | sort -n

July 27, 2019

Delete apache log files older than x days on Ubuntu

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 {} \;  

May 19, 2019

Execute .go file using crontab in Ubuntu

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…

October 30, 2018

Kill process by port number in ubuntu

Assuming that the process we want to close is running on port 9222, run this command: kill `sudo lsof -t -i:9222`

Powered by WordPress | Theme: Write by Themegraphy