Cool Linux tricks and hacks for the desktop and server user.

Posted: October 16, 2014. At: 2:05 PM. This was 3 years ago. Post ID: 7821

Using the shellshock bash bug on an iMac.

iMac04:~ admin$ env VAR1='me() {echo "hello"}\ ' /bin/echo "hello"
hello

Getting free hard disk space easily.

iMac04:~ admin$ df -Hla
Filesystem     Size   Used  Avail Capacity  iused    ifree %iused  Mounted on
/dev/disk0s2    89G    64G    25G    73% 15757422  6089307   72%   /
/dev/disk0s4   410G   4.7G   405G     2%  1147839 98859403    1%   /Volumes/TEMP STORAGE

Get the geometry of your hard disk with the hdparm utility.

jason@jason-H55-USB3:~/Documents$ sudo hdparm -g /dev/sda
 
/dev/sda:
 geometry      = 60801/255/63, sectors = 976773168, start = 0

Update the whole repository information after the initial installation of Gentoo.

ec2-user@ip-172-31-30-35 ~ $ sudo emerge --sync

Then update Portage.

ec2-user@ip-172-31-30-35 ~ $ emerge --oneshot portage

After those commands, you are free to install any required software for your Gentoo instance.

ec2-user@ip-172-31-30-35 ~ $ emerge openvpn mc nmap htop

This will install Midnight Commander, OpenVPN and the very useful htop and nmap port scanning tool.

This is how to get information about your Linux user.

ec2-user@ip-172-31-30-35 ~ $ w
 03:00:47 up  1:00,  1 user,  load average: 0.03, 0.03, 0.06
USER     TTY        LOGIN@   IDLE   JCPU   PCPU WHAT
ec2-user pts/0     02:53    7.00s  0.01s  0.00s w

The Linux command line user may also use the who am i command to get information like this.

No comments have been made. Use this form to start the conversation :)

Leave a Reply