Technology Tales

Adventures & experiences in contemporary technology

Reloading .bashrc within a BASH terminal session

3rd July 2016

BASH is a command-line interpretor that is commonly used by Linux and UNIX operating systems. Chances are that you will find find yourself in a BASH session if you start up a terminal emulator in many of these though there are others like KSH and SSH too.

BASH comes with its own configuration files and one of these is located in your own home directory, .bashrc. Among other things, it can become a place to store command shortcuts or aliases. Here is an example:

alias us=’sudo apt-get update && sudo apt-get upgrade’

Such a definition needs there to be no spaces around the equals sign and the actual command to be declared in single quotes. Doing anything other than this will not work as I have found. Also, there are times when you want to update or add one of these and use it without shutting down a terminal emulator and restarting it.

To reload the .bashrc file to use the updates contained in there, one of the following commands can be issued:

source ~/.bashrc

. ~/.bashrc

Both will read the file and execute its contents so you get those updates made available so you can continue what you are doing. There appears to be a tendency for this kind of thing in the world of Linux and UNIX because it also applies to remounting drives after a change to /etc/fstab and restarting system services like Apache, MySQL or Nginx. The command for the former is below:

sudo mount -a

Often, the means for applying the sorts of in-situ changes that you make are simple ones too and anything that avoids system reboots has to be good since you have less work interruptions.

Dropping back to a full screen terminal session from a desktop one in Linux

29th May 2014

There are times when you might need to drop back to a full screen terminal session from a graphical desktop environment when running Linux. One example that I have encountered is the installation of Nvidia’s own graphics drivers on either Ubuntu or Linux Mint. Another happened to me on Arch Linux when a Cinnamon desktop environment update left me without the ability to open up a terminal window. Then, the full screen command allowed me to add in an alternative terminal emulator and Tech Drive-in’s list came in handy for this. there might have been something to sort on a FreeBSD installation that needed the same treatment. This latter pair happened to me on sessions running within VirtualBox and that has its own needs when it comes to dropping into a full screen command line session and I will come to that later.

When running Linux on a physical PC, the keyboard shortcuts that you are CTRL + ALT + F1 for entering a full screen terminal session and CTRL + ALT + F7 for returning to the graphical desktop again. When you are running a Linux guest in VirtualBox and the host operating system also is Linux, then the aforementioned shortcuts do not work within the virtual machine but instead affect the host. To get the guest operating system to drop into a full screen terminal session, the keyboard shortcut you need is [Host Key] + F1 and the default host key is the right hand CTRL key on your keyboard unless you have assigned to something else as I have. The exit the full screen terminal session and return to the graphical desktop again, the keyboard shortcut is [Host Key] + F7.

All of this works with GNOME and Cinnamon desktop environments running in X sessions and I cannot vouch for anything else unless alternatives like Wayland come my way. Hopefully, this useful functionality applies to those other set-ups too because there are times when a terminal session is needed to recover from a mishap, rare though those thankfully are and they need to be very rare if not non-existent for most users.

Running Photoshop Elements 5 on Ubuntu and openSUSE

23rd January 2008

When you buy a piece of software and get accustomed to its ways of working, it is natural to want to continue using it. That applied to a number of applications when I moved over to Linux in the latter half of last year and one of these was Adobe’s Photoshop Elements 5.0, a purchase made earlier in the year. My way forward was to hang on to Windows by way of VMware. However, Elements fails to edit or save files in the Linux file system accessed through VMware’s shared folders feature. I have yet to work out what’s happening but the idea of using a more conventional networking arrangement has come to mind.

Another idea that intrigued me was the idea of using WINE, the Windows API emulator for Linux. You can get it in the Ubuntu and openSUSE software repositories but the WINE website has more to say on the subject. That’s only the first stage though as you might see from WINE’s Wiki page on Photoshop and its kind. However, their advice is a spot incomplete so I’ll make it more explicit here. You need to run Winetricks from its online home as follows:

wget kegel.com/wine/winetricks; sh winetricks fakeie6

wget kegel.com/wine/winetricks; sh winetricks mdac28

wget kegel.com/wine/winetricks; sh winetricks jet40

The first line flicks a switch to fool Microsoft components to install thinking that they are installing into a Windows system with IE on board. Without this, the rest will not happen. The second installs Microsoft’s native ODBC drivers; Elements will not function at all without these if my experience is any guide. The last step is to add JET support so that Elements’ Organiser can get going. With all of these in place, having a working Photoshop Elements instance under Linux should be a goer. Apart from the odd crash, things seem to be working OK on Ubuntu and openSUSE seems hospitable too. Further experimentation may reveal more.

Update: The WINE Wiki has now been updated (and links back here!). As per dank’s comment, the above lines can be condensed into what you see below:

wget kegel.com/wine/winetricks; sh winetricks fakeie6 mdac28 jet40

  • All the views that you find expressed on here in postings and articles are mine alone and not those of any organisation with which I have any association, through work or otherwise. As regards editorial policy, whatever appears here is entirely of my own choice and not that of any other person or organisation.

  • Please note that everything you find here is copyrighted material. The content may be available to read without charge and without advertising but it is not to be reproduced without attribution. As it happens, a number of the images are sourced from stock libraries like iStockPhoto so they certainly are not for abstraction.

  • With regards to any comments left on the site, I expect them to be civil in tone of voice and reserve the right to reject any that are either inappropriate or irrelevant. Comment review is subject to automated processing as well as manual inspection but whatever is said is the sole responsibility of the individual contributor.