Difference between revisions of "Linux hints"

From Klaus' wiki
Jump to: navigation, search
Line 1: Line 1:
Assorted hints, that makes the life easier in the daily life with Linux. Most of the hints are noted here in order to remember the exact systax of the construct.
+
Assorted hints, that makes the life easier in the daily life with Linux. Most of the hints are noted here in order to remember the exact syntax of the construct.
  
 
== Create a file remotely ==
 
== Create a file remotely ==

Revision as of 19:45, 30 June 2010

Assorted hints, that makes the life easier in the daily life with Linux. Most of the hints are noted here in order to remember the exact syntax of the construct.

Create a file remotely

If you need to let output from one command locally be the input to a file on a remote system issue this command:

<local command>|ssh <remote username>@<remote host> "cat > <remotefilename>"

an example:

xmodmap -pke|ssh -p 2222 klausk@bren.hih.au.dk "cat > .Xmodmap"

the output (on stdout) will be sent to bren using klausk's login and send the result into the file .Xmodmap

Comparing two files

In general comparing two files can be done like this:

diff <firstfile> <secondfile>

or using vim

vim -d <firstfile> <secondfile>

To compare two files of which one resides on another system issue this command:

vim -d <firstfile> scp://<remote-system>//<path-to-file>/<secondfile>

To compare two files both resident on different systems issue this command:

vim -d scp://<first-remote-system>//<path-to-file>/<firstfile> scp://<second_remote-system>//<path-to-file>/<secondfile>

where <remote-system> is either the IP address or its hostname including domain as in bren.hih.au.dk - if using a different username than the one you're logged in with on current system use <username>@<remote-system>

NX

After updating the free-nx server it might be necessary to run

nxsetup --install

to reinstall the configuration.