ls -l (without showing total blocks)


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers ls -l (without showing total blocks)
# 1  
Old 12-07-2009
ls -l (without showing total blocks)

Is it possible to use the ls command and NOT see the total blocks? For example, instead of seeing this...

Code:
$ ls -l
total 16
drwxr-xr-x 2 voicem voicem 4096 Dec  3 09:19 directory1
drwxr-xr-x 2 voicem voicem 4096 Dec  1 01:29 directory2
drwxr-xr-x 2 voicem voicem 4096 Dec  2 00:47 directory3
drwxr-xr-x 2 voicem voicem 4096 Nov 30 00:10 directory4

I'd like to see this...

Code:
$ ls -l
drwxr-xr-x 2 voicem voicem 4096 Dec  3 09:19 directory1
drwxr-xr-x 2 voicem voicem 4096 Dec  1 01:29 directory2
drwxr-xr-x 2 voicem voicem 4096 Dec  2 00:47 directory3
drwxr-xr-x 2 voicem voicem 4096 Nov 30 00:10 directory4

Notice that the desired output does not list total 16. Is this doabale?
# 2  
Old 12-07-2009
ls -l | sed /^total/d
# 3  
Old 12-07-2009
or even
Code:
ls -l|sed '/^t/d'

in this case Smilie
-or-
Code:
ls -l|grep -v ^t

-or
Code:
ls -l|grep ^[^t]

-or-
Code:
ls -l|awk 'NF>2'

-or-
Code:
ls -l|awk 'NR>1'

-or
Code:
ls -l|awk 'NF-2'

-or
Code:
ls -l|awk 'NR-1'

-or
Code:
ls -l|awk p++

-or-
Code:
ls -l|sed 1d


Last edited by Scrutinizer; 12-07-2009 at 06:23 PM..
# 4  
Old 02-23-2010
MySQL

see the following example:
it also prints from second line from last line.
Code:
ls -l | sed  -n '2,$p'

# 5  
Old 02-23-2010
How about this ?

Code:
ls -l | tail -n +2

# 6  
Old 02-23-2010
ls -l output

Try this also,

ls -l | sed -n '1!P'
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Blocks into table

please help, I have a huge file with blocks of data which I need to convert to a tabular format. Input sample id: GO:0000017 name: alpha-glucoside transport namespace: biological_process def: "The directed movement of alpha-glucosides into, out of or within a cell, or between... (3 Replies)
Discussion started by: ritakadm
3 Replies

2. Shell Programming and Scripting

Row blocks to column blocks

Hello, Searched for a while and found some "line-to-column" script. My case is similar but with multiple fields each row: S02 Length Per S02 7043 3.864 S02 54477 29.89 S02 104841 57.52 S03 Length Per S03 1150 0.835 S03 1321 0.96 S03 ... (9 Replies)
Discussion started by: yifangt
9 Replies

3. Shell Programming and Scripting

how to split this file into blocks and then send these blocks as input to the tool called Yices?

Hello, I have a file like this: FILE.TXT: (define argc :: int) (assert ( > argc 1)) (assert ( = argc 1)) <check> # (define c :: float) (assert ( > c 0)) (assert ( = c 0)) <check> # now, i want to separate each block('#' is the delimeter), make them separate files, and then send them as... (5 Replies)
Discussion started by: paramad
5 Replies

4. UNIX for Dummies Questions & Answers

Convert 512-blocks to 4k blocks

I'm Unix. I'm looking at "df" on Unix now and below is an example. It's lists the filesystems out in 512-blocks, I need this in 4k blocks. Is there a way to do this in Unix or do I manually convert and how? So for container 1 there is 7,340,032 in size in 512-blocks. What would the 4k block be... (2 Replies)
Discussion started by: rockycj
2 Replies

5. Shell Programming and Scripting

Removing blocks from a file

I have a file like the one below. Each record is separated with > In between I have lines consisting of 3 numeric values separated by a space. I need to take each block between the > sign and read the first number in the line. Then take the first after the > sign and the last before the >... (7 Replies)
Discussion started by: kristinu
7 Replies

6. Shell Programming and Scripting

Calculate total space, total used space and total free space in filesystem names matching keyword

Good afternoon! Im new at scripting and Im trying to write a script to calculate total space, total used space and total free space in filesystem names matching a keyword (in this one we will use keyword virginia). Please dont be mean or harsh, like I said Im new and trying my best. Scripting... (4 Replies)
Discussion started by: bigben1220
4 Replies

7. Shell Programming and Scripting

Sorting blocks of data

Hello all, Below is what I am trying to accomplish: I have a file that looks like this /* ----------------- xxxx.y_abcd_00000050 ----------------- */ jdghjghkla sadgsdags asdgsdgasd asdgsagasdg /* ----------------- xxxx.y_abcd_00000055 ----------------- */ sdgsdg sdgxcvzxcbv... (8 Replies)
Discussion started by: alfredo123
8 Replies

8. UNIX for Dummies Questions & Answers

grep running total/ final total across multiple files

Ok, another fun hiccup in my UNIX learning curve. I am trying to count the number of occurrences of an IP address across multiple files named example.hits. I can extract the number of occurrences from the files individually but when you use grep -c with multiple files you get the output similar to... (5 Replies)
Discussion started by: MrAd
5 Replies
Login or Register to Ask a Question