Do you want to know the size of a directory in Linux? Use the du command.
The du command estimates the space used by a directory.
The options -sh are (from man du):
display only a total for each argument
print sizes in human readable format (e.g., 1K 234M 2G)
To check more than one directory and get the total size of those directories, use
du -sch *
What does the extra option mean?
produce a grand total
Include hidden files?
du -sch * .*
Want to know how much disk space has been used?
du -h .
I have created a GitHub repository with a number of bash scripts I use to manage Profit Trailer (PT) on my VPS running Ubuntu 17.10. Profit Trailer (PT) is a cryptocurrency trading bot.
I have been working with Tradingview Pine Scripts (TPS) and it was irritating me that when the scripts get lager and more complex they are hard to read. So I decided to create syntax highlighting for TPS for Notepad++ (NPP). NPP is the go to text editor for Windows. It provides an easy mechanism for adding custom syntax highlighting for languages using its User Defined Language (UDL) functionality.
You can find the the User Defined Language (UDL) file for syntax highlighting Tradingview Pine Scripts (TPS) files in Notepad++ (NPP) in this repository on GitHub.
Let me know what you think and if it is helpful.
I have create a GitHub repository with a number of bash scripts I use to manage PT Magic (PTM) on my VPS running Ubuntu 17.10. PT Magic (PTM), a free add-on for the Profit Trailer (PT) cryptocurrency trading bot.
I have been irritated not having standard keyboard shortcuts, like Ctrl-arrow left (move word left) and Ctrl-arrow right (move word right), available on the bash command line. It turns out they are. If you know what the meta key is. Meta key? Yes, I didn’t know which key this was either.
It turns out that it is the Alt key. This is because historically, many Unix workstations had a key labeled Meta where PCs have a key labeled Alt.
So here is a little bash command line cheat sheet.
- Ctrl-a: Move to the start of the current line.
- Ctrl-e: Move to the end of the line.
- Ctrl-f: Move forward a character.
- Ctrl-b: Move back a character.
- Meta-f: Move forward to the end of the next word. Words are composed of letters and digits.
- Meta-b: Move backward to the start of the next word. Words are composed of letters and digits.
I needed to find out which files a process was using. I used the following commands to do this.
The ps command to get the process id (PID) of the process.
$ ps -aef | grep
Then the lsof command to list the files being used by the process.
$ lsof -p
If you want to count the files being used, use the following command.
$ lsof -p | wc -l
I needed the compare plugin today. You used to be able to select the Plugin Manager under Plugins -> Plugin Manager. But it was gone 😦 It turns out it has been removed from the standard installation and has to be installed separately. I haven’t been able to find out why. Here quick instructions how to install Plugin Manager.
- Download the latest version of Plugin Manger from GitHub. Make sure you download the correct version 32 or 64 bit depending on the version of your operating system.
- Unzip the file.
- Copy the two directories to the Notepad++ directory. In my case C:\Program Files (x86)\Notepad++.
- Restart Notepad++.
Plugin Manager is available again under Plugins -> Plugin Manager. Yeah!