Kaliko Systems Limited

Make a Low-Power Media Server

Appendix: Linux Commands

Although you should not need to use the Unslung command line at all after setting up the NSLU2. The following basic information is provided to help in problem fixing.

On the NSLU2 type "help" for the list of built-in shell commands and type "busybox" for a list of all the other commands. Most busybox commands can take a "--help" option to provide limited help, e.g. try typing: ls --help

The up and down arrow keys let you select previous command lines and the right and left arrows allow you to edit them. The command and filename completion using the tab key particularly makes typing long filenames easier. When pressing the tab key, if you get a bell sound, then you can press the tab key again to show the optional completions. For reference the shell that you are typing into is "ash" (not sh nor bash).

Some particularly useful Linux commands are:
Command, description and XP cmd (DOS style) equivalents

cat file : list a file - DOS type.
cd directory : change working directory to given directory - DOS cd.
chmod [owner][group][other] file-or-directory : where owner, group and other is a
digit made from adding together: 1 for execute/explore, 2 for write and 4 for read. So chmod 644 allows everyone to read the file but only the owner to modify it. DOS attrib.
cp file1 file2 : copy file1 to file2 - DOS copy.
cp file1-or-directory1 directory2 : copy file 1 or directory 1 into directory2 - DOS copy.
df -h : show used and available space on disk partitions.
killall process-name : stops all processes associated with the name - DOS taskkill.
ls : list current directory (folder) - DOS dir/w.
ls -a : list current directory (folder) including files that start with "." - DOS dir/w/a.
ls -l file : show a files details, particularly ownership and permissions - DOS dir.
mkdir directory : make a directory - DOS mkdir (md).
mount : show how disk partitions are mounted onto the file system tree.
pidof process-name: shows process ids for a running process - DOS tasklist.
rm file : remove a file - DOS del.
rm -R directory : remove directory and all sub-files and sub-directories - DOS del.
touch file : update a file's access time, or if file does not exist create an empty file.