Results 1 to 17 of 17
  1. #1

    lol, new guy question, whats the command to delete a file in SSH?

    I tried searching google but couldnt find the answer. What is the command to delete a file while in SSH? Also if anyone can display a list of SSH commands that would be great.

  2. #2
    Join Date
    Nov 2000
    Location
    Tasmania, Australia.
    Posts
    3,587
    rm filename.ext

    Head over to Google and do a search for ssh tutorial, or linux tutorial, and you'll find countless resources. Find one that you are comfortable reading.

    Gary

  3. #3
    Join Date
    Nov 2002
    Location
    Hot, hot Michigan...
    Posts
    3,506
    'man rm' for the details.

    Other commands:
    http://www.oreillynet.com/linux/cmd/

    <edit> Darn, beaten by an aussie again...</edit>
    Ion Web Services/TronicTech
    http://www.ion-web.com or Unsupported webhosting?!?
    Shared hosting, Reseller accounts, Dedicated Servers, and More
    Proudly hosting since 2002

  4. #4
    Thanks

  5. #5
    I went to that website, to delete a directory is the command:

    rm -d, --directory

    ? See I have a few files in my backup from people who cancelled their accounts and I want to remove those files and directories.
    Last edited by lexington; 03-09-2004 at 08:37 PM.

  6. #6
    Join Date
    Nov 2002
    Location
    Hot, hot Michigan...
    Posts
    3,506
    Check that manual by typing 'man rm'. You'll need to read up on this as I'd rather you understand what you're doing WRT deleting files than just accepting blindly what we say.

    Look for 'recursively'
    Ion Web Services/TronicTech
    http://www.ion-web.com or Unsupported webhosting?!?
    Shared hosting, Reseller accounts, Dedicated Servers, and More
    Proudly hosting since 2002

  7. #7
    Thanks, I used that command and it reads

    NAME
    rm - remove files or directories

    SYNOPSIS
    rm [OPTION]... FILE...

    DESCRIPTION
    This manual page documents the GNU version of rm. rm removes each
    specified file. By default, it does not remove directories.

    If a file is unwritable, the standard input is a tty, and the -f or
    --force option is not given, rm prompts the user for whether to remove
    the file. If the response does not begin with y or Y, the file is
    skipped.

    OPTIONS
    Remove (unlink) the FILE(s).

    -d, --directory
    unlink FILE, even if it is a non-empty directory (super-user
    only)


    That doesnt help I just want to delete the directory please.

  8. #8
    Join Date
    Nov 2000
    Location
    Tasmania, Australia.
    Posts
    3,587
    Nothing could be more important than getting used to dealing with "rm" and client sites.

    Gary

  9. #9
    How do I get out of the man rm window it wont let me exit

  10. #10
    Join Date
    Nov 2002
    Location
    Hot, hot Michigan...
    Posts
    3,506
    Originally posted by lexington
    Thanks, I used that command and it reads
    <snip stuff>

    That doesnt help I just want to delete the directory please.
    When you type 'man rm' hit the spacebar to go to the next page... q to quit.

    Trying to teach you to 'fish',
    -Thedavid
    Ion Web Services/TronicTech
    http://www.ion-web.com or Unsupported webhosting?!?
    Shared hosting, Reseller accounts, Dedicated Servers, and More
    Proudly hosting since 2002

  11. #11
    Thanks but I have a weird way of learning things, I start off slow but in the end I become a pro. I do this by asking for the commands I need, then once I memorized all of the most common commands then I take the time to take it to the next level and read up on everything. Right now I am pretty busy and I tried searching but I must not use google properly. Could you please tell me the command to delete a directory please.

  12. #12
    Join Date
    May 2001
    Location
    HK
    Posts
    3,076

    Smile

    rmdir the-directory ...
    Maybe you can do that from cpanel too since you rely on it so much?
    Last edited by YUPAPA; 03-09-2004 at 08:53 PM.

  13. #13
    Originally posted by YUPAPA
    rmdir the-directory ...
    Thanks, that was simple However it says that the directory is not empty

  14. #14
    See that is the thing I already I cannot use cpanel since I deleted that account a long time ago, however it is still stored in my backup so I just want to delete that backup.

  15. #15
    Join Date
    May 2001
    Location
    HK
    Posts
    3,076

    Smile

    force the delete by doing:

    rm -rf 'the dir name'

    Be careful with your butter fingers~ ... put '/' u r toasted

    If you are deleting your users' files, you shouldn't be doing this as root... ... just su to the user account and work on it.

  16. #16
    Yay thanks

  17. #17
    I think the primary problem here is that you are looking for ssh commands on google. You should look for bash/sh/tcsh or linux/unix commands.

    ssh is only the command that allows you to get a shell on a remote machine securely. ssh has no command set other than its very long list of command line options. The command set is that of the machine that you have connected too.

    Consider investing in a book like Unix in a nutshell or Linux in a nutshell by orielly. These contain all of the common shell commands and examples of how to use them. You should also be able to find a shell tutorial online.

    Aaron.

Posting Permissions

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