Commands Basic Operating System Linux
Highlights:
Format Instruction on Linux Operating System
Basic Commands Linux Operating System pda
Learning objectives:
After studying the material in this chapter, students should be able to:
Using the basic commands for user information
Know the format of the instructions on the Linux operating system
Using basic commands in Linux operating system
Using the basic tools on the Linux operating system
BASIC THEORY:
Every Linux user should have a login name (user account) that previously must be registered with the system administrator. Login name is generally restricted to a maximum of 8 characters and is generally in small letters. Prompt of bash shell on LINUX use the sign "$".
A LINUX session consists of:
1. Login
2. Working with the Shell / running the application
3. Logout
Depending on the shell being used, the Linux bash it on the login process
will execute the program / etc / profile (for all users) and file. base_profile
in the starting directory (HOME) respectively.
At logout, then the program will execute a bash shell script
named. bash_logout.
1. INSTRUCTION FORMAT LINUX
Standard Linux instructions have the following format:
$ NamaInstruksi [options] [arguments]
Option is an option that starts with the sign - (minus). The argument can be empty,
one or more arguments (parameters).
Example:
$ Ls = no arguments
$ Ls-a = option is-a = all, no arguments
$ Ls / bin = no option, the argument is the / bin
$ Ls / bin / etc / usr = there are three arguments
$ Ls-l / usr = 1 option and a long list argument l =
$ Ls-la / bin / etc = 2 option-l and-a and 2 arguments
2. MANUAL
Linux provides on-line manual. Some key keyboard
important in using the manual are:
Q = to exit the program man
<Enter> = Down, line by line
<space> = Down, per page
b = back to the top, 1 page
/ Text = search for text (string)
n = continue the search string before
The manual is divided into chapters as follows:
Chapter Contents
1 = User commands
2 = System calls
3 = Library calls
4 = Devices
5 = File formats
6 = Games
7 = Miscellaneous
8 = System commands
9 = Kernel Internals
N = Tcl / Tk command
EXPERIMENT:
1. Login as a user.
2. Open the Console Terminal and do the experiments below
Experiment 1:
Viewing the self-identity (id and group id number)
$ Id
Experiment 2:
Viewing the date and the calendar of the system
1. Looking at the current date
$ Date
2. View the calendar
$ Cal 9 2002
$ Cal-y
Experiment 3:
Viewing the identity of the machine
$ Hostname
$ Uname
$ Uname-a
Experiment 4:
See who is online
1. Know anyone who is active
$ W
$ WHO
$ Whoami
2. Changing finger information
$ Chfn <user>
Changing finger information for student.
Password:
Name [user wks]: User name> in wks>
Office []: Programming Lab 2
Office Phone []: 2301
Home Phone []: 5947280
Finger information changed.
3. Viewing finger
$ Finger
$ Finger <user>
Experiment 5:
Using the manual
$ Man ls
$ Man man
$ Man-k file
$ Man 5 passwd
Experiment 6:
Removing the display
$ Clear
Experiment 7:
Looking for command descriptions contain the keywords searched
$ Apropos date
$ Apropos mail
$ Apropos telnet
Experiment 8:
Finding the right command similar to the searched keyword
$ Whatis date
Experiment 9:
The manipulation of files (files) and directories
1. Displays the current working directory
$ Ls
2. See all complete files
$ Ls-l
3. Showing all hidden files or directories
$ Ls-a
4. Show all files or directories without the process of sorting
$ Ls-f
5. Displays the contents of a directory
$ Ls / usr
6. Displays the contents of the root directory
$ Ls /
7. Show all files or directories with the mark: mark (/) to a directory, an asterisk (*) for files that are executable, at sign (@) to file a symbolic link,sign (=) for the socket, a sign (%) for the whiteout and mark (|) to FIFO.
$ Ls-F / etc
8. Displays the full file or directory that is composed of a file name, size, date modified, owner, group and mode, or attributes.
$ Ls-l / etc
9. Displays all the files and directory contents. This argument would lead to a long running process, if the process can be stopped using ^ c
$ Ls-R / usr
Experiment 10:
Viewing the file type
$ File
$ File *
$ File / bin / ls
Experiment 11:
Copying a file
1. Copying a file. Give the option-i for interactive question if the file already exists.
$ Cp / etc / group f1
$ Ls-l
$ Cp-i f1 f2
$ Cp-i f1 f2
2. Copy to directory
$ Mkdir backup
$ Cp f1 f3
Cp f1 f2 $ f3 backup
$ Ls backup
$ Cd backup
$ Ls
Experiment 12:
Viewing the contents of the file
1. Using paint instructions
$ Cat f1
2. Displays files in a single screen
$ F1 more
Experiment 13:
Change the file name
1. Using the instruction mv
$ Mv f1 prog.txt
$ Ls
2. Move files to another directory. If the last argument is the name of the directory, then the files will be moved to that directory.
$ Mkdir mydir
$ Mv f1 f2 f3 mdir
Experiment 14:
Deleting a file
$ Rm f1
$ Cp f1 mydir/f1
$ Cp mydir/f2 f2
$ Rm f1
$ Rm-i f2
Experiment 15:
Looking for a word or phrase in the file
$ Grep root / etc / passwd
$ Grep ": 0:" / etc / passwd
$ Grep student / etc / passwd
Highlights:
Format Instruction on Linux Operating System
Basic Commands Linux Operating System pda
Learning objectives:
After studying the material in this chapter, students should be able to:
Using the basic commands for user information
Know the format of the instructions on the Linux operating system
Using basic commands in Linux operating system
Using the basic tools on the Linux operating system
BASIC THEORY:
Every Linux user should have a login name (user account) that previously must be registered with the system administrator. Login name is generally restricted to a maximum of 8 characters and is generally in small letters. Prompt of bash shell on LINUX use the sign "$".
A LINUX session consists of:
1. Login
2. Working with the Shell / running the application
3. Logout
Depending on the shell being used, the Linux bash it on the login process
will execute the program / etc / profile (for all users) and file. base_profile
in the starting directory (HOME) respectively.
At logout, then the program will execute a bash shell script
named. bash_logout.
1. INSTRUCTION FORMAT LINUX
Standard Linux instructions have the following format:
$ NamaInstruksi [options] [arguments]
Option is an option that starts with the sign - (minus). The argument can be empty,
one or more arguments (parameters).
Example:
$ Ls = no arguments
$ Ls-a = option is-a = all, no arguments
$ Ls / bin = no option, the argument is the / bin
$ Ls / bin / etc / usr = there are three arguments
$ Ls-l / usr = 1 option and a long list argument l =
$ Ls-la / bin / etc = 2 option-l and-a and 2 arguments
2. MANUAL
Linux provides on-line manual. Some key keyboard
important in using the manual are:
Q = to exit the program man
<Enter> = Down, line by line
<space> = Down, per page
b = back to the top, 1 page
/ Text = search for text (string)
n = continue the search string before
The manual is divided into chapters as follows:
Chapter Contents
1 = User commands
2 = System calls
3 = Library calls
4 = Devices
5 = File formats
6 = Games
7 = Miscellaneous
8 = System commands
9 = Kernel Internals
N = Tcl / Tk command
EXPERIMENT:
1. Login as a user.
2. Open the Console Terminal and do the experiments below
Experiment 1:
Viewing the self-identity (id and group id number)
$ Id
Experiment 2:
Viewing the date and the calendar of the system
1. Looking at the current date
$ Date
2. View the calendar
$ Cal 9 2002
$ Cal-y
Experiment 3:
Viewing the identity of the machine
$ Hostname
$ Uname
$ Uname-a
Experiment 4:
See who is online
1. Know anyone who is active
$ W
$ WHO
$ Whoami
2. Changing finger information
$ Chfn <user>
Changing finger information for student.
Password:
Name [user wks]: User name> in wks>
Office []: Programming Lab 2
Office Phone []: 2301
Home Phone []: 5947280
Finger information changed.
3. Viewing finger
$ Finger
$ Finger <user>
Experiment 5:
Using the manual
$ Man ls
$ Man man
$ Man-k file
$ Man 5 passwd
Experiment 6:
Removing the display
$ Clear
Experiment 7:
Looking for command descriptions contain the keywords searched
$ Apropos date
$ Apropos mail
$ Apropos telnet
Experiment 8:
Finding the right command similar to the searched keyword
$ Whatis date
Experiment 9:
The manipulation of files (files) and directories
1. Displays the current working directory
$ Ls
2. See all complete files
$ Ls-l
3. Showing all hidden files or directories
$ Ls-a
4. Show all files or directories without the process of sorting
$ Ls-f
5. Displays the contents of a directory
$ Ls / usr
6. Displays the contents of the root directory
$ Ls /
7. Show all files or directories with the mark: mark (/) to a directory, an asterisk (*) for files that are executable, at sign (@) to file a symbolic link,sign (=) for the socket, a sign (%) for the whiteout and mark (|) to FIFO.
$ Ls-F / etc
8. Displays the full file or directory that is composed of a file name, size, date modified, owner, group and mode, or attributes.
$ Ls-l / etc
9. Displays all the files and directory contents. This argument would lead to a long running process, if the process can be stopped using ^ c
$ Ls-R / usr
Experiment 10:
Viewing the file type
$ File
$ File *
$ File / bin / ls
Experiment 11:
Copying a file
1. Copying a file. Give the option-i for interactive question if the file already exists.
$ Cp / etc / group f1
$ Ls-l
$ Cp-i f1 f2
$ Cp-i f1 f2
2. Copy to directory
$ Mkdir backup
$ Cp f1 f3
Cp f1 f2 $ f3 backup
$ Ls backup
$ Cd backup
$ Ls
Experiment 12:
Viewing the contents of the file
1. Using paint instructions
$ Cat f1
2. Displays files in a single screen
$ F1 more
Experiment 13:
Change the file name
1. Using the instruction mv
$ Mv f1 prog.txt
$ Ls
2. Move files to another directory. If the last argument is the name of the directory, then the files will be moved to that directory.
$ Mkdir mydir
$ Mv f1 f2 f3 mdir
Experiment 14:
Deleting a file
$ Rm f1
$ Cp f1 mydir/f1
$ Cp mydir/f2 f2
$ Rm f1
$ Rm-i f2
Experiment 15:
Looking for a word or phrase in the file
$ Grep root / etc / passwd
$ Grep ": 0:" / etc / passwd
$ Grep student / etc / passwd
0 komentar
Posting Komentar