Posts

Showing posts with the label commands

Project Wild Penguin 22.4.2017: To delete directories inside current directory whose contents are less than a given size

With GNU find and GNU coreutils, and assuming your directories don't have newlines in their names: find . -mindepth 1 -maxdepth 1 -type d -exec du -ks {} + | awk '$1 <= 50' | cut -f 2- This will list directories with total contents smaller than 50K. If you're happy with the results and you want to delete them, add | xargs -d \\n rm -rf to the end of the command line. Command: find . -mindepth 1 -maxdepth 1 -type d -exec du -ks {} + | awk '$1 <= 50' | cut -f 2- | xargs -d \\n rm -rf Source:  https://unix.stackexchange.com/questions/214089/command-to-delete-directories-whose-contents-are-less-than-a-given-size

Project Wild Penguin 23.4.2017: To list the size of sub-directories inside a directory using terminal

Simple command to list the size of sub-directories inside a directory using terminal : du -sh * | sort -h will get you a human-readable ascending list of the sizes of files and subdirectories in your current directory, du -sh will summarize the current directory size. Source:  https://askubuntu.com/questions/426809/how-to-list-the-size-of-a-directoy-and-subdirectories-and-files-inside-it-by-ter

Project Wild Penguin - Installing Node.js on Xubuntu 15.04

Image
In this post, I have going to share the simplest way to install Node.js on your Linux system, specifically, Ubuntu and its other flavors. The server side component of the MEAN stack - node.js can be installed on your Linux server by following the below steps: 1. Go to  https://nodejs.org/en/download/  and download the Linux binaries based on your system architecture (32 or 64 bit). I've downloaded the 64 bit version. 2. Open the terminal and type in the following command:           sudo tar -C /usr/local --strip-components 1 -xzvf node-v5.5.0-linux-x64.tar.gz  3. Both node and npm should now be installed in "/usr/local/bin" and check this by typing:               ls -l /usr/local/bin/node       ls -l /usr/local/bin/npm Alternatively, you can check the version of node installed by typing:     node -v Thanks to the Coding Samaritans out there. My online nightmare is what ...

Project Wild Penguin: The Environment (To Find version of Ubuntu or desktop environment you are running)

Image
I have had an on and off relationship with the Wild Penguin, the Linux. The reason for this was my lack of trust on the stability of the Linux Desktop Environments that I tried. The main issues started when Ubuntu made the switch to Unity which caused my laptop to overheat due to AMD drivers issue. It also kept sending my old desktop into dark space exploration by breaking its GUI on every second boot. This complicated relationship turned into a stable partnership when I came across xfce-based Ubuntu flavor called Xubuntu.  I have been using it for more than a year on both my lappy and desktop. And after using it for so long, it has become my favorite OS. It has helped me make the complete switch from Windows to Linux. Now all my devices, my tab, phone, desktop and laptop all run on Linux based operating system. It is a important partner in my Odyssey to become a better computer scientist and engineer. So, while I was trying to brush up my Linux command line skills, I got a qu...