Вы находитесь на странице: 1из 12

1) passwd

student@linux-a5si:~> passwd student


Changing password for student.
Old Password:
New Password:
Bad password: too simple
New Password:
Bad password: too similar
New Password:
Reenter New Password:
Password changed.
student@linux-a5si:~>

2 ) cd
student@linux-a5si:~> cd /home/student/Desktop/
student@linux-a5si:~/Desktop>

3) cp
student@linux-a5si:~/Desktop> cp fit.c /home/student/
student@linux-a5si:~/Desktop>
(helps to copy a file)

4) du
student@linux-a5si:~> du
8
./.qt
4
./.local/share/Trash/info
4
./.local/share/Trash/files
12
./.local/share/Trash
16
./.local/share
20
./.local
4
./bin
4
./.gconf
8
./.skel
128 ./Desktop
16
./.fontconfig
8
./.dbus/session-bus
12
./.dbus
28
./.mozilla/firefox/cbs4n2s9.default/Cache
36
./.mozilla/firefox/cbs4n2s9.default/bookmarkbackups
12
./.mozilla/firefox/cbs4n2s9.default/chrome

4
./.mozilla/firefox/cbs4n2s9.default/extensions
3576 ./.mozilla/firefox/cbs4n2s9.defaultfault
76
./.kde4/share/apps/carddecks
64
./.kde4/share/apps/kpat
8
./.kde4/share/apps/kconf_update/log
12
./.kde4/share/apps/kconf_update
156 ./.kde4/share/apps
4
./.kde4/share/applnk/GNOME Settings
8
./.kde4/share/applnk
272 ./.kde4/share
276 ./.kde4
160 ./.thumbnails/large
2116 ./.thumbnails/normal
2280 ./.thumbnails
4
./.gimp-2.4/brushes
4
./.gimp-2.4/gflare
4
./.gimp-2.4/gradients
4
./.gimp-2.4/themes
4
./.gimp-2.4/fractalexplorer
4
./.gimp-2.4/environ
4
./.gimp-2.4/patterns
4
./.gimp-2.4/tmp
4
./.gimp-2.4/modules
4
./.gimp-2.4/fonts
4
./.gimp-2.4/plug-insvate
4
./.gconfd
8
./.mcop/trader-cache
16
./.mcop
88
./.wapi
8
./.ooo-2.0/user/autotext
180 ./.ooo-2.0/user/database/biblio
192 ./.ooo-2.0/user/database
16
./.ooo-2.0/user/basic/Standard
4
./.ooo-2.0/user/psprint/driver
4
./.ooo-2.0/user/psprint/fontmetric
40
./.ooo-2.0/user/psprint
4
./.ooo-2.0/user/temp
40
./.ooo-2.0/user/store
4
./.ooo-2.0/user/autocorr
4
./.ooo-2.0/user/template
4
./.ooo2.0/user/uno_packages/cache/registry/com.sun.star.comp.deployment.script.PackageRegistryBackend
4
./.ooo2.0/user/uno_packages/cache/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBa
ckend/registry
16
./.ooo2.0/user/uno_packages/cache/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBa
ckend
4
./.ooo-

2.0/user/uno_packages/cache/registry/com.sun.star.comp.deployment.help.PackageRegistryBackend
28
./.ooo2.0/user/uno_packages/cache/registry/com.sun.star.comp.deployment.component.PackageRegistryBack
end
4
./.ooo2.0/user/uno_packages/cache/registry/com.sun.star.comp.deployment.sfwk.PackageRegistryBackend
4
./.ooo2.0/user/uno_packages/cache/registry/com.sun.star.comp.deployment.executable.PackageRegistryBack
end
64
./.ooo-2.0/user/uno_packages/cache/registry
4
./.ooo-2.0/user/uno_packages/cache/uno_packages
88
./.ooo-2.0/user/uno_packages/cache
92
./.ooo-2.0/user/uno_packages
2484 ./.ooo-2.0/user
2492 ./.ooo-2.0
8
./.fonts
8
./.kde/Autostart
24
./.kde/share/mimelnk/application
8
./.kde/share/mimelnk/text
36
./.kde/share/mimelnk
8
./.kde/share/config/kresources/note
4
./.kde/share/apps/kwallet
420 ./.kde/share/apps
4
./.kde/share/applnk/LabyrinthIndex
4
./.beagle/Indexes/FileSystemIndex/Locks
76
./.beagle/Indexes/FileSystemIndex/PrimaryIndex
24
./.beagle/Indexes/FileSystemIndex/SecondaryIndex
120 ./.beagle/Indexes/FileSystemIndex
4
./.beagle/Indexes/EmpathyIndex/Locks
12
./.beagle/IndendaryIndex
40
./.beagle/Indexes/KonqHistoryIndex
820 ./.beagle/Indexes
4
./.beagle/config
4
./.beagle/TextCache/52
4
./.beagle/TextCache/f6
4
./.beagle/TextCache/82
4
./.beagle/TextCache/cd
4
./.beagle/TextCache/8d
4
./.beagle/TextCache/d2
4
./.beagle/TextCache/78
4
./.beagle/TextCache/e6
4
./.beagle/TextCache/d4
4
./.beagle/TextCache/7d
4
./.beagle/TextCache/66
4
./.beagle/TextCache/45
4
./.beagle/TextCache/ee
4
./.beagle/TextCache/47
4
./.beagle/TextCache/63
4
./.beagle/TextCache/ce

4
./.beagle/TextCache/6b
4
./.beagle/TextCache/42
1032 ./.beagle/TextCache
1900 ./.beagle
64
./.config

5) df
student@linux-a5si:~> df
Filesystem
1K-blocks Used Available Use% Mounted on
/dev/sda6
23640176 4615744 17823576 21% /
udev
512348
116 512232 1% /dev
/dev/sdb
1973984 1342848 631136 69% /media/$W@PN@

6) find
student@linux-a5si:~> find /home/student/Desktop/fit.c
/home/student/Desktop/fit.c

7) ps -A
student@linux-a5si:~> ps -A
PID TTY
TIME CMD
1?
00:00:02 init
2?
00:00:00 kthreadd
3?
00:00:00 migration/0
4?
00:00:00 ksoftirqd/0
5?
00:00:00 migration/1
6?
00:00:00 ksoftirqd/1
7?
00:00:00 events/0
8?
00:00:00 events/1
9?
00:00:00 khelper
10 ?
00:00:00 kblockd/0
11 ?
00:00:00 kblockd/1
12 ?
00:00:00 kacpid
13 ?
00:00:00 kacpi_notify
14 ?
00:00:00 cqueue
15 ?
00:00:00 kseriod
16 ?
00:00:00 kondemand/0
17 ?
00:00:00 kondemand/1
18 ?
00:00:00 pdflush
19 ?
00:00:00 pdflush
20 ?
00:00:00 kswapd0

21 ?
00:00:00 aio/0
22 ?
00:00:00 aio/1
23 ?
00:00:00 kpsmoused
70 ?
00:00:00 ata/0
71 ?
00:00:00 ata/1
72 ?
00:00:00 ata_aux
79 ?
00:00:00 scsi_eh_0#include<stdio.h>
#include<stdlib.h>
struct process
{
float bt,at,wt,ta;
float awt,ata;
};
struct process p[10],q[10];
int main()
{
int n,i,j=1,count=0;
float a;
p[0].bt=0.0;
float tbt=0.0,twt=0.0,tta=0.0;
printf("\nMAIN MENU");
printf("\n1. FCFS");
printf("\n2. SJF");
printf("\nEnter ur choice : ");
scanf("%d",&ch);
printf("\nHow many processes do u want to add : ");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
printf("\nEnter the Arrival time for %d process : ",i);
scanf("%f",&p[i].at);
printf("\nEnter the Burst time for %d process : ",i);
scanf("%f",&p[i].bt);
}
switch(ch)
{
case 1:{
for(i=1;i<=n;i++)
{
tbt=tbt+p[i-1].bt;
p[i].wt=tbt-p[i].at;
p[i].ta=p[i].wt+p[i].bt;
twt=p[i].wt+twt;
tta=p[i].ta+tta;
printf("\nProcess %d has %f Waiting Time and %f Burst Time ",i,p[i].wt,p[i].ta);
}
p[n+1].awt=(twt/n);
p[n+1].ata=(tta/n);

printf("\nAverage Waiting Time is %f \nAverage TurnAround Time is


%f",p[n+1].awt,p[n+1].ata);
}
case 2:{
for(i=1;i<=n;i++)
{
if(p[i].at==0.0)
{
pos=i;//execute this process
}
}
for(i=1;i<n;i++)
{
if(p[pos].bt>p[i].at)
{
q[j].at=p[i].at;
q[j].bt=p[i].bt;
j++;
count++;
}
}
for(i=count-1;i>0;i--)
{
for(j=0;j<=i;j++)
{
if(q[j].bt>q[j+1].bt)
{
a=q[j].bt;
q[j].bt=q[j+1].bt;
q[j+1].bt=a;
}
}
}
}
80 ?
81 ?
82 ?
205 ?
228 ?
3226 ?
3326 ?
3364 ?
3380 ?
3382 ?

00:00:00 scsi_eh_1
00:00:00 scsi_eh_2
00:00:00 scsi_eh_3
00:00:00 ksuspend_usbd
00:00:00 khubd
00:00:00 cupsd
00:00:00 powersaved
00:00:00 master
00:00:00 pickup
00:00:00 qmgr

3399 ?
00:00:00 cron
3475 ?
00:00:00 smartd
3621 tty1 00:00:00 mingetty
3622 tty2 00:00:00 mingetty
3625 tty3 00:00:00 mingetty
3627 tty4 00:00:00 mingetty
3628 tty5 00:00:00 mingetty
3631 tty6 00:00:00 mingetty
3769 ?
00:00:00 startkde3
3877 ?
00:00:00 start_kdeinit
3878 ?
00:00:00 kdeinit
3881 ?
00:00:00 dcopserver
3883 ?
00:
9682 pts/2 00:00:00 bash
9708 ?
00:00:00 scsi_eh_6
9709 ?
00:00:00 usb-storage
9737 ?
00:00:00 hald-addon-stor
9772 ?
00:00:00 konqueror
9805 pts/3 00:00:00 bash
9843 ?
00:00:05 soffice.bin
9914 ?
00:00:00 beagled-helper
9929 pts/3 00:00:00 man
9938 pts/3 00:00:00 less
9955 pts/2 00:00:00 man
9968 pts/2 00:00:00 less
9978 pts/4 00:00:00 bash
10051 pts/4 00:00:00 ps

8) kill
student@linux-a5si:~> kill 9843

9) ls
student@linux-a5si:~> ls
a.out Desktop fit.c public_html rakesh,c
bin Documents hello.c rakesh1.c vguyokl

10) pwd
student@linux-a5si:~> pwd
/home/student

11) more
student@linux-a5si:~> more
usage: more [-dflpcsu] [+linenum | +/pattern] name1 name2 ...

12) whereis
student@linux-a5si:~> whereis css.odt
css:

13) mv
student@linux-a5si:~> mv fit.c /home/student/Desktop

14) rm
student@linux-a5si:~> rm /home/student/Desktop/fit.c

15) tail
student@linux-a5si:~> tail /home/student/Desktop/peterson.c
}
else
{
flag[i]=1;
turn=i;
}
cnt++;
}
return 0;
}

16) vdir
student@linux-a5si:~> vdir
total 56
-rwxr-xr-x 1 student users 9363 2008-11-19 00:37 a.out
drwxr-xr-x 2 student users 4096 2008-11-05 04:53 bin
drwx------ 2 student users 4096 2009-12-21 14:48 Desktop
drwxr-xr-x 2 student users 4096 2009-12-21 14:34 Documents
-rw-r--r-- 1 student users 65 2008-11-19 00:37 hello.c
drwxr-xr-x 2 student users 4096 2008-11-05 04:53 public_html
-rw-r--r-- 1 student users 909 2008-12-23 02:17 rakesh1.c
-rw-r--r-- 1 student users 909 2008-12-23 02:16 rakesh,c
-rw-r--r-- 1 student users 0 2008-11-19 00:50 vguyokl

17) history
student@linux-a5si:~> history
1 ls
2 fork
3 vi
4 gcc hello.c
5 run
6 ./a.out
7 ./a.in
8 ./a.out
9 fork
10 terminate
11 help
12 vi
13 vi
14 vi rakesh111.c
15 mkdir[c]/home/student/swap
16 mkdir[c]/home/student/bin
17 mkdir[c]media:/sda1
18 ls a
19 ls d
20 ls g
21 ls t
22 cp swap gre
23 mkdir mycomputer/swsap
24 mkdir media:/sdb/s3.pdf
25 mkdir media:/sdb/
26 mkdir media:/sdb/WMPInfo.xml

27
28
29
30
31
32
33

mkdir-p /media:/sda6/usr/src/
mkdir-v/media:/sda6/usr/src/
paaswd swapna
passwd swapna
passwd
passwd student
swapna

18) history !-3


student@linux-a5si:~> history !-3
history find.-name "peterson.c"
bash: history: find.-name: numeric argument required

19) ls -a
student@linux-a5si:~> ls -a
.
.dvipsrc
.kde4
.recently-used
..
.emacs
.local
.skel
a.out
.fit.c.swp
.mcop
.swn
.bash_history
.fontconfig .mozilla
.swo
.bashrc
.fonts
.ooo-2.0
.swp
.beagle
.gconf
.opera
.thumbnails
bin
.gconfd
.prac7.c.swp
vguyokl
.config
.gimp-2.4
.profile
.viminfo
.dbus
.gnome2
public_html
.wapi
.DCOPserver_linux-a5si__0 .gnome2_private .qt
.Xauthority
.DCOPserver_linux-a5si_:0 hello.c
.rakesh111.c.swp .xim.template
Desktop
.ICEauthority rakesh1.c
.xinitrc.template
.dmrc
.inputrc
.rakesh1.c.swp .xsession-errors
Documents
.kde
rakesh,c

20) clear

student@linux-a5si:~> dwrrrrfgefgrcf
bash: dwrrrrfgefgrcf: command not found
student@linux-a5si:~> clear
student@linux-a5si:~>

21) cat
student@linux-a5si:~> cat /home/student/peterson.c
cat: /home/student/peterson.c: No such file or directory
student@linux-a5si:~> cat /home/student/Desktop/peterson.c
#include<stdio.h>
#include<stdlib.h>
int main()
{
int flag[1],turn;
int i,j,cnt;
cnt=0;
turn=i;
flag[0]=1;
turn=0;
i=0;
j=1;
while((flag[i] && turn==i)||(flag[j] && turn==j) && (cnt<4))
{
printf("\ncritical section of process%d",turn);
if(turn==i)
{
flag[j]=1;
turn=j;
}
else
{
flag[i]=1;
turn=i;
}
cnt++;
}
return 0;
}

22) wc -c
student@linux-a5si:~> wc -c /home/student/Desktop/banker.txt
17480 /home/student/Desktop/banker.txt

23) who
student@linux-a5si:~> who
student :0
2009-12-21 13:41 (console)

student
student
student
student
student
student
student
student

pts/0
pts/1
pts/2
pts/3
pts/4
pts/5
pts/6
pts/7

2009-12-21 13:41
2009-12-21 14:45
2009-12-21 14:45
2009-12-21 14:59
2009-12-21 15:09
2009-12-21 15:10
2009-12-21 14:44
2009-12-21 15:10

24) free
student@linux-a5si:~> free
total
used
free shared buffers
Mem:
1024700 845640 179060
0
-/+ buffers/cache: 654160 370540
Swap: 4016208
10692 4005516

cached
7516 183964

25) echo
student@linux-a5si:~> echo unlimited un
unlimited un

Вам также может понравиться