02-11-2011
Can anyone explain stat, i want to use it to print the filenames of all files in current directory.
Last edited by omega666; 02-11-2011 at 05:25 PM..
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Something very weird has been happening when I'm creating files and directories. When I create a directory, at times depending on the directory name and depth, it becomes hidden and can only be seen typing "ls -a". When I say the name of the directory matters, "my_c++" will be hidden but using... (10 Replies)
Discussion started by: dbinsol1
10 Replies
2. Shell Programming and Scripting
Hi,
Consider a flat file abc.conf contains some rows. Each row contains the directory name with full path. now I want to find a particular file in every directory which are mentioned in the abc.conf file. How it can be done through unix shell script. (2 Replies)
Discussion started by: surjyap
2 Replies
3. Shell Programming and Scripting
Hi,
I am unable to see all files in a current directory when use "ls -lrt" command
it is giving error message as below ( I think this current directory is having about 500 files)
<CONTROL /home/ckanth/sri>ls -lrt
UX:ls: ERROR: Out of memory: Insufficient or invalid memory
But when i... (3 Replies)
Discussion started by: srikanthus2002
3 Replies
4. Shell Programming and Scripting
Hi All
I was wondering what is the most efficient way to find files in the current directory(that may contain 100,000's files), that meets a certain specified file type and of a certain age.
I have experimented with the find command in unix but it also searches all sub directories. I have... (2 Replies)
Discussion started by: kewong007
2 Replies
5. Shell Programming and Scripting
Sun Solaris Unix Question
Haven't been able to find any solution for this situation. Let's just say the file names listed below exist in a directory. I want the find command to find all files in this directory but at the same time I want to eliminate certain file names or files with certain... (2 Replies)
Discussion started by: 2reperry
2 Replies
6. UNIX for Dummies Questions & Answers
I would need a command for finding first 15000 of the file names whose 25th postion is 5 in the current directory alone.
I do have this painful command
find . -name '5*' | head -15000 | cut -c3-
please refine this.
Of course the above command also searches in the sub directories... (3 Replies)
Discussion started by: vk39221
3 Replies
7. Shell Programming and Scripting
got it figured out :) (1 Reply)
Discussion started by: sHockz
1 Replies
8. UNIX for Dummies Questions & Answers
I have text file in Linux with two rows : first row conmtain the column nam and the second row contain its value .I nned to fetch few columns first and then redirect the data of those colum in the another file.
Any ideas?? (1 Reply)
Discussion started by: Anamica
1 Replies
9. UNIX for Dummies Questions & Answers
Hi All,
Can any one help me to list out the directory names which contain the specified file.
See for example
File name : file.201307014.LKT
Have the directory structure as below.
/app/work/data/INDIA/file.201307014.LKT
/app/work/data/AMERICA/file.201307014.KTP... (5 Replies)
Discussion started by: Balasankar
5 Replies
10. Shell Programming and Scripting
Can someone give me a tip on writing a script that, for each file in the working directory, prints the filename, the # of lines, and the # of words to stdout? (2 Replies)
Discussion started by: flash123
2 Replies
CHDIR(2) System Calls Manual CHDIR(2)
NAME
chdir - change current working directory
SYNOPSIS
#include <unistd.h>
int chdir(const char *path)
DESCRIPTION
Path is the pathname of a directory. Chdir causes this directory to become the current working directory, the starting point for path
names not beginning with ``/''.
In order for a directory to become the current directory, a process must have execute (search) access to the directory.
RETURN VALUE
Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error.
ERRORS
Chdir will fail and the current working directory will be unchanged if one or more of the following are true:
[ENOTDIR] A component of the path prefix is not a directory.
[ENAMETOOLONG] The path name exceeds PATH_MAX characters.
[ENOENT] The named directory does not exist.
[ELOOP] Too many symbolic links were encountered in translating the pathname. (Minix-vmd)
[EACCES] Search permission is denied for any component of the path name.
[EFAULT] Path points outside the process's allocated address space.
[EIO] An I/O error occurred while reading from or writing to the file system.
SEE ALSO
chroot(2).
4th Berkeley Distribution August 26, 1985 CHDIR(2)