Sponsored Content
Top Forums Shell Programming and Scripting How to get list of files only using ls without combining it with other command? Post 302861135 by bakunin on Tuesday 8th of October 2013 07:55:06 AM
Old 10-08-2013
Quote:
Originally Posted by Nikhath
But , this command is also picking up the sub directory names inside in aSrcDIR.
This is what I want to avoid. I want only files to be picked up and not the directory names.
I said it already above, but i will say it again: have a look at the "-F"-option of ls. Filenames will remain unchanged while directories will be added a "/" at their names:

Code:
# ls -1
testdir
testfile

# ls -1F
testdir/
testfile

This should be something you can easily grep for, no?

I hope this helps.

bakunin
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

combining files

how will i combine these 2 files below, with the desired output specified below: file1: one two three four file2: red blue yellow green file3: aaa bbb ccc ddd (3 Replies)
Discussion started by: apalex
3 Replies

2. UNIX for Dummies Questions & Answers

Combining files

Hi, is there a way to combine 2 files together, joining line 1 from file A with line 1 from file B, line 2 from A with line 2 from B etc. File A File B 1 4 2 5 3 6 Combined result = File C 14 25 36 (2 Replies)
Discussion started by: Enda Martin
2 Replies

3. Shell Programming and Scripting

Combining Two Files

Could someone help me reduce the number of runs for a shell program I created? I have two text files below: $ more list1.txt 01 AAA 02 BBB 03 CCC 04 DDD $ more list2.txt 01 EEE 02 FFF 03 GGG I want to combine the lines with the same number to get the below: 01 AAA 01 EEE 02... (4 Replies)
Discussion started by: stevefox
4 Replies

4. Shell Programming and Scripting

Combining two files

I have two files and I need to combine (not append - but combine a row to a row) eg: File1: apples grapes oranges lemons File2: red green orange yellow After combining, the file should look like: (the second column should start at a specific byte) apples red grapes green... (7 Replies)
Discussion started by: hemangjani
7 Replies

5. Shell Programming and Scripting

combining mv and compress command

Hi All, I have a file in DirA/ABC.out a need to move to DirB.I am using the following steps now: mv DirA/ABC.out DirB compress -f DirB/ABC.out Is there a way to just do this one step as I have to move hundreds of files every hour. -Thanks in advance. (4 Replies)
Discussion started by: sam_78_nyc
4 Replies

6. UNIX for Dummies Questions & Answers

combining two files

Hi Gurus, I have 2 files: File1 Filename1 xx Filename1 yy Filename1 Total Filename2 xx Filename2 yy Filename2 zz Filename2 Total Filename3 xx Filename3 Total and File2: Filename1 10296 xxx Date: 09/01/08 Filename2 10296 xxx Date: 09/05/08... (36 Replies)
Discussion started by: rock1
36 Replies

7. UNIX for Dummies Questions & Answers

combining two list according to one id..

Hi, I have two list I wanna combine and print them together in the output depending if they have the same rsid: file1: ENST00000262042 rs47 583 N D ENST00000408005 rs48 583 N D ENST00000311322 rs268 318 N S file 2: rs34 CHB T 1 C 0 T/T C/T C/C 1 0 0 rs47 JPT T 1 C 0 T/T C/T C/C 1 0 0 rs48... (6 Replies)
Discussion started by: karla
6 Replies

8. Shell Programming and Scripting

combining 2 files into one according to the list

hi, i have a list of file: KB0002 KB215027 KB0003 KB215027 KB0004 KB215027 KB0005 KB204320 KB0006 KB207074 KB0007 KB215204 KB0008 KB223809 KB0009 KB236640 KB0010 KB244506 KB0011 KB205382 KB0012 KB212813 KB0013 KB236314 KB0014 KB230897 KB0015 KB232532 KB0016 KB231543... (2 Replies)
Discussion started by: karla
2 Replies

9. UNIX for Dummies Questions & Answers

Need Help in reading N days files from a Directory & combining the files

Hi All, Request your expertise in tackling one requirement in my project,(i dont have much expertise in Shell Scripting). The requirement is as below, 1) We store the last run date of a process in a file. When the batch run the next time, it should read this file, get the last run date from... (1 Reply)
Discussion started by: dsfreddie
1 Replies

10. Shell Programming and Scripting

Combining 2 files

i am having 2 files like this file 1 1, 2, 3, 4, file2 5, 6, 7, 8, what i want do is like this i want to put all the contents for file 2 after file 1,means adding column in file1 (5 Replies)
Discussion started by: sagar_1986
5 Replies
GNULIB-TOOL(1)						      GNU Portability Library						    GNULIB-TOOL(1)

NAME
gnulib-tool - program for authors or maintainers which want to import modules from gnulib into their packages. SYNOPSIS
gnulib-tool --list gnulib-tool --import [module1 ... moduleN] gnulib-tool --update gnulib-tool --create-testdir --dir=directory module1 ... moduleN gnulib-tool --create-megatestdir --dir=directory [module1 ... moduleN] gnulib-tool --test --dir=directory module1 ... moduleN gnulib-tool --megatest --dir=directory [module1 ... moduleN] gnulib-tool --extract-description module gnulib-tool --extract-filelist module gnulib-tool --extract-dependencies module gnulib-tool --extract-autoconf-snippet module gnulib-tool --extract-automake-snippet module gnulib-tool --extract-include-directive module gnulib-tool --extract-license module gnulib-tool --extract-maintainer module gnulib-tool --extract-tests-module module DESCRIPTION
The GNU portability library is a macro system and C declarations and definitions for commonly-used API elements and abstracted system behaviors. It can be used to improve portability and other functionality in your programs. OPTIONS
Operation modes: --list print the available module names. --import import the given modules into the current package; if no modules are specified, update the current package from the current gnulib. --update update the current package, restore files omitted from CVS. --create-testdir create a scratch package with the given modules. --create-megatestdir create a mega scratch package with the given modules one by one and all together. --test test the combination of the given modules (recommended to use CC="gcc -Wall" here). --megatest test the given modules one by one and all together (recommended to use CC="gcc -Wall" here). --extract-description extract the description. --extract-filelist extract the list of files. --extract-dependencies extract the dependencies. --extract-autoconf-snippet extract the snippet for configure.ac. --extract-automake-snippet extract the snippet for lib/Makefile.am. --extract-include-directive extract the #include directive. --extract-license report the license terms of the source files under lib/. --extract-maintainer report the maintainer(s) inside gnulib. --extract-tests-module report the unit test module, if it exists. Options: --dir=DIRECTORY specify the target directory. For --import, this specifies where your configure.ac can be found. Defaults to current directory. --lib=LIBRARY Specify the library name. Defaults to 'libgnu'. --source-base=DIRECTORY Directory relative --dir where source code is placed (default "lib"), for --import. --m4-base=DIRECTORY Directory relative --dir where *.m4 macros are placed (default "m4"), for --import. --tests-base=DIRECTORY Directory relative --dir where unit tests are placed (default "tests"), for --import. --aux-dir=DIRECTORY Directory relative --dir where auxiliary build tools are placed (default "build-aux"). --with-tests Include unit tests for the included modules. --avoid=MODULE Avoid including the given MODULE. Useful if you have code that provides equivalent functionality. This option can be repeated. --lgpl Abort if modules aren't available under the LGPL. Also modify license template from GPL to LGPL. --libtool Use libtool rules, for --import. --macro-prefix=PREFIX Specify the prefix of the macros 'gl_EARLY' and 'gl_INIT'. Default is 'gl'. --no-changelog don't update or create ChangeLog files. --dry-run For --import, only print what would have been done. -s, --symbolic, --symlink Make symbolic links instead of copying files. -h, --help Show summary of options. BUGS
Report bugs to <bug-gnulib@gnu.org>. SEE ALSO
check-module(1). AUTHOR
gnulib was written by the Free Software Foundation and others (sources of various origins). This manual page was written by Daniel Baumann <daniel@debian.org>, for the Debian project (but may be used by others). 0.0.20060601 2006-06-01 GNULIB-TOOL(1)
All times are GMT -4. The time now is 01:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy