Login linux terminal pwd ls useradd commands accessing virtual terminals
In this assignment I will instruct you about some basic commands of Linux. You will get seven virtual terminal when you perform full installations. Although you can use graphics for daily task but here we are preparing for RHCE exam so you must use command line interface. Because all question are based on command line in RHCE Exam.
Virtual Consoles
A virtual console is a command line where you can log into and control Linux. As RHEL is a multi terminal operating system, you can log into Linux, even with the same user ID, several times. It's easy to open a new virtual console. Just use the appropriate ALT-function key combination. For example, pressing ALT-F2 brings you to the second virtual console. You can switch between adjacent virtual consoles by pressing ALT-RIGHT ARROW or ALT-LEFT ARROW. For example, to move from virtual console 2 to virtual console 3, press ALT-RIGHT ARROW.
You can switch between virtual terminals by just press the ALT+CTRL+Funcation key combinations.
ALT + CTRL + F1 for terminal 1
ALT + CTRL + F2 for terminal 2
ALT + CTRL + F3 for terminal 3
ALT + CTRL + F4 for terminal 4
ALT + CTRL + F5 for terminal 5
ALT + CTRL + F6 for terminal 6
ALT + CTRL + F7 for terminal 7
Terminal 7 is by default graphic mode beside it all six terminal are CLI based. Open any terminial by press ALT+CTRL+F1 key combinations. root account is automatically created when we install Linux.
Type root on login name and press enter key, now give password ( no asterisk character like window to guess the password length) When you login from root account you will get # sign at command prompt , and when you login from normal user you will get $ prompt.
#clear
This command is used to clear the screen.You have three options to logout .
Press CTRL+D
#exit
#logout
All three commands perform same task.
#pwd
/root
Print working directory command will tell you about current location from / partition.
#ls
ls command will list the object in directory. All directory are listed in blue color while files are shown white color.
#ls –a
Normal ls command will not list the hidden files. If you want to list the hidden file use –a switch with ls command to list the hidden files.
#ls –l
Ls command with –l switch will list the objects in long formats . we will discuss more about –l switch in coming sections.
#ll
Same as ls –l . First and major task for any system administrator is user managements. For testing purpose you can perform all task with root account but in real life root account is used for administrative purpose only. Lest create a normal user account for further practical.
#useradd [user name ]
Useradd command is used to create user. Several advance options are used with useradd command but you will learn about them in coming article.
#passwd [user name]
In linux no user can be login without password. passwd command is used to assign password for any user. Do not execute this command without user name otherwise it will change root password.