LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 08-17-2007, 02:01 PM   #1
madwac
Member
 
Registered: Jul 2006
Distribution: kernal 2.6.20-1 2948.fc6 LC2210D
Posts: 48

Rep: Reputation: 15
Moving files


I have the tarballs for the xboard 4.2.7 and Spike on my destop. How do I move these to the opt directory. The code below doesn't work. Is it because I need to use sudo or do I need to create a directory in opt first for all my chess stuff?

[joe@localhost Desktop]$ mv xboard-4.2.7.tar.gz /opt
mv: cannot create regular file `/opt/xboard-4.2.7.tar.gz': Permission denied
 
Old 08-17-2007, 02:02 PM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
You'll need to be root to move the file to /opt.
 
Old 08-17-2007, 05:26 PM   #3
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Try preceeding the command with
Code:
sudo su
to get the root privileges
 
Old 08-17-2007, 05:58 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927
Quote:
Originally Posted by saikee View Post
Try preceeding the command with
Code:
sudo su
to get the root privileges
How do you know that his distro (which he didn't mention)
uses that mechanism at all? ;} If he were using a stock
Slackware or RedHat install that command wouldn't do him
much good.



Cheers,
Tink
 
Old 08-17-2007, 06:34 PM   #5
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
I was going to add
Code:
su
Between "su" and "sudo su" that should about to cover all distros I have come across.
 
Old 08-18-2007, 10:12 AM   #6
madwac
Member
 
Registered: Jul 2006
Distribution: kernal 2.6.20-1 2948.fc6 LC2210D
Posts: 48

Original Poster
Rep: Reputation: 15
moving mv

Still doesn't work.

[joe@localhost ~]$ sudo mv xboard-4.2.7.tar.gz /opt
mv: cannot stat `xboard-4.2.7.tar.gz': No such file or directory
[joe@localhost ~]$
I think because its a tarball I need to treat it differently than a file but how? Either that or /opt needs to be in Path maybe? I'm stumped.
 
Old 08-18-2007, 10:19 AM   #7
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
A tarball is a file. The error message is telling you that there's no such file in the current directory. From your post above, it appears the file is stored in "Desktop" (most likely ~/Desktop), not your home directory (~). So, you can just cd to Desktop first and then move the file. Edit: and no, /opt doesn't need to be in PATH to move files there. PATH is a list of directories the shell searches when looking for executable files.
 
Old 08-18-2007, 10:22 AM   #8
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Since the OP reports a FC6 kernel, we assume he's running on Fedora 6, isn't he? So, madwac, first gather root privileges, since by default directory /opt belong to root, then move the file you want to and (optionally) change file's ownership to root itself. E.g.
Code:
su
<enter root password when prompted>
mv ~joe/Desktop/xboard-4.2.7.tar.gz /opt
chown root:root /opt/xboard-4.2.7.tar.gz
exit
See
Code:
man su
man chown
for details.

Last edited by colucix; 08-18-2007 at 10:24 AM.
 
Old 08-18-2007, 10:54 AM   #9
madwac
Member
 
Registered: Jul 2006
Distribution: kernal 2.6.20-1 2948.fc6 LC2210D
Posts: 48

Original Poster
Rep: Reputation: 15
Duh? That did it. I just woke up and forgot to cd to Desktop. Thanks everyone. I'll most likely be back with tarball questions! The key thing I didn't know was opt belonged to root.
 
Old 08-18-2007, 11:09 AM   #10
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
If you want to see who owns files or directories, you use "ls -l". The third column tells you who the owner of the file is and the fourth tells you which group the file/directory belongs to.
 
Old 08-20-2007, 01:50 PM   #11
madwac
Member
 
Registered: Jul 2006
Distribution: kernal 2.6.20-1 2948.fc6 LC2210D
Posts: 48

Original Poster
Rep: Reputation: 15
Still in the dark

I unpacked the xboard-4.2.7 in /opt but I can't configure it. Even as root in opt it says "no such....." When I tested it the user group was mann/mann. Now it says 541 541 . When I try to change ownership it says no such file or directory. Am I screwed because I didn't change ownership to root before I unpacked it? I'm confused because under file permissions it gives drwxrwxr-x 6 541 541 4096 Nov 28 2003 xboard-4.2.7
which I would think allows anyone read execute. Thanks
P.S. How would I change permissions for all the files and other directories in 'xboard -4.2.7' ??

Last edited by madwac; 08-20-2007 at 01:53 PM.
 
Old 08-20-2007, 02:47 PM   #12
TylerD75
Member
 
Registered: Aug 2004
Location: Norway
Distribution: Gentoo
Posts: 96

Rep: Reputation: 18
If I were you, I'd check out "man chown". This tells you all you need to know.
You could also consider "man ls"... For how to list files/directories in a folder...

But I'll also provide you with the info you need:
1. ~# cd /opt
2. ~# ls -lh
Command 2 will list all files in /opt, with permissions/owner/group. And displays them with "human-readables", which means size of file will be in kb/mb/gb instead of bytes.
Now that you have the list, let's change the owner to root (make sure you're logged on as root or use "su -" or just "su".
3. ~# chmod -R root:root xboard-4.2.7/
The above command will change the owner and group to root and root. (chmod <user>:<group>).
"-R" means the command will be recursive, so it will change owner/group on all files and subdirs in the "xboard-4.2.7" directory.

PS! Just to clarify: Root can change owner on all files (even if there's no existing owner like when you see the owner ID: 541, instead of the owner name), so NO you're not screwed.
Just make sure you change ownership to an existing user/group.
You should also make sure you are in the right directory before you try to configure: "cd /opt/xboard-4.2.7/".

Most linux distros I've encountered also has something called bash completion, so you can usually just type:
~# cd /opt/xbo<TAB>
Where "<TAB>" is the Tab/Tabulator key (2 times). The first time you hit tab (if there is only one file/directory that starts with "xbo") it will complete the typing for you.
The second time you hit tab, bash will list all files/folders that start with "xbo".

Hope this clears up a few things? If not? I need a translator
 
Old 08-20-2007, 08:44 PM   #13
madwac
Member
 
Registered: Jul 2006
Distribution: kernal 2.6.20-1 2948.fc6 LC2210D
Posts: 48

Original Poster
Rep: Reputation: 15
stumped

Thanks! your directions are exellent and confirm everthing I've read. However.....
The files are obviously there-is it because /opt isn't in the root login shell's PATH? I don't know????
-bash-3.1# cd /opt/xboard-4.2.7
-bash-3.1# chown -R root:root xboard-4.2.7/
chown: cannot access `xboard-4.2.7/': No such file or directory
-bash-3.1# chown -R root:root xboard-4.2.7
chown: cannot access `xboard-4.2.7': No such file or directory
-bash-3.1# ls -l
total 2488
-r--r--r-- 1 541 541 684 Feb 5 2001 acconfig.h
-rw-r--r-- 1 541 541 3051 Nov 1 2003 AUTHORS
-rw-r--r-- 1 541 541 263783 Nov 28 2003 backend.c
-rw-r--r-- 1 541 541 8932 Oct 27 2003 backend.h
-rw-r--r-- 1 541 541 3163 Oct 27 2003 backendz.h
drwxr-xr-x 3 541 541 4096 Nov 19 2003 bitmaps
-rwxr--r-- 1 541 541 142195 Nov 27 2003 ChangeLog
-rw-r--r-- 1 541 541 43449 Dec 16 2000 ChangeLog.2
-r--r--r-- 1 541 541 7503 Feb 5 2001 childio.c
-rw-r--r-- 1 541 541 2565 Oct 27 2003 childio.h
-rw-r--r-- 1 541 541 66523 Oct 27 2003 cmail.in
-rw-r--r-- 1 541 541 15185 Oct 27 2003 common.h
-r-xr-xr-x 1 541 541 39311 Apr 20 2002 config.guess
-rw-r--r-- 1 541 541 3003 Dec 16 2000 config.h.in
-r-xr-xr-x 1 541 541 27594 Apr 20 2002 config.sub
-rwxrwxr-x 1 541 541 225722 Nov 28 2003 configure
-rw-r--r-- 1 541 541 9462 Nov 27 2003 configure.in
-rw-r--r-- 1 541 541 18043 Dec 16 2000 COPYING
-rw-r--r-- 1 541 541 2509 Dec 16 2000 COPYRIGHT
-rw-rw-r-- 1 541 541 2350 Nov 16 2003 copyright.texi
-rw-r--r-- 1 541 541 75431 Oct 27 2003 engine-intf.html
-rw-rw-r-- 1 541 541 76173 Nov 28 2003 FAQ
-rw-r--r-- 1 541 541 73859 Nov 28 2003 FAQ.html
-rw-r--r-- 1 541 541 6723 Nov 5 2003 frontend.h
-rw-r--r-- 1 541 541 8305 Oct 27 2003 gamelist.c
-r--r--r-- 1 541 541 18445 Feb 5 2001 gpl.texinfo
-rw-r--r-- 1 541 541 5864 Nov 18 2003 ics-parsing.txt
-r--r--r-- 1 541 541 7832 Feb 5 2001 INSTALL
-r-xr-xr-x 1 541 541 5585 Feb 5 2001 install-sh
-rw-r--r-- 1 541 541 3090 Oct 27 2003 lists.c
-rw-r--r-- 1 541 541 2202 Oct 27 2003 lists.h
-rw-r--r-- 1 541 541 6834 Nov 28 2003 Makefile.in
-rwxr-xr-x 1 541 541 727 Oct 27 2003 mkinstalldirs
-rw-r--r-- 1 541 541 27562 Oct 27 2003 moves.c
-rw-r--r-- 1 541 541 6509 Oct 27 2003 moves.h
-rw-rw-r-- 1 541 541 1987 Nov 28 2003 NEWS
-rw-rw-r-- 1 541 541 138621 Nov 28 2003 parser.c
-rw-r--r-- 1 541 541 2911 Oct 27 2003 parser.h
-rw-r--r-- 1 541 541 23479 Oct 27 2003 parser.l
-rw-r--r-- 1 541 541 7332 Oct 27 2003 pgntags.c
drwxr-xr-x 3 541 541 12288 Oct 27 2003 pixmaps
-rwxr-xr-x 1 541 541 913 Oct 25 2003 pxboard
-rw-rw-r-- 1 541 541 2365 Nov 28 2003 READ_ME
-rwxr-xr-x 1 541 541 835 Dec 15 2001 shiphtml
drwxr-xr-x 3 541 541 4096 Nov 18 2003 sounds
-rwxr-xr-x 1 541 541 5107 Nov 28 2003 texi2man
-rw-r--r-- 1 541 541 62896 Nov 27 2003 ToDo
drwxrwxr-x 4 541 30060 4096 Nov 28 2003 winboard
-rw-r--r-- 1 541 541 243086 Nov 19 2003 xboard.c
-rw-r--r-- 1 541 541 4972 Oct 27 2003 xboard.h
-rw-rw-r-- 1 541 541 141958 Nov 28 2003 xboard.info
-rw-rw-r-- 1 541 541 111389 Nov 28 2003 xboard.man
-rw-rw-r-- 1 541 541 105232 Nov 19 2003 xboard.texi
-rw-rw-r-- 1 541 541 180 Nov 16 2003 xboard.texinfo.in
-rw-rw-r-- 1 541 541 146545 Nov 28 2003 xboard.txt
-rw-r--r-- 1 541 541 12292 Oct 27 2003 xedittags.c
-rw-r--r-- 1 541 541 1304 Oct 27 2003 xedittags.h
-rw-r--r-- 1 541 541 13078 Oct 27 2003 xgamelist.c
-rw-r--r-- 1 541 541 1454 Oct 27 2003 xgamelist.h
-rw-r--r-- 1 541 541 13702 Oct 27 2003 xhistory.c
-rw-r--r-- 1 541 541 1454 Oct 27 2003 xhistory.h
-r--r--r-- 1 541 541 12867 Feb 5 2001 zic2xpm.c
-r--r--r-- 1 541 541 2602 Feb 5 2001 zic2xpm.man
-rw-rw-r-- 1 541 541 3128 Nov 28 2003 zic2xpm.txt
-rw-r--r-- 1 541 541 34680 Nov 24 2003 zippy.c
-rw-r--r-- 1 541 541 2867 Oct 27 2003 zippy.h
-rw-r--r-- 1 541 541 1503 Dec 16 2000 zippy.lines
-rw-r--r-- 1 541 541 18512 Nov 16 2003 zippy.README
-bash-3.1#
 
Old 08-21-2007, 12:06 AM   #14
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Quote:
Originally Posted by madwac View Post
Thanks! your directions are exellent and confirm everthing I've read. However.....
The files are obviously there-is it because /opt isn't in the root login shell's PATH? I don't know????
Read my post above about PATH.
Quote:
-bash-3.1# cd /opt/xboard-4.2.7
-bash-3.1# chown -R root:root xboard-4.2.7/
You've changed directory to /opt/xboard-4.2.7 (i.e. it's the current directory) and obviously the directory isn't inside itself! You want to cd to /opt and then do a chown. Edit: or obviously just do "chown -R root:root *" from /opt/xboard-4.2.7.

Last edited by Nylex; 08-21-2007 at 02:11 AM.
 
Old 08-22-2007, 09:26 AM   #15
madwac
Member
 
Registered: Jul 2006
Distribution: kernal 2.6.20-1 2948.fc6 LC2210D
Posts: 48

Original Poster
Rep: Reputation: 15
Still in the dark

I cd'd to opt and typed 'sudo chown -R root:root *' and then when I typed ls-l- bingo! both the tar.gz and the directory /xboard-4.2.7 belong to root. Then I typed cd /opt/xboard-4.2.7 and then ls -l and all the files belong to root. Thanks for your excellent explanation!

Last edited by madwac; 08-22-2007 at 09:32 AM.
 
  


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
Need help moving files. EYEdROP Linux - Newbie 26 03-07-2007 10:20 PM
moving files Baghdad Linux - Newbie 5 01-22-2006 01:39 AM
Moving files UmneyDurak Fedora 4 08-28-2005 05:52 PM
Moving Files arockia Linare 3 09-08-2004 08:14 AM
Moving Files jhotchkiss Linux - Newbie 5 09-16-2003 03:41 PM

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

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