This command will show how many kilometers there are in a light year. jason$ units -t ‘1 light year/kilometers’ 9.4605284e+12jason$ units -t ‘1 light year/kilometers’ 9.4605284e+12 If I travelled 800m in 9.58 seconds how many miles per hour is this? jason$ units -t ‘800m/9.58s’ ‘miles/hour’ 186.80053jason$ units -t ‘800m/9.58s’ ‘miles/hour’ 186.80053 Using it this way, …

Copying a file with sftp from one UNIX machine to another is very easy. The command below uses the SSH protocol and initiates a connection to the remote PC. ubuntu ~ $ sftp -P 443 [email protected] ~ $ sftp -P 443 [email protected] Press ENTER and type your password. The user will be presented with a …

Creating an alias for bash makes remembering a command easier. This is how longer commands may be simplified. Here is an example. [[email protected]:~] alias lseasy=’ls -lAhF'[[email protected]:~] alias lseasy=’ls -lAhF’ This is the output. [[email protected]:~/Videos] lseasy total 4.8G -rw-r–r– 1 jason jason 18 Mar 24 13:34 authrootseq.txt -rw-r–r– 1 jason jason 23K Mar 24 13:55 heap2.htm …

How to define a string and print it out with the printf() function. #include <stdio.h>   /* Defining a global string. */   #define hi "Hello Sire."   int main(void) { /* Printing out the string. */ printf("%s\n", hi);   return 0; }#include <stdio.h> /* Defining a global string. */ #define hi "Hello Sire." int …

To reboot your Linux machine, use the sudo reboot command. Another way is to type sudo shutdown -r now. To lookup the IP address of a host, use the nslookup command. For example: nslookup google.com. [email protected] ~ % nslookup google.com Server: 172.31.0.2 Address: 172.31.0.2#53   Non-authoritative answer: Name: google.com Address: 74.125.237.193 Name: google.com Address: 74.125.237.194 …

This example uses sed to replace the beginning word of a sentence. [email protected] ~ $ echo “this is a line of text.” | sed “s/this/This/gi;” This is a line of text. This is a better way to capitalize the first letter of every word in the sentence. I found this tip here. [email protected] ~ $ …

There are many useful Linux tips that make the life of a Linux user much easier. One is for the VI or VIM editor. To open a file at a specific line; use this command. [email protected] ~/Documents/yadex-1.7.901 $ vim src/x11.h [email protected] ~/Documents/yadex-1.7.901 $ vim src/x11.h +33 This will open the file x11.h at line 33. …

I have just setup FreeBSD with a high resolution framebuffer console easily. I just typed vidcontrol -i mode to list all available framebuffer video modes and then I set the appropriate mode for my laptop screen. I then added this line to the /etc/rc.conf file: allscreens_flags=”MODE_332″. This sets a 1366*768 resolution for the framebuffer console. …