Tag Archives: Command-line interface

Linux Join Command Tutorial for Beginners (5 examples) by https://is.gd/cdkdNJ

Sometimes, you may want to combine two files in a way that the output makes even more sense.

If you are on Linux, and are looking for a tool that can help you in situations line these, you may want to check out join, which is a command line utility. In this tutorial, we will discuss this command using some easy to understand examples.

from https://is.gd/cdkdNJ

Selected by Galigio via Computer Borders

Enable Windows 7 Aero Snap in Ubuntu

In Windows 7, you can click and drag a window to the left or right edge of the desktop and it will fill half of the screen, or snap a window to the top edge of the desktop and it will be maximized.

In Ubuntu, you can click and drag a window to the left, right or top edge of the desktop to achieve the same result.

In addition to CompizConfig Settings Manager, install WmCtrl if not added:
– go to Applications (or Main Menu) > Accessories > Terminal.
– enter sudo apt-get install wmctrl
– enter password when prompted.
– go To System > Preferences > CompizConfig Settings Manager.
– select “General” from the left panel and click “Commands”.
In Command line 0, 1 and 2, paste the following codes:

Command line 0, paste:

WIDTH=`xdpyinfo | grep ‘dimensions:’ | cut -f 2 -d ‘:’ | cut -f 1 -d ‘x’` && HALF=$(($WIDTH/2)) && wmctrl -r :ACTIVE: -b add,maximized_vert && wmctrl -r :ACTIVE: -e 0,0,0,$HALF,-1

Command line 1, paste:

WIDTH=`xdpyinfo | grep ‘dimensions:’ | cut -f 2 -d ‘:’ | cut -f 1 -d ‘x’` && HALF=$(($WIDTH/2)) && wmctrl -r :ACTIVE: -b add,maximized_vert && wmctrl -r :ACTIVE: -e 0,$HALF,0,$HALF,-1

Command line 2, paste:

wmctrl -r :ACTIVE: -b add,maximized_vert,maximized_horz

In the same window, click “Edge Bindings” tab.
Change Run Command 0, 1 and 2 from “None” to “Left”, “Right” and “Top” respectively.
Click “Back” button and select “General Options”, change “Edge Trigger Delay” to about 500. AddThis mp3 link

Finding Files using – locate – on Linux

Many Linux users use the ‘find’ utility when searching for files using the command line on their system. They’ll do a simple:
find / -name ‘pattern’
Really though, the power of find isn’t just in finding names of files but rather specific details about those files. For example, if you wanted to find files which are writable by both their owner and their group:
find / -perm -444 -perm /222 ! -perm /111
or perhaps find any file that’s been altered in your Download directory in the past 24 hours:
find /home/user/Downloads/ -mtime 0
As you can see, the find command is very versatile and can be used to find an array of different attributes of files.  There are times though where I’m just looking for something and I don’t want to have to wait for the command to scan the entire directory tree in order to track it down.  That’s where locate comes in with quick and simple results.
Using the locate command can only be accomplished if you install the mlocate package.  Most major distributions have this available.  If not, head over to the mlocate homepage and install manually.  Once that is accomplished, you’ll need to manually run a command to index your filesystem with it…otherwise, you’ll have to wait for the command to run automatically as it registers with cron to do so on a system level.  Open a terminal and change to your root user, then execute the following:
updatedb &
This updates the mlocate database that indexes your files and forks it to the background (the ‘&’ forks it to the background).  You can now logout of the terminal as root and the process will quietly work in the background.
After the command completes, using mlocate is as easy as using the locate command:
locate firefox | less
The command above will look for all files with Firefox in the name and pipe the command through less so you can use the space bar or enter key to scroll the file buffer.  Of course, the reason we pipe it through less is because any file that resides in the ‘firefox’ directory will be reported in the output.  While this tool isn’t as granular as the find command, it is a quick way to track down paths, directories, and files you know should exist.  Since the data is indexed using the updatedb command (by cron) the results are very quick and the command does not have to scan through the filesystem to return the results.
There are plenty more advanced options via flags (such as following symbolic links, making search term case-sensitive, and even using regexp).  See the man page for details on how each of these options work.  Play around with locate and see what you can do!  It’s a powerful and quick search command! AddThis mp3 link

Enabling remote desktop on a VirtualBox Machine

To enable remote desktop on a VirtualBox machine, you have to follow these steps:
VBoxManage modifyvm MachineName -vrdp
This command enables rdp on the virtual machine
VBoxManage startvm MachineName -type vrdp

It starts virtual machine, listening for rdp request on port 3389 (default port)
rdesktop-vrdp localhost

Connects virtual machine with rdp (You can use rdesktop too).
If you want to change rdp port, use this command:
VBoxManage modifyvm MachineName -vrdpport

Also, enabling authentication for rdp is possible:
VBoxManage modifyvm MachineName -vrdpauthtype null | external | guest

VBoxManage is the command line interface of the VirtualBox.
You can make these settings with GUI: Settings -> Remote Display -> Enable VRDP Server
If you want to use your virtual machine with vrdp only, you can use this command simply:
VBoxHeadless -startvm MachineName

Note: RDP server is not included in Open Source Edition of the VirtualBox. If you want to use this feature, you have to use closed-source edition. AddThis mp3 link