I wanted to get a only file names from the output of command find . -maxdepth 1 -type d
This returns a strings contains "./" at the begining.
./1-case
./2-case
./3-case
./4-case
./5-case
./6-case
to remove first two characters i used command cut. as follows
echo "./1-case" | cut -c3-
-c means return characters
3- means from 3rd character to end
other examples
-c3 will return only 3rd character
-c3-4 will return characters form 3rd to 4th
No comments:
Post a Comment