Results 1 to 2 of 2

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

  1. 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.


    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")

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

    SCP will make moving files between servers a breeze. This command usually saves loads of time from downloading files from FTP, then reuploading.

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

    service httpd restart
    Restart the apache web server

    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
    I think you may be mixed up on the tar commands, I work from FreeBSD so perhaps you have a different version of tar

    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
    tar -zcvvf name.tgz files
    The extension is debatable - tar.gz but .tgz is shorter

    To extract the compressed archive
    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.

    [root@sites /tmp/test]# fetch ""
    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


Posting Permissions

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