Command – Tech Stuff https://gofedora.com How Tos, Tutorials, Tips and Tricks Thu, 18 Jun 2015 14:17:41 +0000 en-US hourly 1 https://wordpress.org/?v=4.9.4 Humour: Funny Behaviour of rm Command https://gofedora.com/humour-funny-behaviour-rm-command/ https://gofedora.com/humour-funny-behaviour-rm-command/#comments Sun, 04 Jun 2006 20:49:48 +0000 http://172.17.8.64/gofedora/?p=239 … ]]> [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 …

]]>
https://gofedora.com/humour-funny-behaviour-rm-command/feed/ 4
How To: Troubleshoot SCP Command https://gofedora.com/how-to-troubleshoot-scp-command/ https://gofedora.com/how-to-troubleshoot-scp-command/#comments Wed, 01 Feb 2006 20:36:09 +0000 http://172.17.8.64/gofedora/?p=246 … ]]> 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:-

#/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.

]]>
https://gofedora.com/how-to-troubleshoot-scp-command/feed/ 2
Hack: Graphical Implementation of CP Command https://gofedora.com/hack-graphical-implementation-cp-command/ https://gofedora.com/hack-graphical-implementation-cp-command/#comments Sat, 03 Dec 2005 09:33:48 +0000 http://172.17.8.64/gofedora/?p=260 … ]]> To use this graphical interface do as directed below:

#!/bin/bash
##############################
# Author - Kulbir Saini      #
# Home - http://saini.co.in/ #
##############################

if [ $1 == -i ] || [ $1 == -f ];then          
	if [ ! -s $2 ] && [ ! -f $2 ] && [ ! -d $2 ];then
		dialog --title "Copy daemon" --backtitle "copy:" --infobox "file:$2 doesn't exist.\nCan't copy...\nPress any key..." 5 30; read
	elif [ ! $3 ];then
		dialog --title "Copy daemon" --backtitle "copy:" --infobox "Invalid arguements...\nCan't copy...\nPress any key..." 5 30; read
	elif [ -d $3 ];then
		dialog --title "Copy daemon" --backtitle "copy:" --infobox "$3: is a directory.\nCan't copy...\nPress any key..." 5 30; read
	elif [ -d $2 ];then
		dialog --title "Copy daemon" --backtitle "copy:" --infobox "$2: is a directory.\nCan't copy...\nPress any key..." 5 30; read
	elif [ -s $3 -o -f $3 ];then
		dialog --title "Copy daemon" --backtitle "copy:" --yesno "Do you want to overwrite file:$3" 10 60;
		select=$?
		case $select in 
			0) echo -e "i'm ordered to overwrite file:$3 \noverwriting...\noverwritten file:$3" ; cp -f $2 $3 ;;
			1) echo "i'm ordered not to overwrite.";;
			255) echo "cancelled by you by pressing [Esc].";;
		esac
	else
		dialog --title "Copy daemon" --backtitle "copy:" --yesno "Do you want to copy the file:$2 to file:$3" 10 60 ;
		select1=$?
		case $select1 in
			0) echo -e "i'm ordered to copy file:$2 to file:$3 \ncopying...\ncopied to file:$3" ; cp $2 $3 ;;
			1) echo "i'm ordered not to copy.";;
			255) echo "cancelled by you by pressing [Esc].";;
		esac
	fi
elif [ ! -s $1 ] && [ ! -f $1 ] && [ ! -d $1 ];then
	dialog --title "Copy daemon" --backtitle "copy:" --infobox "file:$1 doesn't exist.\nCan't copy...\nPress any key..." 5 30; read
elif [ ! $2 ];then
	dialog --title "Copy daemon" --backtitle "copy:" --infobox "Invalid arguements...\nCan't copy...\nPress any key..." 5 30; read
elif [ -d $2 ];then
	dialog --title "Copy daemon" --backtitle "copy:" --infobox "$2: is a directory.\nCan't copy...\nPress any key..." 5 30; read
elif [ -d $1 ];then
	dialog --title "Copy daemon" --backtitle "copy:" --infobox "$1: is a directory.\nCan't copy...\nPress any key..." 5 30; read
elif [ -s $2 -o -f $2 ];then
	dialog --title "Copy daemon" --backtitle "copy:" --yesno "Do you want to overwrite file:$2" 10 60;
	select=$?
	case $select in 
		0) echo -e "i'm ordered to overwrite file:$2 \noverwriting...\noverwritten file:$2" ; cp -f $1 $2 ;;
		1) echo "i'm ordered not to overwrite.";;
		255) echo "cancelled by you by pressing [Esc].";;
	esac
else
	dialog --title "Copy daemon" --backtitle "copy:" --yesno "Do you want to copy the file:$1 to file:$2" 10 60 ;
	select1=$?
	case $select1 in
		0) echo -e "i'm ordered to copy file:$1 to file:$2 \ncopying...\ncopied to file:$2" ; cp $1 $2 ;;
		1) echo "i'm ordered not to copy.";;
		255) echo "cancelled by you by pressing [Esc].";;
	esac
fi

1. Get the script here .

2. Move it to a file named ‘copy’.

3. Create a director ‘bin’ in your home directory.

4. Write

export PATH=$PATH:${HOME }/bin/

to your ~/.bashrc file.

5. Execute .bashrc by issuing

[saini@localhost ~]# . .bashrc

6. If you want to copy a file foo.txt to bar.txt then do it as

[saini@localhost ~]# copy foo.txt bar.txt [Enter]

Done.

]]>
https://gofedora.com/hack-graphical-implementation-cp-command/feed/ 2