Monday 27 January 2014

Useful Linux Tools for Code Developers

CFLOW:
  cflow - generate a C-language flowgraph.
  cflow used to print the flow(graph) of external references. cflow has several options, please refer the man page of cflow.

cflow [r][-d num][-D name[=def]] ... [-i incl][-I dir] ... [-U dir] ...
file ... 
 
Examples: temp.c
 
#include<stdio.h>
extern void func4();
int func1();
int func2();

int func2()
{
  func4();
}

int func1()
{
  func2();
}
int main()
{
  func1();
}


Syntax:  
> cflow temp.c  or  cflow -i x temp.c
main() <int main () at temp.c:17>:
    func1() <int func1 () at temp.c:13>:
        func2() <int func2 () at temp.c:8>:
            func4()
 

temp2.c
void func4()
{
}
cflow temp.c  temp2.c
main() <int main () at temp.c:17>:
    func1() <int func1 () at temp.c:13>:
        func2() <int func2 () at temp.c:8>:
            func4() <void func4 () at temp2.c:1>



FIND command
--------------------
"find" command is used to search files in a Linux system. We can search or find files based on different ways using,
  • permissions
  • users,
  • groups
  • file type
  • data
  • size
How to find files using name in current directory ( . ["dot"] operator)?

1. Locate the files in current directory using . (dot) operator.

find . -name <filename>
e.g:root:/home/muni# find . -name sample.c./sample.c

2. How to Find  files under  particular directory

find /<directory-name> -name <file-name>
e.g:
root: find /home/muni -name sample.c
/home/muni/sample.c

root:/# find / -name sample.c
/home/muni/sample.c

root:/# find /home -name sample.c
/home/muni/sample.c

3. How to Find files with ignore case (-iname)

find /<directory-name> -iname <file-name>
e.g:
find /home/muni -iname sample.c

4. How to find directories using  name: (-type d )

find / -type d -name <directory-name>
e.g:
find / -type d -name muni

5.  How to find .sh files using name (-type f)

find /<directory-name> -type f -name <file-name.extension>
e.g:
find / -type f -name setup.sh

6. How to Find all files (using Wildcard)

find /<directory-name> -type f -name <*.extension>
e.g:
find / -type f -name *.sh

How to Find files with permissions (-perm)
find / -type f  -perm 664

How to find files With out permissions of 664
find / -type f ! -perm 664

How to find and remove particular file using  -exec rm -f {} \;
find / -type f -name setup.sh -exec rm -f {} \;

How to find and remove all files having *.sh using  -exec rm -f {} \;
find / -type f -name *.sh -exec rm -f {} \;

How to find files with 0644 permissions and change permissions to 0755
find / -type f -perm 0644 -exec chmod 777 {} \;

How to find empty files (-empty)?
find / -type f -empty

How to find empty Directories?
find / -type d -empty

How to find all files based on particular user?
find / -user muni

Find all files based on Size (-size option)
find / -size 10M -type f

How to find files by text in the file (using find + grep option)?

find . -type f -name "*.sh" -exec grep -l string {} \;    # find string in all *.sh files

find . -type f -name "*.sh" -exec grep -il string {} \; 


References:
https://alvinalexander.com/unix/edu/examples/find.shtml


33 comments:

  1. Thank you a bunch for sharing this with all of us you actually realize what you are talking about! Bookmarked.  먹튀검증

    ReplyDelete
  2. Very nice article, I enjoyed reading your post, very nice share, I want to twit this to my followers. Thanks! 먹튀검증

    ReplyDelete
  3. Hello I want to share good information. Get good information. I will get good information. Everyone will have a hard time due to the corona, but please do your best. I hope that the corona will disappear soon. It would be hard for everyone, but I hope that the more I will endure and get good results. Thank you 토토사이트

    ReplyDelete
  4. I'm constantly searching on the internet for posts that will help me. Too much is clearly to learn about this. I believe you created good quality items in Functions also. Keep working, congrats! 먹튀폴리스

    ReplyDelete
  5. Very good article, I enjoyed reading your post, very good part, I want to tweet this to my followers. Thank you 먹튀검증

    ReplyDelete
  6. Thanks for the blog post buddy! Keep them coming. 토토사이트

    ReplyDelete
  7. Hey what a brilliant post I have come across and believe me I have been searching out for this similar kind of post for past a week and hardly came across this. Thank you very much and will look for more postings from you. 안전놀이터

    ReplyDelete
  8. This is actually the kind of information I have been trying to find. Thank you for writing this information 토토사이트

    ReplyDelete
  9. 와우, 훌륭한 게시물입니다. 저도 이런 초안을 작성하고 싶습니다. 시간과 노력을 들여 훌륭한 기사를 만드세요. 이 게시물은 내가 곧 쓸 몇 가지 게시물을 작성하도록 격려했습니다. 먹튀검증

    ReplyDelete
  10. retty 좋은 게시물. 방금 귀하의 블로그를 우연히 발견하고 귀하의 블로그 게시물을 읽는 것이 정말 즐거웠다고 말하고 싶었습니다. 어떤 식 으로든 피드를 구독하고 곧 다시 게시 해 주시기 바랍니다. 유용한 정보에 감사드립니다. 먹튀검증업체

    ReplyDelete
  11. Positive site, where did u come up with the information on this posting? I'm pleased I discovered it though, ill be checking back soon to find out what additional posts you include 토토사이트

    ReplyDelete
  12. There is definately a great deal to know about this subject. I like all of the points you've made 먹튀검증

    ReplyDelete
  13. I can set up my new idea from this post. It gives in depth information. Thanks for this valuable information for all 메이저사이트

    ReplyDelete
  14. There are several dissertation web sites on the net once you locate unsurprisingly explained in the website Seo Dublin

    ReplyDelete
  15. Very good points you wrote here..Great stuff…I think you’ve made some truly interesting points.
    먹튀검증

    ReplyDelete
  16. I used to suggest this web site through 카지노사이트

    my cousin. I am no longer sure if this will publish written
    by means of it as no one else realizes such distinct about my problem.

    You are awesome! Thank you !

    ReplyDelete
  17. 토토 The information is very special, I will have to follow you, the information you bring is very real, reflecting correctly and objectively, it is very useful for society to grow together.

    ReplyDelete
  18. 카지노사이트 Hello it’s me, I am also visiting this web page on a regular
    basis, this web site is actually fastidious and the users are really sharing
    fastidious thoughts.

    ReplyDelete

  19. 온라인카지노 우리카지노 계열 중 원탑을 달리고있는 더킹카지노는 아직 만족하지 않고 온라인카지노 길에 큰 획을 그으며 점직적으로 앞을향해 나아가고 있습니다. 그 끝은 어디일까요? 안전한 우리카지노사이트 를 찾으시나요? 앞서걷는 길이 말합니다. 독보적 1위 더킹카지노입니다.메리트카지노

    ReplyDelete
  20. 현재 수많은 온라인바카라사이트가 운영되고 있습니다.
    하지만 다 같은 바카라사이트가 아닙니다.
    무리하게 첫충전을 주고 쿠폰을 난발하여 유저를모아
    제대로 된 바카라사이트운영을 하지않고 먹튀 바카라사이트 를 운영한다 해도 무방합니다.
    메리트카지노

    ReplyDelete
  21.  It is the outcome of the match that would determine which of the teams is better. 슬롯사이트

    ReplyDelete
  22. The plaster tables from Lomed Nederland are infinitely variable and adjustable in height. In addition, the seat-back segment can also be individually adjusted in height. These optimal adjustment options are the guarantee that all users can set the most ergonomic working height for them Gipstafel .

    ReplyDelete
  23. What is a groin injury? There are two types of groin injuries that you can get. These are an overuse injury and an acute injury. An overload in the groin is caused by incorrect rotational movements in the hip. An acute groin injury shoots into the groin unexpectedly, which can lead to a muscle strain or tear Liesblessure

    ReplyDelete
  24. 당신의 몸은 다른 ​​모든 것과 마찬가지로 유지 관리가 필요합니다. 마사지나 페이셜 요법으로 최상의 상태를 유지하세요 출장마사지.

    ReplyDelete