Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm sorry to say that but I was not able to find how to set a default format for `ls -l` to have the same format a) on my local machine, at bash prompt; b) on my remote machine after logging in via ssh; c) at remote command execution via ssh. So
if I make an `ls -l` locally (a), the result is:
-rw------- 1 kea users 0 2009-11-30 13:38 somefile
if I log in remotely (b) the result is the same (TIMEFORMAT is set in /etc/profile in both machines)
but after an `ssh remotecomputer "ls -l somefile" the result is:
-rw-r--r-- 1 kea users 0 Nov 30 13:38 somefile
If I tell the required time-style to ls explicitly it works...:
`ssh remotecomputer "ls -l --time-style=+'%a %b %d %T %Y' somefile"`
...but I would like to have a default date format for this case, too.
The question is how to set up the same default date format for remote command execution?
there are some (c)sh files in /etc/profile.d/, none of them contains a 'time-style' nor a 'format' string, and none of them has a file name which would be around ls or ssh (ati-fglrx.sh ... tetex.sh). In addition I'm not sure that in case of remote command execution ssh executes a .bashrc or any similar one.
$LANG is the same in both computers. TIMEFORMAT is the same (grepped from `env`) in bot machines. Timeformat is set in /etc/profile (I inserted the needed format string there). I suppose (but not tested exactly) that in case of remote command execution ssh does not run any of the common rc files (.bashrc & co.). But there must be the setting of the default date format of ls somewhere, but I cannot find it. At least by grepping recursively in /etc
I spoke about remote command execution not about remote login. In the latter case a normal login shell is used while in the first case NOT. So I think that the default behaviour of the command `ls` ought to be configured somehow because the lack of environment variables (in the first case).
I have slamd64-12.2(=64 bit slackware) and slackware-12.0(i486) on 2 separate boxes here. When I log log in or ssh in, I get this format
Code:
lrwxrwxrwx 1 dec users 5 2009-01-22 19:03 winedir -> .wine
-rwxr-xr-x 1 dec users 52572 2008-05-17 11:27 winetricks
dr-xr-xr-x 2 dec users 4096 2006-05-14 19:17 words-1.97
drwxr-xr-x 2 dec users 4096 2008-07-09 16:41 xantia
-rw-r--r-- 1 dec users 1970 2009-09-25 19:14 xorg.start
So wherever you deviate from that is the unusual setting. Can we take it there? Because you can solve this without digging by inserting one alias in bash_profile
alias ll="ls -l <desired date format> and use ll instead of ls
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.