ls command will surely be one of the most used command while working with Linux command line. Think of a situation when your ls binary get corrupted. Is there any alternative of “ls” command. The Answer is “YES”
echo does ls
echo command is mostly used to display a line of text . echo can list out a directory much like the ls command.
[root@server /]# echo *
bin boot dev etc home lib media mine mnt opt proc root sbin selinux srv sys tmp usr var
echo command doesn’t output any of the file description labels. The real ls command won’t display the file description labels either. These description labels appears due to aliases passed to ls.
Real World Uses
Sometimes system crash or drives dying can bring systems down to the point where filesystem get corrupted that they are unable to mount. In this scenario, the only way to see the system files is to use echo for displaying the files and directories.
Here are some examples where echo might be used within scripts.
A variable definition:
display=`echo *`To pass files through a loop:
for $display in `echo *`
do
source
done
If you require help, contact SupportPRO Server Admin
