Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
list is long form all those files in your home directory that have read write and execute permissions for you, and whose name contains the string "txt"
2. Relevant commands, code, scripts, algorithms:
ls
find
3. The attempts at a solution (include all code and scripts):
ls -l would tell me the permissions
but find . -type perm 777 would give me files that have read write execute permissions
However , i feel like i should pipe it because i need a long form of those files
4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
Toronto, Ryerson , Woit, cps393
Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).
There should be nothing wrong with a pipe, but you would need xargs to make ls read from stdin - though here is an example how to do it without a pipe:
I am not sure if 777 is the right way, since your user would be able to rwx it, no matter if he is owner or in the group, as all (others) can rwx it. Since it is your home directory being mentioned you should be the user that has rwx on it. So to be more exact, you might take
as this just defines permissions for the user/owner of the file(s).
And if it is really only files you should list, ie. no directories, I would suggest:
hi thank you for the help, would this work out the same too
ls -l | find . -name "*txt*" - perm 700
---------- Post updated at 11:25 PM ---------- Previous update was at 07:43 PM ----------
forget the above, it says list in short form ( just the file names) , so the command
find . -perm 777 -name "*txt*"
would allow me to list in short form ( namely just the file names) ?
Hi,
I want to display the file names and the record count for the files in the 2nd column for the files created today.
i have written the below command which is listing the file names. but while piping the above command to the wc -l command
its not working for me.
ls -l... (5 Replies)
I am trying to extract the file names alone, for example "TVLI_STATS_NRT_XLSTWS03_20120215_132629.csv", from below output
which was given by the grep.
sam:/data/log: grep "C10_Subscribe.000|subscribe|newfile|" PDEWG511_TVLI_JOB_STATS.ksh.201202*
Output:
... (6 Replies)
Hi,
I came up with this question in one of the exercises .
Use find to produce a long ls listing of all files in /usr/bin that are
more than 750Kb long. You’ll need to use a form like
find ..... -exec ls -l {} \;
The semicolon must be escaped, but not the .
I tried using below code ,... (1 Reply)
Hi friends
I have a zip file 1.zip which contains three text files a.txt b.txt c.txt
I want to grep some text(keyword) in those 3 files without extracting all the three files to a local directoryusing the command,
unzip -p 1.zip |grep "search text" >result.txt
The Output file is... (2 Replies)
Hi,
I am new to perl:
I need to write perl script to list all the files present in directory and mail should be come to my inbox with all the files present in that directory.
advanced thanks for valuable inputs.
Thanks
Prakash GR (1 Reply)
Hi power user,
if I have this file:
file1.txt:
1111
1111
2222
2222
3333
3333
3333
4444
4444
4444
when I run the
sort file1.txt | uniq > data1.txt
the result is (2 Replies)
I have a directory named Project.I have a control file which contains valid list of files.I would like list the files from directory Project which contains files other than listed in the control file.
Sample control file:
TEST
SEND
SFFFILE
CONTL
The directory contains followign... (15 Replies)
Dear All,
I want to list all the files of a Directory. I am not able to find out the code. So plz send me code in C in Unix Environmrnt so that I can Display all the file names of a Directory (3 Replies)
Hi, is there a way from the command line that I can list all files whose names are say 20 characters or more and direct the results into a file. I'm using RH9.
thankx (2 Replies)
Does any one know how to get a recursive directory listing in long format (showing owner, group, permission etc) without listing the files contained in the directories.
The following command also shows the files but I only want to see the directories.
ls -lrtR * (4 Replies)