Software :: Column Alignment In "ls -l" Command?
Mar 13, 2011
Is there a way to get the "ls -l" command to align its columns (e.g. force a fixed size) when the command is executed individually for each file to be listed (e.g. in a script loop or such)? Right now, I get ragged/jagged columns because "ls -l" is trying to make each listing compact horizontally. But as file sizes, and lengths of owner names, and such vary, the overall length of each output instance varies, making the columns ragged.
View 5 Replies
ADVERTISEMENT
Mar 7, 2010
i use this script to get the time and date of back and fourth transactions for a particular execution id. I use a substr command on the 5th column to to cut the milli seconds off the time value. - otherwise the times would look like 08:30:04.235
grep <executionID> <auditfile> | awk '{ print $1, $2, $3, $4, substr($5,1,8}
FIX -> Mon 3/1/2010 08:30:04
FIX <- Mon 3/1/2010 08:32:36
FIX <- Mon 3/1/2010 08:35:08
[code].....
anyhow - i append two sed commands to further clarify the direction of the message.
awk '{ print $1, $2, $3, $4, substr($5,1,8} | sed -e 's/->/ ->IN/g' | sed -e 's/<-/<-OUT/g'
FIX -> IN Mon 3/1/2010 08:30:04
FIX <- OUT Mon 3/1/2010 08:32:36
[code]....
I tried using an awk gsub () command within the string instead of the two seds, but it did not work:
awk '{ print gsub(/<regex>/, <replace with>,$1), $2, $3, $4, substr($5,1,8}
the sed works ok, but it would be cooler to make the replacement within the awk command:
gsub(/->/,-> IN, $1)
Is there a way where i could replace the value of the $1 column in the awk print string?
View 1 Replies
View Related
Oct 20, 2010
1. when we run od command it displays octal values. But the first column will be always 000000. after that the actual file contents are displayed. Can anyone tell the meaning of that.
2. When we run ls -l command, in the first line of the output, we can see some integer value. What is the significance of that value.
View 4 Replies
View Related
Sep 20, 2010
I am doing a spreadsheet for work (for importing data into a new database) and I have hundreds of image files which need to have just their file names in one column called Product Code. Is it possible to use the ls command to list the contents of a directory in one single column so that I can copy and paste to the spread sheet?
Also, is there a single command to remove the file extentions for a batch of files? Bulk rename is what I need, I guess but just to remove the file extension (.jpg on all of them). The normal use of ls lists them in multiple column form and when I copy and paste those it will not let me copy just one cloumn at a time. The spreadsheet only has three columns:
New Product Code Old Product Code Pictures New Product Code will be left black, and the Old Product Code is just the image names. The picture column will be the patch-to-the-image for each image. I am not sure that is even possible in a spreadsheet.
View 14 Replies
View Related
Mar 3, 2009
I like running sql queries from the command line.
Code:
sqlite3 foo.db "select * from some table"
How can I specify
Code:
.mode column
at the command line?
View 1 Replies
View Related
Feb 4, 2010
What is the macro command (in OpenOffice Basic) to select an entire Row or Column? I tried to "Record Macro", then click on the Row/Column header, which would then select the entire row/column. But "Record Macro" failed to capture this action.
View 1 Replies
View Related
Jul 19, 2010
How would i calculate following values.Initial file
10 3
20 4
How would i calculate 3rd column which should be addition of value in 1 and 2nd column.File after calculation
10 3 13
20 4 24
View 14 Replies
View Related
Jul 15, 2010
I have a multicolumn datas, like
a1 b1 ... f1
a2 b2 ... f2
. . ... .
[code]...
I would like to make a file with all these data in one column, like
a1
a2
.
.
[code]....
Can it be done with awk or some other command? Also, is it possible then do add another column in front of this one with numbers of the lines (for every previous column), like
1 a1
2 a2
. .
. .
[code].....
View 14 Replies
View Related
May 13, 2011
Have this script which is reading in a series of files, one at a time with while-do-done loop, each file goes through various greps/awk's where this info is then saved to various files for later use. i.e....
Script is being run on Linux Red Hat,
In one of the grep/awk's the output (currently) are 2 columns (min max), i.e....| awk '{print $1, $2}' | sort -u which outputs (e.g.)
The number of "min max" pairs varies from file to file. Want to output a single column of unique numbers from the min max pairs & get the number of them for input to a file...i.e...
Where <PROCESS> is some process/technique that will generate a single column of integers (increment of 1) to pipe into the next one (sort -u)
i.e. (example from above)
Have tried command seq - only works for single pair input i.e.
Is there any command like seq etc which will output a single column based on a input of min max numbers (increment 1) to pipe onwards to next command?
View 4 Replies
View Related
May 19, 2011
I just ghosted a hard drive containing Win7 and OS11.4 to a new WD hard drive with 4K byte alignment. WD provides a tool to align Win7 (and it apparently needed it) but reports other partition types (Ext3/4) as corrupt. Here's the question: is there a way to get 4K byte alignment in Ext3/4 after installation, or do I need to reinstall? Is there an authoritative page on this for OpenSuSE/Kubuntu?
View 9 Replies
View Related
Sep 25, 2010
I'm using Xubuntu 8.10, and Xfce 4, which a very clever friend installed for me.
Problem is, my screen display keeps shwoing windows, task bars and icons aligned so far to the left, they go off the screen.
I'm trying to find the display settings for the monitor, so I can nudge it to the right. Can't find where to click.
View 1 Replies
View Related
Dec 25, 2010
OS: Ubuntu 10.10 I've been trying to get my HP DeskJet D2660 printer to work for a while now, but I am having several problems that I can't seem to get around. For the driver I have 2 options. The hpijs (hplip) or the hpcups driver. Neither of them work properly.
The HPLIP driver and control software keeps telling me that the stuff I print has printed correctly, but my printer does nothing. It just sits there laughing at me whilst I get popups on my monitor telling me that the print job start and completes. I have successfully printed the print head calibration paper and aligned them as told by the HP software, but after I have done so, it just goes back to sleep. Nothing prints, not even the test page. I can't understand why it prints the calibration sheet just fine and then, afterwards, it won't print anything else but tells me everything prints fine.
The HPCUPS driver works just fine, but it has these really bad shadows on everything I print caused by incorrect alignment of the print heads. There seems to be no option of correcting this using the HPCUPS driver. So, what I have is a HPLIP driver which allows me to calibrate but won't print, and a HPCUPS driver which prints just fine, but won't allow me to calibrate. My HPLIP driver version: 3.10.6 (official from Ubuntu) I've also tried downloading and installing the latest (3.10.9), but with no luck. Prints calibration just fine, then nothing else.
View 1 Replies
View Related
May 27, 2011
I thought that alignment of 4096-byte sector Advanced Format hard drives was automatically taken care of via Gparted or Disk Utility until I bought a Hitachi HTS547575A9E384 (Travelstar 5K750) and saw that Disk Utility showed my partitions to be out of alignment. I then realized that my WD, which I had bought a few months ago, probably had its jumper set to emulate a 512-byte sector legacy drive (512e) and is probably not set to the AF setting.
Straight to the problem.
I've searched many sites, some of which suggest using fdisk (others the proprietary software of the hard drive's manufacturer). It is essential that one change the arguments prior to changing the partition table as there is no way back (yet, as far as I know) without having to move data to another drive and starting all over:
[Code]...
View 9 Replies
View Related
May 29, 2011
I've been searching around for a way to do this, but none of the solutions I find seem applicable to Lucid. Is there, like, a Terminal command to change the alignment of desktop icons?
View 3 Replies
View Related
Jan 20, 2011
I would like to fix partition alignment on my SSD disk, and I am curious if it is possible to do it without handling data from disk and back. Is it possible with Gparted?Quote:
$ sudo fdisk -l /dev/sda
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
[code]....
View 2 Replies
View Related
Oct 17, 2010
I want to change the alignment of GtkTreeView widget(Right-to-Left algin) i.e add columns to the rifgt of GtkTreeView and change the title of the column and its content to the rifgt of the column but I do not know how to do it
View 1 Replies
View Related
Feb 16, 2011
I use various hard disks in my computer. When I install a 13.1 disk, the six text consoles <Ctrl-F1> through <Ctrl-F6> are shifted to the left such that the first 2 characters in the line are off my flat panel screen. I use several different disks on this machine and all other disks are properly aligned. change the vga line in /etc/lilo.conf to vga = normal rather than vga = 773. This didn't fix the problem and resulted in another problem. If I adjust my flat panel horizontal adjustment, when I start XWindows, those screens are too far to the right. Is there a way to adjust the horizontal offset only for the consoles?
View 1 Replies
View Related
Feb 15, 2015
I have two SSDs on which I have configured md RAID 0, with a 16 KB chunk size. My understanding is that Wheezy (and later) installations are smart enough to align partitions on block boundaries, even in md RAID configurations, but to satisfy my own natural distrust, how do I go about actually confirming that it has done the right thing? I have a single root logical volume within an LVM partition, but neither the logical volume nor the LVM partition occupy all available space, and the LVM partition is offset from the end of the disk.
My concern arises from the fact that, when I look at the sysfs entry for my root partition:
# cat /sys/devices/virtual/block/md126/md126p4/start
804818048
This number is not evenly divisible by 4096.
View 2 Replies
View Related
Jan 2, 2010
I'm trying to do a partition alignment on my main SSD to improve SSD performance and then install Ubuntu on the SSD. I can do the alignment with no problem but when I install ubuntu the alignment is erased. Is there a way to install ubuntu without getting rid of the alignment?
View 2 Replies
View Related
Jul 26, 2010
Rather than having my text aligned to the left side of the window, I was wondering if there's a way to align it to the center?
View 8 Replies
View Related
Aug 21, 2010
I'm trying to work out with Conky on my Ubuntu 10.04 x64.
Conky is set to Top Left alignment, but it doesn't seem to be ending up there at all. After changing all of the different alignments, it doesn't seem to move around much at all.
(Desktop Screenshot Attached)
My other issue, which may have something to do with the way my Conky is set up, is that I have a couple of icons on the desktop, but they only show up when I put my mouse over them, and in the next couple of seconds they go away. It seems to be related to the refresh frequency of conky, which seems to be all of my issues right now.
Another note, this conky code is essentially pulled directly from the conky website.
(Code Below)
Code:
View 2 Replies
View Related
Oct 4, 2010
When I installed 10.04 in April, I started having all sorts of problems with my Virtual Terminals (CTRL-ALT-F*). First they were inaccessible completely, then they were there, but not visible, i.e. I could use them to login and run commands, but there was no screen output, then they were gone again, and the fight just went on and on. I just recently got this functionality back after months just messing around, testing different peoples solutions, and really just not being afraid to break the whole thing. Ultimately, it boiled down to nVidea graphics driver problems.
However, now I notice that outside of gdm, the screen is not aligned properly. It seems to be about 2 characters to the left and several lines lower than it should be on VT1-VT6, while gnome is aligned perfectly. I can use my screens auto-adjust to fix the problem, but when I switch to another terminal, the problem comes back. It's not really a huge deal, but after all this trouble, I really just want them to work the way they are supposed to work. Does anyone know of a way to set the screen alignment via software, or am I just stuck dealing with it?
View 1 Replies
View Related
Oct 12, 2010
I use 2 monitors and Conky defaults to the top right of my right-hand monitor.I'd like to move it to the top right of the left-hand monitor.
'alignment top_left' moves it to the left-hand monitor, but obviously the left-hand side. I need it on the right.
View 3 Replies
View Related
Jan 25, 2010
How can I disable structure alignment feature of gcc using command-line options ?I recently migrated to 64-bit OS, and doubt that I might be experiencing a structure alignment problem due to the new 64-bit architecture.I checked the sizes of the same C-style struct in both x86 and x86_64, and found out that they appear to be different by 20 bytes.I am not sure if this is due to structure alignment or the differences in data type lengths between two platforms.Hence, I will first disable the structure alignment feature, and then check the struct sizes again.
View 3 Replies
View Related
Dec 8, 2010
i am new to scriptingi have a file : file.dat with following data
Code: STORAGE PERCENTAGE FLAG:
/storage_01 64% 0
/storage_02 17% 1
[code]...
View 4 Replies
View Related
Jan 18, 2011
I have a two column file and I need to create a new column in between the first and second but the new column adds a value to the first. E.g.code...
I thought I had figured out how to do it with the following but it just hangs:
awk -F '{print $0,$0+25,$1}' file_in > file_out
Also tried the following to no avail:
awk -F,-v OFS,'{print $0,$0+25,$1}' file_in > file_out
I can add the new column with the added value to the last column easy ( awk '{print $0,$0+25}' file_in > file_out).
View 8 Replies
View Related
Jan 13, 2010
Here is the txt file
Code:
I want to use a script to statistic the results like that
I want to know the the same string in the first column and how many different in the second column ?
how awk to write ?
View 7 Replies
View Related
Apr 9, 2010
Problem is simple but I can't figure out how to solve it, I tried any possible way that I know but with no result.I'm using simple perl script with DBI and do select from one table and do update in other table with results from select, but I can't preserve my '' returned from select when doing update. I simply want my '' from first table to be '' in second but postgres makes them real new lines. I tried to escape '' with , '',"",E(I mean E'value here') in front of value that updating but they are always real new lines not '' in new table.
View 2 Replies
View Related
Feb 23, 2011
I have not defined a user vimrc, OS is redhat 4.6 and after a search and replace the first column in the editor is highlighted yellow and it stays that way as I close and open vim. This is the /etc/vimrc that came on the system. anyone see a bug or a reason it would do that?
if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
set fileencodings=utf-8,latin1
endif
set nocompatible " Use Vim defaults (much better!)
[Code]....
View 2 Replies
View Related
Apr 26, 2010
I have some series of files, which actually named bellow
<day_month_yr>_<hh:mm:ss>.<host_name>.<IP.ip.ip.ip>.<log_name>.txt
I want to show this file name below the column may be
Date Time Host_Name IP_address Login_Name
----- ---- --------- ---------- ----------
<day_month_yr> <hh:mm:ss> host_name x.x.x.x log_name
...
View 5 Replies
View Related