Recherche dans la base de connaissances
Basic Command Lines For DSM 7
File Management on DSM 7
To edit a text file (using vi)
vi /location_of_file/file_nameCLICK TO COPY 🐋
To go to a directory
cd /directoryNameCLICK TO COPY 🐋
To make a directory
mkdir /directoryNameCLICK TO COPY 🐋
List contents of directory
dirCLICK TO COPY 🐋
Count the number of files in the current directory and its sub-directories
find . -type f | wc -lCLICK TO COPY 🐋
Check size of directory and sub-directories
du -ah /path/to/dirCLICK TO COPY 🐋
Find a file
find / -name fileNameCLICK TO COPY 🐋
Delete a file
rm fileNameCLICK TO COPY 🐋
Delete a directory and its content
rm -r directoryNameCLICK TO COPY 🐋
Move or Rename a file
mv /sourceDirectory/sourceFile /destinationCLICK TO COPY 🐋
Copy a file
cp /sourceDirectory/sourceFile /destinationCLICK TO COPY 🐋
Copy groups of files
cp /sourceDirectory/*.* /destinationCLICK TO COPY 🐋
Copy a directory and any sub-directories
cp -r -p /sourceDirectory /destinationpathCLICK TO COPY 🐋
Create an uncompressed tar (.tar) archive
To create an uncompressed (.tar) archive of all files, directories and subdirectories in the current directory:
tar -cvf archivefilename.tar *CLICK TO COPY 🐋
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 *CLICK TO COPY 🐋
Unpack .tar archives
For uncompressed .tar archives
tar xvf file.tarCLICK TO COPY 🐋
Unpack .tar.gz archives
For gzip compressed .tar.gz archives
tar xvzf file.tar.gzCLICK TO COPY 🐋
System Management on DSM 7
Reboot your Synology NAS device
rebootCLICK TO COPY 🐋
Shutdown your Synology NAS device
poweroffCLICK TO COPY 🐋
Stop a process on your Synology NAS
kill processIDCLICK TO COPY 🐋
Stop a program on your Synology NAS
killall programNameCLICK TO COPY 🐋
Display most current processes running on your Synology NAS
topCLICK TO COPY 🐋
Report disk space usage on your Synology NAS
dfCLICK TO COPY 🐋
Show all current DSM processes
psCLICK TO COPY 🐋
Show currently open ports and their status on your Synology NAS
netstat -anCLICK TO COPY 🐋
Change Logged in user on your Synology NAS
If you are logged in as root/admin 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 the command line “exit”.
su – xxxCLICK TO COPY 🐋
Install an IPKG program package
Note: Install IPKG.
ipkg install fileNameCLICK TO COPY 🐋
Uninstall an IPKG program package
ipkg remove filenameCLICK TO COPY 🐋
Restart Services on DSM 7
Apache
/usr/syno/etc/rc.d/S97apache-user.sh restartCLICK TO COPY 🐋
Appletalk
/usr/syno/etc/rc.d/S81atalk.sh restartCLICK TO COPY 🐋
Cron and Crond
/usr/syno/etc/rc.d/S04crond.sh stop
/usr/syno/etc/rc.d/S04crond.sh start
systemctl restart crond
systemctl restart synoscheduler
CLICK TO COPY 🐋
FTP
/usr/syno/etc/rc.d/S99ftpd.sh restartCLICK TO COPY 🐋
Index
/usr/syno/etc/rc.d/S66synoindexd.sh restartCLICK TO COPY 🐋
Itunes
/usr/syno/etc/rc.d/S99itunes.sh restartCLICK TO COPY 🐋
MySQL
/usr/syno/etc/rc.d/S21mysql.sh restartCLICK TO COPY 🐋
NFS
/usr/syno/etc/rc.d/S83nfsd.sh restartCLICK TO COPY 🐋
Postgresql
/usr/syno/etc/rc.d/S20pgsql.sh restartCLICK TO COPY 🐋
Samba
/usr/syno/etc/rc.d/S80samba.sh restartCLICK TO COPY 🐋
SSH
/usr/syno/bin/synosystemctl restart sshd.serviceCLICK TO COPY 🐋
SSH
/usr/syno/bin/synosystemctl stop sshd.serviceCLICK TO COPY 🐋
SSH
/usr/syno/bin/synosystemctl disable sshd.serviceCLICK TO COPY 🐋
SSH
/usr/syno/bin/synosystemctl enable sshd.serviceCLICK TO COPY 🐋
SSH
/usr/syno/bin/synosystemctl start sshd.serviceCLICK TO COPY 🐋
System Information on DSM 7
Check system memory info
cat /proc/meminfoCLICK TO COPY 🐋
Check CPU Info
cat /proc/cpuinfoCLICK TO COPY 🐋
Check Interrupts in use
cat /proc/interruptsCLICK TO COPY 🐋
Check the current File Systems in use
cat /proc/filesystemsCLICK TO COPY 🐋
Comprehensive information on the file system format
tune2fs -l /dev/hda3CLICK TO COPY 🐋
Check the Linux Version of your DSM
cat /proc/versionCLICK TO COPY 🐋
Check RAID Devices
cat /proc/mdstatCLICK TO COPY 🐋
Check Environment Variables
envCLICK TO COPY 🐋
Check what physical and logical disks/partitions you have in a multi-bay NAS
cat /proc/diskstatsCLICK TO COPY 🐋
or for all NAS types
cat /proc/partitionsCLICK TO COPY 🐋
or for similar, but different info
fdisk -lCLICK TO COPY 🐋
Miscellaneous for DSM 7
Clear terminal screen
clearCLICK TO COPY 🐋
Note: The command line above also works perfectly with DSM 6.2.4