Linux Basic Commands
1. #ls:- This command is used to view the Directories and Files list
2. #ls –a:- This command is used to view the hidden Directories, Files, Normal Directories and Normal Files list.
3. #ls –lt:- This command it will show only normal Files and Directories list into the Time wise.
4. #ls –lh:- This command it will show Human Readable format Files and Directories list.
5. #ls –ld
6. #ls –R
7. #uname:- This command it will display Operating System name.
8. #uname –i:- This command it will show Kernel Version.
9. #ifconfig:- This command is used to Checking the LAN Card IP – Address.
10. #hostname:- This command is used to Check the Host Name.
11. #clear (Or) Ctrl + l:- This command is used to Clear the Terminal Screen.
12. #history:- To view the all previous used Commands.
13. #history –c:- To clear the previous working commands history.
14. #pwd:- This command is used to view the Present working Directory.
15. #ps – ef:- It will show currently running process information.
16. #cal:- a. This command is used to view the Current month Calendar.
b. This command is used to view the total year Calendar.
Ex:- #cal 2009
17. #cat:- a. This command is used to create a new File. Syntax:- #cat >
b. This command is used to View the Contents of File. Syntax:- #cat
Ex:- #cat Cil Welcome to CIL.
c.This command is used to append a file (To add the Charectors) Syntax:- #cat >> Filename
Ex:- #cat >> Cil Hello Cmtes After typing the charector press Ctrl+d To save and exit the file.
18. #touch:- This command is used to create multiple empty Files at time.
Ex:- #touch f1 f2 f3 f4
19. #rm:- This command is used to remove the existing File.
Ex:- #rm f1
20. #cp:- This command is used to copy the file one location to another location.
Ex:- #cp Cil Desktop
21. #mv:- This command is used to move the file one location to another location.
Ex:- #mv Cil Desktop
22. #mkdir:- a. This command is used to create a new Directory.
b. This command is used to create at a time multiple new Directories.
c. This command is used to create a main Directory and its Sub – Directories at a time.
Syntax:- #mkdir –p
Ex:- #mkdir –p sai/ganesh/rajesh
23. #rm:- a. This command is used to remove the empty directory.
b. This command is used to remove the Sub – Directories information also.
Syntax:- #rm –rf
Ex:- #rm –rf sai
1. which ls:- Where exactly located to the path.
2. whereis ls:- It will go to location as well as man pages.
3. who:- It will show which user is logged in.
4. who am i:- It will show detailed information to the current terminal.
5. whoami:- It will show the user information, not give the detailed information.
7. wc –l
8. wc –c
VI Text Editor
VI stands for Visual Interface it is the command to modify a file in linux and unix operating systems.
In VI editor three modes are there command mode insert mode execute mode
command mode commands
vi (file name) yy-to copy a single line no+yy-to copy the number of lines ex:5yy to copy the five lines
dd-to delete a single line no+dd-to delete the number of lines ex:5dd to delete the five lines
x-to delete a charector
dw-to delete a single word
d$-to delete a line from the curser
u- to undo a file
ctrl+r - to redo a file
insert mode commands
to open the execute mode
Esc+i,shift+a and insert button
execute mode commands
Esc:w -to save a file Esc:q - to exit a file Esc:wq - to save and exit a file Esc:se nu - to set the number lines Esc:se nonu - to remove the number lines Esc:q! - to quit a file forcely without saving
how to check the ip address
open the terminal type ifconfig and enter
How to set the ipaddress Type system-config-network And press enter Select the lan card click edit Select "statically set the IP address" Type the ip address and subnet mask Click ok And click activate Click ok Close
In terminal Type service network restart And press enter To update settings
How to check the hostname
In terminal Type hostname EX: sys1.facebook.com
How to set the hostname
In terminal Type hostname sys2.cmtes.com Press enter Type vi /etc/sysconfig/network Press enter In line number 3 Type Hostname=sys2.cmtes.com Press Esc:wq Press enter To save and exit the file
type service network restart press enter
PLEASE WRITE A FEEDBACK OR SUGGESTIONS TO BELOW EMAIL ID’S.