Professional Documents
Culture Documents
Section 2
Section 2
1. Graphical
Start your machine normally, you will get a list of the users on your
operating system, click any one of them, you’ll be then asked to enter
the password.
2. TTY
A “Text-based” system where you only use the keyboard to enter
commands .. No graphical interfaces, No mouse, nothing ... Just you and the
keyboard.
--> Return back to the graphical interface by hitting the following keys
Right ctrl + f1
Log into different TTYs and then use the command “ who” to know
which users are logged on which TTYs
This means
User “ahmad” logged into the graphical interface ( :0 )
User “ahmad” logged into tty2
User “root” logged into tty3
--> to log out either write the command “exit” or just hit
Left ctrl + D
*** Relative & Absolute Path ***
In windows OS each partition (Like C & D & E ....) is the root of all the
files and folders (directories) lying under it. There is NO one root gathering
all the partitions together.
With Linux, Every file and every folder is a descendant of what’s called
the root directory denoted by a forward slash “/”
1. Relative Path
Assuming you’re standing at folder “ahmad” and wants to get
into folder “folder_x”
Use the cd command as follow
[ahmad@localhost ~]$ cd folder_x
To move back into folder “ahmad”, use the cd command
and place “..” after it
[ahmad@localhost ~]$ cd ..
This is just like hitting the back button when working in a
graphical interface
Put simple, if you want to get into a folder that is directly in the
next level to the folder your standing in use the “cd” command with
the folder name.
* Start with “/” and on every folder you cross, write its
name... Separate the folder names with a “/”
/opt/rh
[ahmad@localhost folder_x]$ cd /opt/rh
touch file_path
Where file_path is either the relative path or the absolute path
* Note the file name is placed at the end after the path itself
# Suppose you want to create multiple files having a common
# sub-name like for example (f1, f2,f3, f4, f5, f6)
# This can be done as follows
[ahmad@localhost ~]$ touch f{1..6}
rm file_path
* Note the file name is placed at the end after the path itself
This simply means: remove any files starting with the letter “f"
cp src_file_path dest_file_path
# Assuming being in “folder_x”, where we have a file named
# “my_file” and we want to copy this file into “folder_y”
[ahmad@localhost ~]$ cp file_1 ../folder_y
Notice here we used “relative paths” for both the source
and the destination
- “file_1” is directly below “folder_x” so we directly wrote its
name
- ../folder_y is clearly a relative path.