System information
An Introduction to Shells in General
Axis Communications AB provides NO support for application development of any kind. The information
here is provided "as is", and there is no guarantee that any of the examples shown will work in your
particular application.
Revision 1.02 October 2002 44
5.3.1 basename
Syntax: basename FILE [SUFFIX]
Strips directory path and suffixes from FILE. If specified, also removes any trailing SUFFIX.
Example:
$ basename /usr/local/bin/foo
foo
$ basename /usr/local/bin/
bin
$ basename /foo/bar.txt .txt
bar
5.3.2 cat
Syntax: cat [FILE]...
Concatenates FILE(s) and prints them to stdout.
Example:
$ cat /proc/uptime
110716.72 17.67
5.3.3 chroot
Syntax: chroot NEWROOT [COMMAND...]
Run COMMAND with root directory set to NEWROOT.
Example:
$ ls -l /bin/ls
lrwxrwxrwx 1 root root 12 Apr 13 00:46
/bin/ls -> /BusyBox
$ mount /dev/hdc1 /mnt -t minix
$ chroot /mnt
$ ls -l /bin/ls
-rwxr-xr-x 1 root root 40816 Feb 5 07:45
/bin/ls*
5.3.4 cp
Syntax: cp [OPTION]... SOURCE DEST
Copies SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.
-a Same as -dpR
-d Preserves links
-p Preserves file attributes if possible
-f force (implied; ignored) - always set
-R Copies directories recursively