This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Linux stat command: how to get the information of files in certain directory?

Hello! During the shell programming, I had a problem I should solve, I need some help. On shell programming, 'stat' command is commonly used to get the information of files or directories.

If I use the command 'stat', the result looks like this.

[1] 17 file type : directory filr size : 4096 last modification time : 2017-05-01 20:16:28 permission: 775 absolute path : /home/s/17 relative path: ./17

Under this directory, there is a sub-directory, called a. However, if I try to get the information of 'a' as the tree form, under the previous result, only this message comes out.

stat : cannot stat 'a' : No such file or directory

Is there any nice way to solve this error? I already read several posts but I still in haze. Thanks in advance!

linux ubuntu biolinux shell programming

Hello carolinie0306!

We believe that this post does not fit the main topic of this site.

not related to bioinformatics. try http://unix.stackexchange.com/

For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.

If you disagree please tell us why in a reply below, we'll be happy to talk about it.

Cheers!

Oh, I did not know about that webpage! Thanks for letting me know :)

U can try out with "tree" command. tree <file name="" or="" folder="" name="">

This might helps you out.

Oh, Thanks! I am sorry for late response. Because of all your help, I finally done my project successfully! Thanks again for all!

I'm not sure what is the use of stat command in a basic shell script. Anyway, your problem is that your a (file or folder) is NOT in the directory where you are running this stat command. That's why $stat a complains that it can not find the a

0 answers

No answers yet.

Log in to answer this question.