Results 1 to 2 of 2

Thread: Useful SSH commands for running your own cPanel VPS/Server

  1. #1
    Sundance's Avatar
    Sundance is offline Net Builder
    Join Date
    Jun 2009
    Posts
    169
    Thanks
    2
    Thanked 10 Times in 10 Posts

    Useful SSH commands for running your own cPanel VPS/Server

    After years of managing not only my server but numerous others as well, I've learned quite a few nice SSH commands that can save loads of time.

    First

    Code:
    tar -cvvf name.tar files
    This command will create a compressed folder named "name.tar" of all the files/folders you list (replace files with things like "public_html")

    Code:
    tar -xvf name.tar
    This will extract the tar you made in the previous step

    Code:
    scp user@ip.add.res.ss:/directory
    SCP will make moving files between servers a breeze. This command usually saves loads of time from downloading files from FTP, then reuploading.

    Code:
    service cpanel restart
    Restart cPanel and a load of other services that cPanel depends on

    Code:
    service httpd restart
    Restart the apache web server

    Code:
    service mysql restart
    Restarts mysql server

    (You can replace the "restart" with either stop or start depending if the service is running or if you need to start/stop it.

    That about wraps up most the common ones I use, of course there are a load of others as well such as wget, yum and more but we'll save those for a later post.
    Xbox 720 Next Generation Console - Video gamers check it out!

  2. #2
    Ogle is offline Newbie Net Builder
    Join Date
    Mar 2009
    Posts
    65
    Thanks
    8
    Thanked 7 Times in 4 Posts
    I think you may be mixed up on the tar commands, I work from FreeBSD so perhaps you have a different version of tar

    Code:
    tar -cvvf name.tar files
    This will just create a container for the "files" and they will be the same size as before, but with the benefits of being one file, name.tar

    To create a compressed archive
    Code:
    tar -zcvvf name.tgz files
    The extension is debatable - tar.gz but .tgz is shorter

    To extract the compressed archive
    Code:
    tar -zxf name.tgz
    Note, some file formats are not worth compressing using the above methods, typical examples include media files such as video and music. From my experience they tend to grow in size by a few mb.


    Code:
    [root@sites /tmp/test]# fetch "http://www.wordlistgenerator.net/results.aspx?regular=1&regularish=1&irregular=1&select=randomly"
    results.aspx?regular=1&regularish=1&irregular=100% of  865 kB 4104 kBps
    [root@sites /tmp/test]# mv results.aspx\?regular\=1\&regularish\=1\&irregular\=1\&select\=randomly test.file
    [root@sites /tmp/test]# du -h test.file
    896K    test.file
    [root@sites /tmp/test]# tar -cf test.tar test.file
    [root@sites /tmp/test]# du -h test.tar
    896K    test.tar
    [root@sites /tmp/test]# tar -zcf test.tgz test.file
    [root@sites /tmp/test]# du -h test.tgz
     44K    test.tgz

Similar Threads

  1. Running out of space on a shared server?
    By Qryztufre in forum Web Hosting
    Replies: 6
    Last Post: 15 August, 2010, 14:42 PM

Tags for this Thread

Bookmarks

Posting Permissions

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