Command line

From Bytesized Wiki

Revision as of 03:35, 21 October 2010 by ManofPeace (Talk | contribs)
Jump to: navigation, search

Some of the most common commands are shown on the page below


SSH access

To ssh in to your slice you need terminal or terminal emulator.


Open up your terminal and type:

ssh [email protected]

(with servername being your actual server name). You will get screen similar to this


Type yes, then type your password and voila you are connected to your slice via secure shell (ssh).


  • Download putty.
  • When you start it, you should get window like this:


In Hostname box type:

(with servername being your actual server name)


Click open, you should get windows like this:


Click yes. Next, type your username at login: and password at password: and you`re in. (where password is your application password from your dashboard)

Space Check

Best way of checking your disk usage is checking your dashboard. However, if you believe that disk usage is not shown correctly, [SSH] to your slice or open up your [ VNC] start lxterminal and type:

du ~/ -s --si

-s is for summarize, instead of each folder size listed separately —si is for use powers of 1000, not 1024

  • You can create an alias for the above command (or any command) in your .bash_aliases file, which is located in your ~ (home) directory. Just edit the .bash_aliases file, and add this line to it:
alias space='du ~/ -s --si'

You can name it whatever you want – I happen to call it space, because it’s easy for me to remember.

Creating a torrent

  • To make a .torrent file using command line, execute this command:
mktorrent -v -p -a http://tracker.url -o filename.torrent folder_name

-v is for verbose -p is for private, as in not DTH or PeerExchange -a is for tracker url follows -o is for output file name follows

  • Important! The command needs to be all in one line, and quotes must be used around the folder name if it contains spaces.
  • For example, if I wanted to make a torrent for from the data in the "VA – Summer Trance 2009" directory I already have on my server at ~/torrents/completed/VA - Summer Trance 2009, you would navigate to the parent directory to make your torrent. Type to navigate to it:
cd ~/torrents/completed

Then type the following command:

mktorrent -v -p -a -o VA-Summer_Trance_2009.torrent "VA - Summer Trance 2009"

Please note that you must use quotes if the target dir name contains spaces.

Remove a folder

  • To remove a whole folder, with files still in it, execute this command:
rm -rf foldername/

-r is for recursive -f is for force removal If the folder name has a space in it, use quotes around the folder name:

rm -rf "some folder name"

Find files

  • To find specific files by name in your home folder, use this command:
find ~ -name [name_of_file]

~ stands for your home folder; same as $HOME or /home/hd/username

  • For example:
find ~ -name bluray

will find all files with the word bluray in the name. You can use wildcards like * to search a partial name, like blu*

  • To find files by extension, use this command:
find ~ -name "*.[given_extension]"
  • For example:
find ~ -name "*.jpg"

will show you all files, with the .jpg extension.

Find IP Address of your seedbox

  • To find the IP address for your server, use this command:
hostname -i

-i is for IP addresses for the host name

Extracting files on your slice

  • To extract files from a rar archive on the server, use this command:
unrar e SomeMovieChunkFile.rar

-e is for Extract files to current directory

  • To list files inside rar archive without extracting them:
unrar l file.rar

-l is for list (not a number ‘one’)

  • To extract files with full path, type this command:
unrar x file.rar
  • To test integrity of archive file, type this command:
unrar t file.rar

-t is for testing integrity of archive

Stream video from your box

  • Using putty or terminal at your home computer type:
ssh  username:[email protected] cat /path/to/video/file/videofile.mkv | mplayer -cache 32768 -

Flushing DNS cache

  • In terminal, type:
service nscd restart

This command will restart nscd and effectively flush the DNS cache of your box, useful for when trackers move IPs and your client keeps trying to reach the old IP. This will allow your box to get the new DNS entry for your trackers, after you run this command, update tracker on your stalled torrents and it they should run as usual.

Personal tools