Tuesday, November 19, 2013

Introduction to Linux Command

In this section, we will discuss how to use command line in Linux.
Command line is provided by a program called shell. In UNIX system history, there are a lot of type of shell that being developed. In Redhat Family, default shell that being used is Bash, the GNU Bourne-Again Shell.
One example of bash shell that success in it’s development is Bourne Shell (sh).
Using Command Line
standart prompt list of login name in current user, short hostname from Machine, our directory name is located inside character ‘[]‘ and followed by sign $.
the sign $ it self to show that it was a common user.
for example
[student@student.example.com ~]$
student -> username
student.example.com -> our hostname
~ -> our home directory. by default /home/student/ because our user name is student
if we want to use user root, sign $ will change to #.
Basic command in shell prompt had 3 basic:
1. Command
2. Options
3. Arguments.
For example, command line usage
usermod -l student
In this command line, usermod is command, -l is option and student is argument from the command.
Below is the list of command that usually being used:
- ls -> to list directory
example: ls -lrt /home/student/ ( to show list in this directory /home/student/ and then sort by time.)
- passwd -> to change password
- su – -> to change access become root
- id -> to show our id login
- history -> to show history from command that we used.
- cd -> to change directory
example: cd /home/student ( to change to direktory /home/student)
- cp -> to copy file
example : cp lama.txt baru.txt ( to copy file lama.txt become baru.txt)
- mv -> to rename or moving file
example: mv lama.txt baru.txt ( to rename file lama.txt become baru.txt)
mv /home/student/lama.txt /home/student/Desktop (to move file lama.txt from directory /home/student to directory /home/student/Desktop/ )


Post a Comment