Reply to comment

Basic commands to get around the Synology Box using the CLI

I found this useful article on
synology Forum

Thanks to Synology!

File Management

To edit a text file (using vi)

For info on how to use vi see Basic commands for Linux vi Editor

vi /location_of_file/file_name

To go to a directory

cd /directoryName

Make a directory

mkdir /directoryName

List contents of Directory


Check size of Directory and sub-directories

du -ah /path/to/dir

Find a file

find / -name fileName

Delete a file

rm fileName

Delete a directory and its content

rm -r directoryName
  • Note: Use this command with great care

Move or Rename a file

mv /sourceDirectory/sourceFile /destination

Copy a file

cp /sourceDirectory/sourceFile /destination

Copy groups of files

cp /sourceDirectory/*.* /destination

Copy a directory and any sub directories

cp -r -p /sourceDirectory /destinationpath

Create a uncompressed tar (.tar) archive

To create a uncompressed (.tar) archive of all files directories and subdirectories in the current directory:

tar -cvf archivefilename.tar *

Create a compressed tar (.tgz) archive

To create a compressed (.tgz) archive of all files directories and subdirectories in the current directory:

tar -cvzf archivefilename.tgz *

Unpack .tar archives

For uncompressed .tar archives:

tar xvf file.tar

Unpack .tar.gz archives

For gzip compressed .tar.gz archives:

tar xvzf file.tar.gz

System Management

Reboot the Synology box


Shutdown the Synology box


Stop a process

kill processID

Stop a program

killall programName

Display most current processes running


Report disk space usage


Show all current processes


Show currently open ports and their status

netstat -an

Change Logged in user

If you are logged in as root you can open a new shell as if you just logged in as another user, substitute xxx with the user name. To return to root session use "exit"

su – xxx

Install a ipkg program package

Note: This assumes you have already installed ipkg itself.

ipkg install fileName

Uninstall a ipkg program package

ipkg remove filename

Restart Services


/usr/syno/etc/rc.d/ restart


/usr/syno/etc/rc.d/ restart


/usr/syno/etc/rc.d/ stop
/usr/syno/etc/rc.d/ start


/usr/syno/etc/rc.d/ restart


/usr/syno/etc/rc.d/ restart


/usr/syno/etc/rc.d/ restart


/usr/syno/etc/rc.d/ restart


/usr/syno/etc/rc.d/ restart


/usr/syno/etc/rc.d/ restart


/usr/syno/etc/rc.d/ restart


/usr/syno/etc.defaults/rc.d/ restart

System Information

Check system memory info

cat /proc/meminfo

Check CPU Info

cat /proc/cpuinfo

Check Interrupts in use

cat /proc/interrupts

Check File Systems in use

cat /proc/filesystems

Comprehensive information on the file system format

tune2fs -l /dev/hda3

Check Linux Version

cat /proc/version

Check RAID Devices

cat /proc/mdstat

Check Enviroment Variables


Check what physical and logical disks/partitions you have

For multibay NASs and more info
cat /proc/diskstats

or for all NAS types

cat /proc/partitions

or for similar but different info

fdisk -l


Clear terminal screen



  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

This question is for testing whether you are a human visitor and to prevent automated spam submissions.
3 + 1 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.