Sunteți pe pagina 1din 2

Special Lab Session for MSc.

1st Year Students


Date: August 04, 2012 & Time : 10:00AM - 12:30PM

1 Internet browse

2 Login to different server with data transfer

◦ gftp - graphical file transfer protocol

3 Some Linux commands

Sl. Command Description


No. (Syntax)
1 pwd to see present working directory
2 cd to change directory
3 ls to see files and folders in the present working directory
4 ls -l same as 3 but in details
5 clear to clear the screen (terminal)
6 exit to quit the current terminal
7 cp to copy a file (Example: cp source-file destination-file)
8 mv to move a file (Example: mv source-file destination file)
9 mkdir to create a new directory (Example: mkdir directory-name)
10 rm to delete a file (Example: rm filename) and to delete a file in interactive
mode (Example: rm -i filename)
11 rmdir to delete a directory (Example: rm directory-name)
12 passwd to change current password
13 chmod to set different modes (permissions) of the file
14 date to see date
15 cal [[month] year] to see calender of specified month and year
16 bc/xcalc calculator
17 more/less to view large file one page at a time (Example: man cc filename — more)
18 wc line, word, character count (Example: wc [option (l, w, c)] filename)
19 cmp compare two files (Example: cmp file1 file2)
20 comm common part of two files (Example: comm file1 file2)
21 man to see manual (Example: man command-name)

1
4 Some basic vi editor commands

Sl. Command Description


No. (Syntax)
1 vi filename to open a file
2 ESC i to insert some text in file
3 ESC :w to save file
4 wq to save current file and quit from vi editor
5 q! to quit from vi editor without saving current file
6 ESC :set nu to set line numbers in the current file
7 yy to store a line into buffer
8 Nyy to store a N lines into buffer starting from current line
9 p to paste from buffer
10 dd to delete entire line
11 Ndd to delete N lines beginning with the current line
12 dw delete the single word beginning with character under cursor
13 dNw delete N words beginning with character under cursor
14 ESC :N move to line number N
15 ESC :$ move to last line
16 ESC :1,$s/old/new/g to replace every occurrence of old by new
17 ESC :%s/old/new/g same as item number 16
18 ESC :50,70s/old/new/g to replace every occurrence of old by new between line num-
bers 50 and 70
19 ESC :50,70s/old/new/gc to replace every occurrence of old by new between line num-
bers 50 and 70 with confirmation
20 ESC :1,$s/old/new/g to replace every occurrence of old by new with confirmation
21 ESC :%s/old/new/g same as item number 20

S-ar putea să vă placă și