how to list files in Unix without the modified date

Posting an alternate solution because the accepted one will fail on filename with spaces.

On Linux and other systems that support it (not Mac OS) use --time-style with null formatting

[root@preg junk]# ls -lah
total 12K
drwxr-xr-x 2 root root 4.0K Jan  6 16:12 .
drwxr-xr-x 4 root root 4.0K Jan  6 15:38 ..
-rw-r--r-- 1 root root    0 Jan  6 12:42 '$#%bad'
-rw-r--r-- 1 root root    2 Jan  6 16:12 'moar bad;'
-rw-r--r-- 1 root root    0 Jan  6 12:40 'quote"file'
-rw-r--r-- 1 root root    0 Jan  6 12:41 'single'\''quote'\''file'

[root@preg junk]# ls -lah  --time-style='+'  .
total 12K
drwxr-xr-x 2 root root 4.0K  .
drwxr-xr-x 4 root root 4.0K  ..
-rw-r--r-- 1 root root    0  '$#%bad'
-rw-r--r-- 1 root root    2  'moar bad;'
-rw-r--r-- 1 root root    0  'quote"file'
-rw-r--r-- 1 root root    0  'single'\''quote'\''file'
[root@preg junk]# 

I think the best solution to your problem is to use awk.

ls -la | awk '{print $1, $2, $3, $4, $5, $9}'

So you obtain an output like this:

drwxr-xr-x. 6 root root 4096 .
dr-xr-xr-x. 22 root root 4096 ..
drwx------+ 5 user staff 170 Desktop
drwx------+ 16 user staff 544 Documents
drwx------+ 6 user staff 204 Downloads

Tags:

Unix

Ls