Humour: Funny Behaviour of rm Command

1
2
3
4
5
6
7
8
9
10
11
12
13
14
[root@localhost pub]# ll
total 1648
-rw-r--r--  1 root root  85648 Jun  5 23:52 14thtop.png
-rw-r--r--  1 root root 262852 Jun  5 23:52 orkuthelper.png
-rw-r--r--  1 root root 143804 Jun  5 23:52 shot1.png
-rw-r--r--  1 root root 160552 Jun  5 23:52 shot2.png
-rw-r--r--  1 root root 159934 Jun  5 23:52 shot3.png
-rw-r--r--  1 root root 141849 Jun  5 23:52 shot4.png
lrwxrwxrwx  1 root root      9 Jun  4 18:44 windows -> /windows/
[root@localhost pub]# rmdir windows/
rmdir: 'windows/': Not a directory
[root@localhost pub]# rm windows/
rm: cannot remove directory 'windows/': Is a directory
[root@localhost pub]#

can you just tell me how to remove this directory? plz… urgent help required …

 

How To: Troubleshoot SCP Command

Some times we face problems in transferring the data from one machine to other machine using scp. Actually the scp command is executed successfully but the data is not transferred. As the .bashrc and not the .bash_profile file of the system to which the data is being transferred is executed. If the .bashrc of the remote system contains any command or executable which output some data to the standard output then that command is executed and the output is flushed on the local machine and the scp command is terminated and data is not transferred.

For example if the remote machine has any ‘echo’ or ‘nfrm’ command in .bashrc file, the scp of the data will not be possible.
Also suppose the remote machine has a lines in .bashrc like this

./test.sh

where test.sh contains the data as below:-

1
2
#/usr/bin/sh
echo "Kulbir Saini"

Then also the scp will not be possible.

So if you are facing such problems please try to remove such lines from your .bashrc file and scp the data you want.
Anyway you can keep those lines in your .bash_profile because it is not executed while transferring the data.

Please report any other cases in which scp is not possible.

 

How To: Remote Desktop to Windows Machine from Linux

If you know IP of a windows system and also you have a username and password. Then you can easily work in windows environment of that system from a Linux desktop provided that the remote system is switched on and is booted in windows. Also no one is logged in on that pc because only one person can access the pc at a time through this procedure.

There is a simple command u can launch from a linux terminal and that is..

[kulbirsaini@localhost ~] rdesktop -f  [IP address of the remote system]   [Enter]

e.g

[kulbirsaini@localhost ~] rdesktop -f 222.36.226.30 [Enter]

The full screen mode will appear and will ask for your username and password. Enter your password and experience that u r working in windows…

To return to the Linux press [ctrl-alt-enter] or go to the start menu and click disconnect. If this doesn’t work and you get some errors. Then you have to do some setting on the pc you want to access. Go to the pc and boot in windows and login as privileged user who has administrative privileges. Now click start and open my computer and go one directory up. Now right click on the my computer icon and click on properties. A new window will appear and on that window click remote and make sure that there is tick mark on the option “Allow users to connect remotely.”

 

How To: Yahoo Messenger on Teaching Lab Machines

Though the pcs in the labs are not having any support for applications except terminal or command line, Linux version of yahoo messenger can be opened there. This is a step by step procedure.

Step 1

Open two terminals and through one of them logon on to your mirage server account because that supports the Gaim(Linux version of yahoo messenger).

Step 2

Now I will call the terminal in which you are logged into mirage as remote machine and the terminal of the machine at which you are working as local machine.
At your local machine execute these commands.

1
2
[kulbir@localhost ~] xhost + [Enter]
access control disabled, clients can connect from any host

The messege displayed above should appear otherwise you may have problems.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[kulbir@localhost ~] /sbin/ifconfig [Enter]
eth0      Link encap:Ethernet  HWaddr 00:11:2F:57:C5:9D
inet addr:372.12.226.25  Bcast:122.12.226.123  Mask:212.223.345.138
UP BROADCAST RUNNING MULTICAST  MTU:1520  Metric:1
RX packets:136851 errors:0 dropped:0 overruns:0 frame:0
TX packets:82928 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:71106959 (67.8 Mb)  TX bytes:40997603 (39.0 Mb)
Interrupt:10
lo        Link encap:Local Loopback
inet addr:122.4.4.1  Mask:252.2.2.1
UP LOOPBACK RUNNING  MTU:11436  Metric:1
RX packets:46123 errors:0 dropped:0 overruns:0 frame:0
TX packets:46123 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:22001021 (20.9 Mb)  TX bytes:22001021 (20.9 Mb)

The address against inet_addr in 3rd line is the IP address of your local machine.

Step 3

Now switch to your remote machine terminal and issue the following commands…

[kulbir@server ~] export DISPLAY=[IP address]:0.0  [Enter]

e.g.

[kulbirsaini@server ~] export DISPLAY=222.26.36.5:0.0 [Enter]

If no error comes, means things are going fine.

[kulbir@server ~] xterm [Enter]

Now also if no error comes and a new teminal appears then you are ready to open the gaim.
Issue this command on the new appeared terminal

[kulbir@server ~] gaim [Enter]

yahoo messenger will appear and now you are ready to chat.
Add your account to the messenger and chat 😀