To day I had to figure out the Java version installed on my machine while digging through some problems with my IntelliJ IDE. This is how you can get the currently installed Java version and vendor on Ubuntu or other debian derivatives on bash. $> sysinfo That gives you something like that: Java Version: 1.8.0_131 […]
To get your public IP you can use websites like www.whatismypublicip.com/ or just google for it (http://lmgtfy.com/?q=public+ip) But you can also get your public IP via the following Linux shell command (the smart way :-D): $> curl ifconfig.me/all This gives you an output like that: ip_addr: 220.127.116.11 remote_host: ip123456.dynamic.kabel-deutschland.de user_agent: curl/7.35.0 port: 47745 lang: connection: keep_alive: encoding: […]
If you want to see, what a process does, you can use: $> strace -p PROCESSID This will show you all actions of the process in realtime. To get a process id you can use the ps-command.
$> ps waux –sort=-pcpu If you piped the result into the head command, you can limit the result to the n entries with the highest CPU usage. $> ps waux –sort=-pcpu | head -n 10 In this example you will see the ten most CPU-consuming processes on the machine. The ‘–‘ before pcpu results in […]
On Ubuntu you’ll get the all memory (RAM) information with: $> cat /proc/meminfo Example output: MemTotal: 32829172 kB MemFree: 27614092 kB Buffers: 350460 kB Cached: 2232256 kB SwapCached: 0 kB Active: 2629788 kB Inactive: 1925788 kB Active(anon): 1989372 kB Inactive(anon): 443036 kB Active(file): 640416 kB Inactive(file): 1482752 kB Unevictable: 6056 kB Mlocked: 6056 kB SwapTotal: 0 […]
To get the size of files and folders in the current directory (disk usage) $> du -sxh * To get a list of of the biggest data usage folders and files, you can use: $> sudo du -ax -d 10 /* | sort -n -r | head -n 100
Show free disk space for all existing partitions (disk free): $> df -haT Example output: Filesystem Type Size Used Avail Use% Mounted on /dev/mapper/ubuntu–vg-root ext4 227G 177G 39G 83% / proc proc 0 0 0 – /proc sysfs sysfs 0 0 0 – /sys none tmpfs 4,0K 0 4,0K 0% /sys/fs/cgroup none fusectl 0 0 0 […]
Get the kernel version $> uname -a Example output: Linux bravehartk2-ThinkPad-W520 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Or: $> uname -r Example output: 3.13.0-32-generic You can even use the following command to get the kernel version. It will also serve you information about the build date and a […]