Slackware :: Use The Ls Command To List Files In One Column?
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
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
Nov 2, 2010
I have run a command which finds a lot of files based on some search criteria. It returns the files like so:
./somepath/somepath/file.something
./asdf/asdf/s.php
./etc/a.php
./a/b/c/d/e/f/g.jpg
So I was wondering, if I capture this output into a file (ie. one file per line), can anyone help me write a command which iterates through the file and moves the files one by one to a specified directory?
View 3 Replies
View Related
Feb 18, 2010
Suppose I have the following files:
1132_1_fr.mp3
1132_2_fr.mp3
1132_3_fr.mp3
.
.
.
1132_3_fr.mp3
[Code].....
So I want to add PD_ to those who dont have this preindex and get rid of _fr.
basically rename files in a same directory!!
View 6 Replies
View Related
Aug 25, 2009
need a command or script to list all files recursive without directories one line per file, no extra lines like ls -AR1 should print file size and name eg.:
12 file.ext
25684 file2.ext
589 file3.ext
...
View 7 Replies
View Related
Sep 2, 2010
I have been using comm to compare two simple column lists, and suppress items that were contained in the second list (suppression list). This was extremely simple and basic, however now list1 has two columns, and I must compare the second column in list1 with my suppression list.
Basically I need to compare my user list and suppression list to suppress any users that exist in the suppression list, then remove the second column (md5).I wasn't sure the fastest way to make comparisons if there was a similar command like comm, or if I needed to create an array of users and see if any of them matched the suppression list one by one. This seemed like it would be pretty process intensive. Anyone have any less cumbersome ideas?
View 6 Replies
View Related
Feb 12, 2011
I seemed to configure my gammu and changed the version indicated version on my gammu table from 10 to 11 to match the version of my sql, upon starting my gammu-smsd the error:
gammu-smsd[3429]: Error code: 1054, Error: Unknown column 'Signal' in 'field list'
gammu-smsd[3429]: Error code: 1054, Error: Unknown column 'Signal' in 'field list'
gammu-smsd[3429]: Error code: 1054, Error: Unknown column 'Signal' in 'field list'
Kept on repeating on an infinite loop
View 3 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
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
May 14, 2009
I need a sed command to print a list of files in "/home" directory, ending in ".sh"
View 4 Replies
View Related
Jan 28, 2010
one command to list the list of folders/ within the folder.
View 4 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
Jul 7, 2011
I have two files: one is like
preface
Introduction
chapter 1
the other is like
1
2
3
I was wondering how to column-wise combine the two files into one:
preface 1
Introduction 2
chapter 1 3
by using some utilities, such as awk, sed, available in Ubuntu?
View 1 Replies
View Related
Feb 10, 2009
I am trying to get this script to work. The purpose is to download a list of modules from the slax.org the list consist of a list of module numbers. What I am trying to do is Download the file or the file name corresponding to the number in the list.the list is comma delimited. this is what I have done so far and I am a stand still.
#!/bin/sh
# Wget script to retrieve modules from slax.org modules
#
# ----Begin of user defined values -----
# Path to wget
[code].....
View 7 Replies
View Related
Jan 19, 2011
I'm elated when I see software download pages that include a binary Slackware package.wrt KVIrc, their Slackware package is at the top of their list of binaries.They've got an rpm too, but it's SuSE, not Redhat - I found that to be pretty kewl too.I wonder if they're Slackers... hm...Well, that having been said, there's also a SlackBuild for it at the repository.I'm going to give this client a spin and see how I like it.Here's the URL: http://www.kvirc.net/?id=releases&pl...=4.0.2&lang=enUPDATE: The mirrors I checked are reporting 404 errors... bummer.
View 3 Replies
View Related
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
View Related
Oct 5, 2010
I know I can do find . -type f, but that includes binary file and I couldn't find a way to exclude them with find
View 4 Replies
View Related
Feb 28, 2011
First time I've done this in awhile Upgrading my Slackware64 -current VM, following the standard routine that has always worked in the past -
Code:
slackpkg clean-system
slackpkg install-new
The clean-system removed 2 packages -
util-linux-ng
eggdbus
Installpkg will no longer work, complaining that the rev command is not found. The problem hit with the removal of util-linux-ng. I cp'd util-linux to ~/. Extracted with tar and executed the doinstall. Fixed.
View 4 Replies
View Related
Sep 23, 2010
When i try installing anything i get errors, for example when i try to install somthing from ubuntu software center i get this.
Code: installArchives() failed: Preconfiguring packages ... Preconfiguring packages ... Selecting previously deselected package ttf-symbol-replacement. (Reading database ... dpkg: warning: files list file for package `libsdl-image1.2' missing, assuming package has no files currently installed.
[Code]....
View 4 Replies
View Related
May 10, 2011
I'm trying to figure out how to add enlightenment to my window manager list in kdm.
View 2 Replies
View Related
Apr 2, 2011
pkgtool just lists it in alphabetical order.
View 14 Replies
View Related
Aug 20, 2010
Where can i obtain a full command list?
View 8 Replies
View Related
Mar 23, 2010
I need a command to list the total sizes for all the directories in a mounted drive.I tried df and du.df list the total size for the mounted drivedu depending on what option I give it either list the total size or list all the sizes for every file on the drive.All I want to know is the sizes of all the directories on the mounted drive.This is a windows vista hard-drive and for some reason ubuntu is reporting a 50 GB partition and only 10GB free, I want to know what's taking up all the free space. I can't find anything in the file browser, so far I've only managed to count up about 10GB of used space so where is the other 30GB.
View 3 Replies
View Related
Apr 2, 2011
i know that there is already a command for it but it comes out with a lot of letters that makes it hard to find the services that are runningi'm talking about services like DNS, APACHE, DHCP, SAMBA, SSH etcis there a command that will list these services and related services that are running instead of showing a bunch of jumbled and lettered mess thats hard to comprehend
View 6 Replies
View Related
May 21, 2010
I've got a new server and have vsftpd setup there , when i login using filezilla :
Response:230 Login successful.
Command:OPTS UTF8 ON
Response:200 Always in UTF8 mode.
Status:Connected
[Code]....
View 7 Replies
View Related
Feb 15, 2010
How can I know how many shells my system support (Is there any specific command)?
View 9 Replies
View Related
Aug 4, 2010
I am very new to Linux and Unix. Is there a command list which indicates the UNIX command equivalents also?
View 5 Replies
View Related