LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-16-2017, 10:27 AM   #1
Joy Stick
Member
 
Registered: Dec 2015
Distribution: RHEL 4.7
Posts: 127

Rep: Reputation: 0
Pulling directories


Hi all,

PHP Code:
[root@AUSDEV Desktop]# pwd
/root/Desktop

[root@AUSDEV Desktop]# ls -l
total 8
drwxr
-xr-x 3 root root 4096 Jul 16 23:32 dir1
drwxr
-xr-x 3 root root 4096 Jul 16 23:37 DIR1 
PHP Code:
[root@AUSDEV Desktop]# tree dir1
dir1
|-- dir2
|   `-- dir3
|       
`-- dir4
|           `-- dir5
`-- f1

4 directories
1 file 
PHP Code:
 [root@AUSDEV Desktop]# tree DIR1
DIR1
`-- DIR2

1 directory, 0 files 
# cp -rf /dir* .

PHP Code:
[root@AUSDEV DIR2]# ls -l
total 4
drwxr
-xr-x 3 root root 4096 Jul 17 01:22 dir1

[root@AUSDEV DIR2]# cd dir1/
[root@AUSDEV dir1]# ls -l
total 4
drwxr
-xr-x 4 root root 4096 Jul 17 01:22 dir2

[root@AUSDEV dir1]# cd dir2/
[root@AUSDEV dir2]# ls -l
total 8
drwxr
-xr-x 3 root root 4096 Jul 17 01:22 dir1
drwxr
-xr-x 3 root root 4096 Jul 17 01:22 dir3 
My question is
Why directory dir1 is created under directory dir2 ?

Thanks in advance.

Last edited by Joy Stick; 07-16-2017 at 12:48 PM.
 
Old 07-16-2017, 11:08 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,754

Rep: Reputation: 7563Reputation: 7563Reputation: 7563Reputation: 7563Reputation: 7563Reputation: 7563Reputation: 7563Reputation: 7563Reputation: 7563Reputation: 7563Reputation: 7563
you copied /dir* into the local dir. I have no idea what is /dir*, but probably that is the reason.
What will: tree /dir* say?
 
Old 07-16-2017, 12:50 PM   #3
Joy Stick
Member
 
Registered: Dec 2015
Distribution: RHEL 4.7
Posts: 127

Original Poster
Rep: Reputation: 0
# cd Desktop/
[root@AUSDEV Desktop]# tree dir*
dir1
|-- dir2
| `-- dir3
| `-- dir4
| `-- dir5
`-- f1

4 directories, 1 file
 
Old 07-17-2017, 12:25 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,754

Rep: Reputation: 7563Reputation: 7563Reputation: 7563Reputation: 7563Reputation: 7563Reputation: 7563Reputation: 7563Reputation: 7563Reputation: 7563Reputation: 7563Reputation: 7563
you missed the /, which is very important. https://en.wikipedia.org/wiki/Filesy...archy_Standard
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Sub-Directories not picking up correct group permissions for new files/directories JockVSJock Linux - Newbie 4 05-07-2017 10:52 AM
Command Line Help: Bulk Moving from Sub-directories to directories vaneen Linux - Newbie 3 02-24-2016 04:11 AM
how to move seleted directories to specific directories by putting condition VijayB Linux - Newbie 3 07-05-2014 03:31 PM
Find the directories which is older than x days delete and zip those directories ramesh pagadala Linux - Newbie 2 08-29-2013 08:17 AM
[SOLVED] Pulling it together.... lonesoac0 Linux - Software 3 01-12-2010 09:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10: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