To check the size in megabytes I have always to do --block-size=Mb. Can I set in bashrc so that when I do ls it should alway publish size in Mb?


Alias it:

alias ls="ls --block-size=Mb"

But do you really want to always see file sizes in MB?


Add the following line to your .bashrc file

alias ls="ls --block-size=Mb"

Then logout and log back in. ls should now have the desired flags

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.