Archive
Posts Tagged ‘command line’
Start a VirtualBox operating system from the command line
November 9, 2012
Leave a comment
Problem
Under Linux I have a Windows 7 system in VirtualBox that I mainly use for Powerpoint. I have some more virtual operating systems too but I almost always launch Windows 7 only. Starting the GUI and clicking on the “Show” button to launch it quickly became a pain in the ass. How to launch my Windows 7 from the command line?
Solution
jabba@montreal:~$ VBoxManage list vms
"Windows 7 (old Office XP)" {80ce13dd-8a59-4d0a-94b5-9d8fa1130c62}
"Ubuntu 12.04" {e76ac634-1b73-42fc-85c0-f4f700edbe14}
"Office 2007" {43553e05-55b1-4095-8b66-8dcda275d9e2}
"Ubuntu 12.10 beta" {a22a2b9b-7a64-4345-8fb2-26d766989773}
jabba@montreal:~$ VBoxManage startvm "Office 2007"
I put it in a shell script called “office2007″. Done.
More info
Categories: bash
command line, office 2007, powerpoint, virtualbox
Mount a truecrypt volume from the command line
September 9, 2012
Leave a comment
sudo truecrypt <truecrypt-file> <mount-point>
This will open a GUI window where you can specify the password.
If you want a full CLI solution, check out this page.
Update (20130617)
To unmount a volume, do this:
sudo truecrypt -d <path-to-truecrypt-file>
Categories: bash
command line, truecrypt
Check the number of arguments in a bash script
October 30, 2011
Leave a comment
Problem
My bash script requires a parameter. How to check its presence?
Solution
#!/bin/sh
if [ "$#" -ne 1 ]
then
echo "Usage: $0 <input_file>"
exit 1
fi
# else
# work with "$1" ...
Categories: bash
check parameter, command line