Section 3
Section 3
system
section 3
TA. Ruba Hesham
TA. Abdelrahman Mohsen
Navigation
Navigation in Linux
When we first log in to our system (or start a terminal emulator session) our current
working directory is set to our home directory. Each user account is given its own home
directory and it is the only place a regular user is allowed to write files.
Navigation Commands
+ List Directory Contents (ls):
To list the files and directories in the current working directory
Note: we can use the ls command to list the contents of any directory, not just the
current working directory, we will explain later
Navigation Commands
+ Absolute Pathname:
Begins from the root directory (represented by /)
Shortcut Result
cd username Changes the working directory to the home directory of user_name. For
example, cd ~bob will change the directory to the home directory of
user “bob.”
Exploring the
System
learn some more commands
There are many kinds of files. In fact, one of the common ideas in
Unix-like operating systems such as Linux is that “everything is a
file.” As we proceed with our lessons, we will see just how true that
statement is.
Viewing File Contents with less
The less command is a program to view text files. Throughout our Linux
system, there are many files that contain human-readable text. The less
program provides a convenient way to examine them.
Once the less program starts, we can view the contents of the file. If the
file is longer than one page, we can scroll up and down. To exit less, press
the q key. The table below lists the most common keyboard commands
used by less.
less Commands
Command Description
Page Up or b Scroll back one page
Page Down or space Scroll forward one page
Up arrow Scroll up one line
Down arrow Scroll down one line
G Move to the end of the text file
1G or g Move to the beginning of the text file
/characters Search forward to the next occurrence of characters
n Search for the next occurrence of the previous search
h Display help screen
q Quit less
less
Commands
Any questions?