Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
howto.doc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Documentations
howto.doc
Commits
af56cdb6
Commit
af56cdb6
authored
4 years ago
by
Quentin Ribac
Browse files
Options
Downloads
Patches
Plain Diff
grep, find -exec grep, tree
parent
eab91c5c
No related branches found
No related tags found
2 merge requests
!14
Mise à jour arborescence
,
!13
1.0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
exploitation/tips_commands.md
+27
-0
27 additions, 0 deletions
exploitation/tips_commands.md
with
27 additions
and
0 deletions
exploitation/tips_commands.md
+
27
−
0
View file @
af56cdb6
...
...
@@ -88,6 +88,33 @@ find /opt/maarch/imports/autoimport/CGR_REPRISE_COMPTA -name '*.xml' | wc
---------------------------------------------------------------
## Trouver tous les fichiers contenant un texte donné
```
bash
# recherche récursive dans tous les fichiers du dossier actuel et ses sous-dossiers
grep
-Hirn
'texte cherché'
# recherche uniquement dans les XML
find /var/www/html/
-name
'*.xml'
-exec
grep
-Hin
'texte cherché'
{}
\;
```
Pour info les options de
`grep`
:
-
`-H`
: affiche le nom du fichier
-
`-i`
: recherche insensible à la casse
-
`-r`
: recherche récursive dans tous les fichiers à partir du dossier courant
-
`-o`
: affiche uniquement la partie de la ligne correspondant à la recherche et non la ligne entière, utile en cas de très longues lignes
-
`-n`
: affiche le numéro de la ligne correspondante
---------------------------------------------------------------
## Lister l’arborescence des fichiers avec les droits et propriétaires
```
bash
tree
-finpug
```
---------------------------------------------------------------
## Liste des fichiers avec juste la taille (format lisible) et le nom
ls -lh | awk '{print $5, $9}'
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment