Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I do a ls -al the timestamp display is Month date time - would like it to be yy/mm/dd or just know WHERE to modify this?

I also cannot edit dconf-editor. - that shows %l:%M %p when I try to change it it just reverts back. I used sudo to launch.

Desktop shows time only

Nautilus shows weekday day month year time.

share|improve this question

1 Answer 1

In the end of your ~/.bashrc, paste the code below:

RAW_CUR_LS_ALIAS=`alias ls || echo "ls"`
CUR_LS_ALIAS=`echo "$RAW_CUR_LS_ALIAS" | sed "s/^alias ls='\|'$//g"`
alias ls="$CUR_LS_ALIAS --time-style='+%y/%m/%d %T'"

After pasting this command, save and close the file.

And run

source ~/.bashrc

Now try:

ls -al

You'll need source only this time, when you restart all of your gnome-terminal windows, it will always load the alias automatically.


If you want to customize it by yourself just take a look at the man of date and look for FORMAT options.

share|improve this answer
    
Be careful about overriding the existing ls alias defined in the default .bashrc. If you just append this new declaration you'll lose the prior's text coloring. –  ændrük May 2 '13 at 1:00
    
Updated the answer to keep settings found in previous defined alias for ls –  Onilton Maciel May 2 '13 at 2:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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