Find the answer to your Linux question:
Results 1 to 9 of 9
Is there a way to delete, change permissions, and do anything else with files and folders starting with "."?...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Oct 2004
    Posts
    139

    how to deal with files starting with "."?


    Is there a way to delete, change permissions, and do anything else with files and folders starting with "."?

  2. #2
    Linux User
    Join Date
    Jan 2005
    Location
    Arizona
    Posts
    288
    Yeah, they're just like any other file, except:

    ls -l #to list them
    mv * /foobar #ignores them unless the dot is specified, same with cp, rm/rmdir, and chmod/chown
    Michael Salivar

    Man knows himself insofar as he knows the world, becoming aware of it only in himself, and of himself only within it.
    --Goethe

  3. #3
    Linux Guru loft306's Avatar
    Join Date
    Oct 2003
    Location
    The DairyLand
    Posts
    1,666
    er... that would be
    Code:
    ls -al
    to list hidden files

    and to manipulate most .foo files you need to be root
    Code:
    su - root
    enter then the root passwd.
    ~Mike ~~~ Forum Rules
    Testing? What's that? If it compiles, it is good, if it boots up, it is perfect. ~ Linus Torvalds
    http://loft306.org

  4. $spacer_open
    $spacer_close
  5. #4
    Linux User
    Join Date
    Oct 2004
    Location
    /dev/random
    Posts
    404
    Quote Originally Posted by loft306
    and to manipulate most .foo files you need to be root
    Code:
    su - root
    enter then the root passwd.
    Why?
    Even a normal user can manipulate the hidden file (filename starting with ".") provided he/she has proper permissions. You can edit your own ~/.bash_profile, ~/.bash_history, ~/.bashrc etc. These are hidden, but that doesn't forbid you from editing them even if you don't login/su as/to root.
    The Unforgiven
    Registered Linux User #358564

  6. #5
    Linux User
    Join Date
    Jan 2005
    Location
    Arizona
    Posts
    288
    Blah, of course it is, that'll teach me to post after a couple beers. Thanks for the correction.

    But I don't know about having to be root. In most distributions I've tried everything in the ~ directory is owned by that user.
    Michael Salivar

    Man knows himself insofar as he knows the world, becoming aware of it only in himself, and of himself only within it.
    --Goethe

  7. #6
    Linux Guru loft306's Avatar
    Join Date
    Oct 2003
    Location
    The DairyLand
    Posts
    1,666
    well you can edit the ones in your /home/user dir however the ones in other places should be edited as root
    i'd rather edit as root instead of lessening permissions systemwide a bit more secure
    ~Mike ~~~ Forum Rules
    Testing? What's that? If it compiles, it is good, if it boots up, it is perfect. ~ Linus Torvalds
    http://loft306.org

  8. #7
    Linux User
    Join Date
    Oct 2004
    Location
    /dev/random
    Posts
    404
    Quote Originally Posted by loft306
    well you can edit the ones in your /home/user dir however the ones in other places should be edited as root
    i'd rather edit as root instead of lessening permissions systemwide a bit more secure
    Well, a normal user is anyway not supposed to "wander" into other parts of the filesystem for editing files - apart from his home directory (and possibly, some mountpoints). You're supposed to use well-defined system commands/tools (again, for a normal user, restricted to /bin, /usr/bin etc. - nothing that is part of *sbin*).

    That's the job of a sysadmin anyway
    The Unforgiven
    Registered Linux User #358564

  9. #8
    Just Joined!
    Join Date
    Jan 2005
    Location
    Los Angeles
    Posts
    40

    speaking of dot-files....

    I posted this question up in the RH/FC forum under the topic "ls output order" but I thought there might be some knowledge base here in Misc that doesn't look there.

    I'm running FC3 and before that, I had RH7. In both cases I noticed that when I run 'ls-al' the files list in alphabetical order, but with the dot-files interspersed as if the leading "." was being ignored in the sorting. In all other u*nx systems I've used, including older versions of Linux, dot-files get listed first, and then the non-dot-files are listed.

    It's becoming irritating to me now because FC3 is so good, I hardly use the Windows side of my computer any more. Someone did suggest
    Code:
    ls -ald .* && ls -al
    , but that doesn't fix the problem in Emacs dired, where I'm usually browsing my directories.

    Does anyone know how to fix this, why it changed, and whether or not the "feature" is limited to RH/FC?

    tia,

    peter

  10. #9
    Just Joined!
    Join Date
    Jan 2005
    Location
    Los Angeles
    Posts
    40

    found the answer to my own question...

    Code:
    LC_ALL="C"
    export LC_ALL
    this does it. I found it in footnote 2 of this page in gnu-land:
    http://www.gnu.org/software/coreutil...eutils_52.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •