The best way to create a new file with Linux is to use the touch(1) command. The touch command, when used on an existing file will update the file date stamp to the current system date. But if you type touch myfile.txt this will create an empty file named myfile.txt if this file is not already present on the system. This is a good way to create a file for editing, rather than typing echo “” > myfile.txt.
Printing the date with bash.
date +"%H:%M:%S, %A %d %B %Y"
How to login with the root account on Ubuntu 12.04.
You may do this by using the sudo command.
sudo su -
This will give you a proper root prompt. Or you could set a password for the root account and then you may use the su command to switch to the root user. As shown in the example below.
[email protected] Documents $ sudo passwd root [sudo] password for john: Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully [email protected] Documents $ su Password: [email protected]:/home/john/Documents#
How to keep Ubuntu 12.04`s packages updated.
[email protected]:/home/john/Documents# apt-get update && apt-get upgrade
Practicing Linux commands online.