Monday, February 28, 2011

Spl Unix commands

basename
The basename command will strip off the directory portion of a filename path and return only the filename itself. In the following example, basename is used to strip the directory path from the filename so it returns simply file.txt.
 
$ basename /this/is/a/file.txt
file.txt
$ ls
Makefile  menu_buttons_test.zip  readme.txt  test  test.c  test.tmp  test_BK
$ basename test.c .c
test
$ basename test.tmp .tmp
test
Note that based on the second argument command will filter out the filename ---- To switch to the root user permanently, $ sudo -s $ ./install.sh -u /* to uninstall the package */

1 comment:

  1. To install package through bin file.

    1. chmod +x *.bin
    2. ./package*.bin

    ReplyDelete