LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-20-2008, 03:37 PM   #1
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Rep: Reputation: 47
Small help


The following command created directory called 'rubbish100'.
I didn't create it as a super user.
Where does it reside?

cd ~/ && mkdir .rubbish100

ni@linux-j5q7:~> cd ~/ && mkdir .rubbish100
ni@linux-j5q7:~>


ni@linux-j5q7:~> rmdir rubbish100
rmdir: failed to remove `rubbish100': No such file or directory
ni@linux-j5q7:~>

Where does it reside? How do I remove it?

Your thoughts are welcome.
 
Old 09-20-2008, 03:43 PM   #2
estabroo
Senior Member
 
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,126
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
You created it with a . in front that makes it a normally not visible directory. use ls -a to see it. To remove it just do rmdir .rubbish100
 
Old 09-20-2008, 03:43 PM   #3
Peacedog
LQ Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,296

Rep: Reputation: 168Reputation: 168
Hi Gins, You missed a "." try this.
Code:
rmdir .rubbish100
Good luck. ;-)
 
Old 09-20-2008, 03:44 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Gins, please use useful thread titles next time.
 
Old 09-20-2008, 04:04 PM   #5
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47
I do not know what this sign ' && ' is doing here. What does it mean?
---------------------------------------

acid_kewpie

Sometimes back you touced on the topic of sensible thread title.

This my stupidity.

I have to eat humble pie.

Last edited by Gins; 09-20-2008 at 04:06 PM.
 
Old 09-20-2008, 05:27 PM   #6
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,687

Rep: Reputation: 55
first execute the "cd ~" command (change directory to /home/_username_ ) and if (and only if) it succseeds, execute "mkdir .rubbish100" after that.
so:
the command changed the working directory to ~ (the base of the home directory of the user who runs the command) - and then created a directory ".rubbish100" inside the /home/_username_ directory of the user from which the command was run/of the user you where logged in as.
 
Old 09-21-2008, 03:29 AM   #7
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47
Thanks jomen for the reply.

cd ~/ --> It is obvious that this changes to /home/ni.

What is ' && ' doing?

I just tried without ' && ' and it worked fine.

Please read the following:


ni@linux-j5q7:~> cd ~/ mkdir .rubbish100
ni@linux-j5q7:~>

---------------------------------------
I tried in vain to remove it.

ni@linux-j5q7:~> rmdir rubbish100
rmdir: failed to remove `rubbish100': No such file or directory
ni@linux-j5q7:~>

ni@linux-j5q7:~> rmdir .rubbish100
rmdir: failed to remove `.rubbish100': No such file or directory
ni@linux-j5q7:~>

ni@linux-j5q7:~> rmdir /.rubbish100
rmdir: failed to remove `/.rubbish100': No such file or directory
ni@linux-j5q7:~>

How do I remove it?
 
Old 09-21-2008, 03:36 AM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
"a && b" means execute a and following a successful exit, run b.

anyway, a file called "rubbish100" is very obviously not the same file as one called ".rubbish100" just as it is not a file called "bob" or "flipper_the_table_tennis_playing_baboon" they clearly have different names. no more confusion about that please.

"cd ~/ mkdir .rubbish100" is two commands crammed into one, so never going to do what it should. does this dir actually exist? you know how to use ls right?? you know to use the -a flag?

Last edited by acid_kewpie; 09-21-2008 at 03:39 AM.
 
Old 09-21-2008, 03:36 AM   #9
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Quote:
Originally Posted by Gins View Post
Thanks jomen for the reply.

cd ~/ --> It is obvious that this changes to /home/ni.

What is ' && ' doing?

I just tried without ' && ' and it worked fine.

Please read the following:


ni@linux-j5q7:~> cd ~/ mkdir .rubbish100
ni@linux-j5q7:~>

---------------------------------------
I tried in vain to remove it.

ni@linux-j5q7:~> rmdir rubbish100
rmdir: failed to remove `rubbish100': No such file or directory
ni@linux-j5q7:~>

ni@linux-j5q7:~> rmdir .rubbish100
rmdir: failed to remove `.rubbish100': No such file or directory
ni@linux-j5q7:~>

ni@linux-j5q7:~> rmdir /.rubbish100
rmdir: failed to remove `/.rubbish100': No such file or directory
ni@linux-j5q7:~>

How do I remove it?
Gins, this has been explained to you and it is very basic:
What is ' && ' doing? - as jomen said: first execute the "cd ~" command (change directory to /home/_username_ ) and if (and only if) it succseeds, execute "mkdir .rubbish100" after that.

You need to issue ls -la in your home directory - that will list all files and folders stored there. See if the folder .rubbish100 is there at all, if not it would give you a hint as to why you can't delete it.

and trying to delete /.rubbish100 will fail because you are asking the system to delete a file or folder from your root directory when the folder was created in your home directory.

See if the file or folder is in your home directory before you try to remove it.
 
Old 09-21-2008, 04:17 AM   #10
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47
Thanks acid kewpie and XavierP for taking time to reply me.

I know there is a difference between '.rubbish100 ' and 'rubbish100' in this situation.

I didn't know the following:
"a && b" means execute a and following a successful exit, run b.

I ran the command 'ls -la' even as a superuser.

I didn't find the file in question.

It may be the file creation didn't take place.

What do you think?
 
Old 09-21-2008, 04:18 AM   #11
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
it clearly isn't there if ls doesn't show it.
 
Old 09-21-2008, 06:48 AM   #12
dv502
Member
 
Registered: Sep 2006
Location: USA - NYC
Distribution: Whatever icon you see!
Posts: 642

Rep: Reputation: 57
Hey Gins,

You can change to your home directory anytime by typing cd by itself. Typing cd ~ or cd ~/ will do the same thing, but why waste time typing extra characters.

If you want to execute multiple commands on one line, use the semicolon to separate the commands. For your example

cd ; mkdir .rubbish100

cd && mkdir .rubbish100

The semicolon separator will run the next command weather the first command was successful or not. The && uses the exit status of 0 or true. If the first command was susccesful, the second command is executed. If not, the second command is not executed.

To remove a directory, type rmdir .rubbish100

Note: rmdir works only on empty directories, use rm -rf to delete a directory with files. Use with caution.

Last edited by dv502; 09-21-2008 at 07:08 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: DLS <small>[<i>sic</i>]</small> answers user requests with 4.0 alpha LXer Syndicated Linux News 0 07-19-2007 07:46 PM
A small help Gins Linux - General 4 05-31-2005 03:37 PM
Small Fonts... Too much small! cubax Debian 3 03-28-2005 11:31 AM
Openldap with small directory very small iholdap Linux - Networking 5 10-04-2003 08:09 AM
3 small problems in 1 small post vzzt! Linux - Software 10 02-27-2003 07:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration