Tutorial by Examples

To change password of current user just type: sudo passwd It will ask you to enter your current password: [sudo] password for <user>: And then you will be asked to enter new password: Enter new UNIX password: And finally you will be asked to re-enter your password: Retype new UNIX...
adduser command adds a user to the system. In order to add a new user type: sudo adduser <user_name> example: sudo adduser tom After typing the above command, you will be prompted to enter details about the new user, such as new password, user Full name, etc. Below is the information ...

!!

(read as bangbang) is a shortcut to repeat the last command entered in console. It is especially useful to run previous command with some changes adduser tom adduser: Only root may add a user or group to the system. Oh snap, what now? Well you could retype the command with sudo in front or...
To list files and folders inside current directory, we use ls command: user@host:/$ ls bin boot cdrom dev etc home initrd.img lib lib64 lost+found media mnt opt proc root run sbin srv sys tmp usr var vmlinuz ls prints folder structure in simple view, color coded by type....
You can restart ubuntu from command line. Below is example of restarting ubuntu immediately. sudo reboot You need to have sudo privilege in order to use this command. Another commands with same results are sudo shutdown -r now and sudo init 6.
APT and APT-GET Easiest and fastest way is with apt-get command. This command may be considered as lower-level and "back-end", and support other APT-based tools. There are no fancy loaders, only basic progress info. This is fastest way for installing apps. Usage: sudo apt-get install ...
Using Ubuntu you have different ways to read a text file, all similar but useful in different context. cat This is the simplest way to read a text file; it simply output the file content inside the terminal. Be careful: if the file is huge, it could take some time to complete the printing process!...
If you know you need a packet <packet>, but you don't know the exact name <packet-exact-name>, instead of searching with Google try with the following: sudo apt-get update apt-cache search <packet> This will return you a list of packets name with a description. Once you have i...
If you are running a command that returns hundreds of lines, but your interest is just on the lines that contains the word <word>, you should definitely use grep! For example try running: ifconfig -a Check the output, that could be only a few lines or quite long, if you have a server with ...
Use the tar (tape archive) command to compress your files and folders. It is similar to creating .ZIP files in Windows environment. Syntax: tar -zcvf <output tar file> <source file> Example: tar -zcvf outputfile.tar.gz source file Here’s what those switches actually mean: -c: Cr...

Page 1 of 1